v2

latestOpenAPI 3.1.12026-08-078549932.4 MB
Invoices

Payment-time combination: merge two or more open, unpaid invoices belonging to the same client into one new invoice. Only bills past the estimate→invoice approval gate qualify — the merge copies their lines (dispense links carried over; dispensing and approval are untouched), re-runs the price rule engine against the combined line set, and archives the sources as Superseded with `mergedIntoInvoiceId` pointing at the new bill.

post/Invoices/merge

Request body

invoiceIdsstring[]
carryOrderDiscountFromInvoiceIdstring nullable

Optional: the id of one of the merged source invoices whose order-level discount code should be carried onto the combined bill (recalculated against the merged subtotal). Null carries no order-level discount forward. Only one is supported — precise per-source distribution across lines is a follow-up.

Response

Created

idstring
invoiceNumberstring
clientIdstring nullable
clientNamestring nullable
patientIdstring nullable
patientNamestring nullable
appointmentIdstring nullable
providerModestring
invoiceProviderIdstring nullable
statusstring
taxModestring

"us-sales-tax" or "vat" — snapshot at estimate creation.

notesstring nullable
mergedIntoInvoiceIdstring nullable

Set when this invoice was merged into a new combined invoice (it is then Superseded): the id of the successor bill.

mergedIntoInvoiceNumberstring nullable

Human-readable number of the successor combined invoice this one was merged into (set only on a Superseded source). Lets the UI link forward without a second fetch.

signatureDatastring nullable
signedAtstring date-time nullable
issuedAtstring date-time nullable

When the bill was issued (Draft → Unpaid) and its totals frozen. Null for Drafts and legacy invoices issued before the issue boundary.

createdAtstring date-time
updatedAtstring date-time