Bills API
Create and submit a bill
Atomically validate, create, attach the payer packet, and submit an immutable bill snapshot.
https://app.mindbill.org/partner/v2/billsCall once after the user reviews the complete bill form and presses Submit. A failed request creates no public bill.
Use this URL with a server API key or a browser session and its exact allowed Origin. Both credentials use the same request and response contract. See the component API inventory for exact paths and SDK methods.
Request body
bill.externalIdstringStable report, case, or work-item identifier in your system. Use it to find the bill later.
bill.billingMode"med_legal" | "professional"Select medical-legal billing or professional treatment billing. Professional billing requires treatmentBilling enabled for the organization; otherwise the API returns treatment_billing_not_enabled.
Default: "med_legal"bill.pricingMode"automatic" | "manual"Professional bills may use manual pricing with an explicit charge on every line and no feeContext. This skips ordinary fee-schedule quotes. Anesthesia and drug lines require the verified pricing workflow and cannot use manual mode. Medical-legal bills use automatic pricing.
Default: "automatic"bill.patient.externalIdstringYour patient identifier. Do not send this together with patient.id.
bill.patient.firstNameRequiredstringPatient given name.
bill.patient.middleNamestringPatient middle name or initial.
bill.patient.lastNameRequiredstringPatient family name.
bill.patient.dateOfBirthRequiredstringPatient date of birth.
YYYY-MM-DDbill.patient.ssnstringPatient Social Security number. Omit to use the claim-form fallback 999999999.
bill.patient.gender"M" | "F" | "X"Patient sex or gender value. Omit when unknown.
bill.patient.phonestringPatient phone number.
bill.patient.address.line1RequiredstringPatient street address.
bill.patient.address.line2stringPatient suite, unit, or secondary address line.
bill.patient.address.cityRequiredstringPatient city.
bill.patient.address.stateRequiredstringTwo-letter state code.
2 charactersbill.patient.address.postalCodeRequiredstringPatient ZIP or ZIP+4 postal code.
bill.claim.externalIdstringYour injury or claim identifier. Do not send this together with claim.id.
bill.claim.claimNumberRequiredstringWorkers’ compensation claim number assigned by the payer or administrator.
bill.claim.adjNumberstringCalifornia WCAB/EAMS case number when applicable.
bill.claim.employerRequiredstringEmployer name associated with the injury.
bill.claim.dateOfInjuryRequiredstringDate of injury. For a cumulative injury, use the final injury date and describe the range separately.
YYYY-MM-DDbill.claim.injuryStatestringTwo-letter state code governing the claim. Use CA for automatic California OMFS professional pricing.
bill.claim.descriptionstringShort injury description.
bill.claim.claimsAdministrator.idRequiredstringOpaque MindBill payer-directory identifier selected from the claims-administrator directory.
bill.claim.claimsAdministrator.payerIdstringOptional payer-choice key from the claims-administrator search results (payers[].key). Required when the selected administrator needs a payer choice; this is not a clearinghouse payer ID.
bill.claim.claimsAdministrator.nameRequiredstringCanonical carrier or third-party administrator display name.
bill.service.dateRequiredstringPrimary date of service for the bill. Fee calculations select sources and rules effective on this date unless a line supplies serviceDate.
YYYY-MM-DDbill.service.endDatestring | nullEnd date only for a service that spans multiple dates.
YYYY-MM-DDbill.service.authorizationNumberstring | nullPrior authorization number when the payer supplied one.
bill.billingProviderRequiredBillingProviderSnapshot | { savedProviderId: string }Payee identity printed in CMS-1500 boxes 25 and 33. Organization-wide integrations may supply only savedProviderId to resolve a saved billing provider without returning its SSN to the browser. Customer-scoped and bill-scoped credentials cannot use shared saved providers. The fields below are required only for an inline snapshot.
bill.billingProvider.nameRequiredstringBilling provider or practice name.
bill.billingProvider.taxIdRequiredstringBilling provider EIN or SSN.
bill.billingProvider.npiRequiredstringBilling provider NPI.
10 digitsbill.billingProvider.phoneRequiredstringBilling provider phone number.
bill.billingProvider.address.line1RequiredstringBilling provider street address.
bill.billingProvider.address.line2stringBilling provider suite, unit, or secondary address line.
bill.billingProvider.address.cityRequiredstringBilling provider city.
bill.billingProvider.address.stateRequiredstringTwo-letter state code.
2 charactersbill.billingProvider.address.postalCodeRequiredstringBilling provider ZIP or ZIP+4 postal code.
bill.renderingProviderRequiredRenderingProviderSnapshotClinician identity printed in CMS-1500 box 24J.
bill.renderingProvider.nameRequiredstringRendering clinician name.
bill.renderingProvider.npiRequiredstringRendering provider NPI.
10 digitsbill.renderingProvider.taxonomyRequiredstringNUCC taxonomy code sent with qualifier ZZ and used to identify the provider type for applicable fee rules.
10 alphanumeric charactersbill.renderingProvider.specialtystringHuman-readable specialty.
bill.renderingProvider.licenseNumberstringState professional license number.
bill.renderingProvider.licenseStatestringTwo-letter license state.
2 charactersbill.serviceLocationRequiredServiceLocationSnapshotFacility address and place-of-service code printed in CMS-1500 box 32.
bill.serviceLocation.namestringHuman-readable facility name.
bill.serviceLocation.placeOfServiceCodeRequiredstringCMS place-of-service code. Fee calculations use the actual setting, including facility versus non-facility rates where applicable.
2 digitsbill.serviceLocation.address.line1RequiredstringService location street address.
bill.serviceLocation.address.line2stringService location suite, unit, or secondary address line.
bill.serviceLocation.address.cityRequiredstringService location city.
bill.serviceLocation.address.stateRequiredstringTwo-letter state code.
2 charactersbill.serviceLocation.address.postalCodeRequiredstringService location ZIP or ZIP+4 postal code. Fee calculations use the service ZIP to select the applicable geographic locality when required.
bill.diagnosesRequiredstring[]At least one ICD-10 diagnosis code.
1–50 items; professional bills support at most 12bill.serviceLinesRequiredServiceLine[]At least one procedure line.
1–50 itemsbill.serviceLines[].codeRequiredstringProcedure or service code, such as ML201 or 99205. This selects the base schedule rule together with the service date and context.
bill.serviceLines[].modifiersstring[]Actual procedure modifiers without hyphens. Modifiers can change pricing or review requirements.
bill.serviceLines[].unitsnumberPositive integer unit count used to calculate the extended line amount.
Default: 1; 1–10,000bill.serviceLines[].chargenumberOptional extended billed-charge override in dollars, not a unit price or allowance. For supported professional lines, MindBill uses a matching practice charge or the statutory maximum when omitted. Specialty claim forms can still require a charge.
> 0bill.serviceLines[].serviceDatestringTreatment line date of service; defaults to service.date. When supplied, this date selects the applicable fee sources for the line.
YYYY-MM-DDbill.serviceLines[].serviceDateEndstringOptional treatment line end date.
YYYY-MM-DDbill.serviceLines[].diagnosisPointersnumber[]Professional treatment: one-based positions in diagnoses that apply to this procedure. Medical-legal billing uses the shared diagnosis list.
At most 4 pointers, each 1–12 and referencing a supplied diagnosisbill.serviceLines[].rfaItemIdstringOptional saved RFA item for professional treatment. The server validates the authorization against this bill; linking an item does not establish approval.
bill.serviceLines[].feeContextobjectOptional clinical and billing facts for fee verification when a service differs from the standard context inferred from the bill or requires specialty details. Explicit context wins over defaults. Unresolved pricing is returned in pricing.status and pricing.warnings rather than treating the charge as an allowance.
submission.route"ebill" | "fax" | "mail" | "email"Chosen delivery route. Omit to use MindBill routing.
submission.destinationobjectOptional intentional fax, email, or mail destination override.
documents[]BillSubmissionDocument[]Complete payer packet included atomically with the submitted bill. Maximum 25 documents, and 45 MB of PDF bytes in total across the submission.
documents[].filenameRequiredstringFilename shown in the payer packet.
documents[].documentTypeRequiredBillDocumentTypeDocument classification such as final_report, proof_of_service, w9, or other.
documents[].contentBase64RequiredstringBase64-encoded PDF bytes. Maximum 25 MB per document measured before encoding. The file must be a real PDF.
documents[].externalIdstringYour stable source-document identifier.
documents[].reportTypeCodestringOptional PWK01 report-type code. Med-legal components default to J4.
Examples
curl https://app.mindbill.org/partner/v2/bills \
--request POST \
--header "Authorization: Bearer $MINDBILL_API_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: report_9f7a" \
--data '{
"bill": {
"externalId": "report_9f7a",
"billingMode": "med_legal",
"patient": {
"externalId": "patient_42",
"firstName": "Alex",
"lastName": "Morgan",
"dateOfBirth": "1984-05-17",
"address": {
"line1": "100 Main St",
"city": "Fresno",
"state": "CA",
"postalCode": "93721"
}
},
"claim": {
"externalId": "claim_17",
"claimNumber": "WC-44871",
"employer": "Example Foods",
"dateOfInjury": "2026-02-14",
"claimsAdministrator": {
"id": "payer_example_01",
"name": "Example Claims Administrator"
}
},
"service": { "date": "2026-08-26" },
"billingProvider": {
"name": "Example Evaluations",
"taxId": "123456789",
"npi": "1234567890",
"phone": "5595550100",
"address": { "line1": "200 Market St", "city": "Fresno", "state": "CA", "postalCode": "93721" }
},
"renderingProvider": {
"name": "Morgan Chen, MD",
"npi": "1098765432",
"taxonomy": "2084P0800X"
},
"serviceLocation": {
"name": "Fresno Exam Office",
"placeOfServiceCode": "11",
"address": { "line1": "300 Pine Ave", "city": "Fresno", "state": "CA", "postalCode": "93721" }
},
"diagnoses": ["M25.512"],
"serviceLines": [{ "code": "ML201", "modifiers": ["95"], "units": 1 }]
},
"submission": { "route": "ebill" },
"documents": [{
"filename": "final-report.pdf",
"documentType": "final_report",
"contentBase64": "$FINAL_REPORT_BASE64",
"externalId": "document_73"
}]
}'import { MindBillClient } from "@mindbill/node";
const mindbill = new MindBillClient({
apiKey: process.env.MINDBILL_API_KEY!,
});
const bill = await mindbill.createAndSubmitBill({
bill: {
externalId: "report_9f7a",
billingMode: "med_legal",
patient: {
externalId: "patient_42",
firstName: "Alex",
lastName: "Morgan",
dateOfBirth: "1984-05-17",
address: {
line1: "100 Main St",
city: "Fresno",
state: "CA",
postalCode: "93721",
},
},
claim: {
externalId: "claim_17",
claimNumber: "WC-44871",
employer: "Example Foods",
dateOfInjury: "2026-02-14",
claimsAdministrator: {
id: "payer_example_01",
name: "Example Claims Administrator",
},
},
service: { date: "2026-08-26" },
billingProvider: {
name: "Example Evaluations",
taxId: "123456789",
npi: "1234567890",
phone: "5595550100",
address: { line1: "200 Market St", city: "Fresno", state: "CA", postalCode: "93721" },
},
renderingProvider: {
name: "Morgan Chen, MD",
npi: "1098765432",
taxonomy: "2084P0800X",
},
serviceLocation: {
name: "Fresno Exam Office",
placeOfServiceCode: "11",
address: { line1: "300 Pine Ave", city: "Fresno", state: "CA", postalCode: "93721" },
},
diagnoses: ["M25.512"],
serviceLines: [{ code: "ML201", modifiers: ["95"], units: 1 }],
},
submission: { route: "ebill" },
documents: [{
filename: "final-report.pdf",
documentType: "final_report",
contentBase64: finalReportBytes.toString("base64"),
externalId: "document_73",
}],
}, "report_9f7a");Response
201 Created
{
"id": "bill_01J6Y7F4Q4XK6P3J9G2C8A1B5D",
"externalId": "report_9f7a",
"state": "submitted",
"billingMode": "med_legal",
"billNumber": 1038,
"patient": { "firstName": "Alex", "lastName": "Morgan", "address": { "line1": "100 Main St", "city": "Fresno", "state": "CA", "postalCode": "93721" } },
"claim": { "claimNumber": "WC-44871", "employer": "Example Foods", "dateOfInjury": "2026-02-14", "claimsAdministrator": { "id": "payer_example_01", "name": "Example Claims Administrator" }, "diagnoses": ["M25.512"] },
"service": { "date": "2026-08-26", "endDate": null, "authorizationNumber": null },
"billingProvider": { "name": "Example Evaluations", "taxId": "123456789", "npi": "1234567890", "phone": "5595550100", "address": { "line1": "200 Market St", "city": "Fresno", "state": "CA", "postalCode": "93721" } },
"renderingProvider": { "name": "Morgan Chen, MD", "npi": "1098765432", "taxonomy": "2084P0800X" },
"serviceLocation": { "name": "Fresno Exam Office", "placeOfServiceCode": "11", "address": { "line1": "300 Pine Ave", "city": "Fresno", "state": "CA", "postalCode": "93721" } },
"serviceLines": [{
"id": "line_01",
"code": "ML201",
"modifiers": ["95"],
"units": 1,
"charge": 2015,
"allowed": 2015,
"pricing": {
"status": "calculated",
"expectedAmount": 2015,
"scheduleMaximumAmount": 2015,
"statutoryMaximumAmount": 2015,
"reimbursementBasis": "statutory_schedule",
"warnings": []
}
}],
"documents": [{
"id": "doc_01J6Y7J2E7D3J5F9Q8K4M6N1P0",
"externalId": "document_456",
"filename": "final-report.pdf",
"documentType": "final_report",
"source": "partner_api",
"addedAt": "2026-08-26T18:42:15.000Z",
"contentUrl": "https://app.mindbill.org/partner/v2/bills/bill_01J6Y7F4Q4XK6P3J9G2C8A1B5D/documents/doc_01J6Y7J2E7D3J5F9Q8K4M6N1P0/content"
}],
"amounts": { "charged": 2015, "paid": 0, "balance": 2015 }
}idRequiredstringStable MindBill bill identifier.
externalIdRequiredstring | nullYour supplied source-system identifier.
stateRequiredstringCurrent native lifecycle state.
billingModeRequired"med_legal" | "professional"Billing rule set used by the bill.
billNumberRequirednumber | nullHuman-readable MindBill bill number when assigned.
patientRequiredPatientSnapshotFrozen patient values on this bill.
claimRequiredClaimSnapshotFrozen claim and payer values, including diagnoses.
serviceRequiredobjectPrimary service date, optional end date, and authorization number.
serviceLinesRequiredServiceLine[]Procedure lines with billed charges and fee-calculation results kept separate.
serviceLines[].chargeRequirednumberExtended billed charge in dollars. This is not necessarily the expected reimbursement.
serviceLines[].pricing.statusRequired"calculated" | "manual_charge" | "requires_review"Whether the line has a verified saved calculation, only a manual charge, or needs review.
serviceLines[].pricing.expectedAmountRequirednumber | nullSaved estimated reimbursement in dollars. Null when no verified calculation is available.
serviceLines[].pricing.scheduleMaximumAmountRequirednumber | nullApplicable fee-schedule ceiling before a billed-charge cap, in dollars.
serviceLines[].pricing.statutoryMaximumAmountRequirednumber | nullStatutory maximum retained separately when a payer contract applies.
serviceLines[].pricing.reimbursementBasisRequired"statutory_schedule" | "payer_contract" | nullSource of the expected reimbursement when calculated.
serviceLines[].pricing.warningsRequiredobject[]Structured attention items such as charge_exceeds_schedule_maximum, fee_context_required, or saved_fee_quote_mismatch.
documentsRequiredBillDocument[]Documents currently included in the payer packet.
amountsRequiredobjectCharged, paid, and balance amounts.