v2

latestOpenAPI 3.1.12026-08-078549932.4 MB
Estimates

Revert an UNPAID invoice back to an editable estimate. Archives the bill (marks it InvoiceStatus.Superseded, keeping its lines as a read-only record), unstamps the dispense-linked transactions (so the dispenses re-appear as unbilled on the estimate), releases its appointment, reopens the source estimate to Draft, and records an ConsentEventType.InvoiceReverted consent event. Blocked once the invoice has any payment (PartiallyPaid/Paid or any non-failed Payment) — those need refund/void first. Does NOT reverse dispenses: lines stay Performed with their InventoryTransactionId on the estimate; returning stock is the separate per-line void flow. Routed under /invoices (absolute route) to match the bill it acts on; Billing-permission gated at controller level.

post/invoices/{invoiceId}/revert-to-estimate

Path parameters

invoiceIdstring required

Request body

reasonstring nullable

Free-form reason shown on the consent/audit timeline.

Response

OK

idstring
estimateNumberstring
clientIdstring nullable
clientNamestring nullable
patientIdstring nullable
patientNamestring nullable
appointmentIdstring nullable
statusstring
selectedTierstring nullable
invoiceIdstring nullable
notesstring nullable
createdByIdstring nullable
createdByNamestring nullable
createdAtstring date-time
updatedAtstring date-time