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.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.
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.
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.
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.
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.
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.
bill.serviceLines[].modifiersstring[]Procedure modifiers without hyphens.
bill.serviceLines[].unitsnumberPositive integer unit count.
Default: 1; 1–10,000bill.serviceLines[].chargenumberReviewed total charge for this line, not a unit price. Required for professional treatment bills; do not assume a fee quote is available for every service.
> 0bill.serviceLines[].serviceDatestringTreatment line date of service; defaults to service.date.
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[].feeContextobjectClinical and billing context for server verification of a treatment fee. Code, dates, units, charge, provider/payer identity, and service location are taken from the bill. An unresolved quote returns 422 bill_fee_requires_review. See the California fee guide and OpenAPI for the applicable specialty context.
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, "allowed": 2015 }],
"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 and calculated allowed amounts.
documentsRequiredBillDocument[]Documents currently included in the payer packet.
amountsRequiredobjectCharged, paid, and balance amounts.