Skip to main content

Update Invoice API

Introduction​

Persists edits to an individual (or compatible) invoice header and lines. Parses invoiceData as InvoiceOriginal, applies service tax via calculateServiceTaxAmount, calls invoiceService.updateInvoice, deletes/re-saves InvoiceModel rows that meet content rules, resolves BookingDetails ref for single invoice type lines, logs activity.

Source: GenerateInvoiceAPI.updateInvoice.

See also: Generate Invoice — all endpoints.


HTTP Endpoint​

| URL | /rest/generateinvoice/updateInvoice | | Method | POST |


Request Body (JSON)​

FieldRequiredDescription
userNameYesAuth.
authKeyYesAuth.
branchYesContract.
userIdYesgeneratedBy / activity.
invoiceDataYesFull InvoiceOriginal including invoiceModel list and singleInvoice dates.

Success Response (when save is true)​

KeyDescription
datatrue
invoiceNumberFrom payload.
bookingIdIncluded only when invoiceType is single (INVOICE_TYPE_SINGLE).

Headers: Access-Control-Allow-Origin: *

If update fails early, data may be absent or reflect failure; inspect empty/minimal JSON.


Example​

{
"userName": "alice",
"authKey": "k",
"branch": "default",
"userId": "42",
"invoiceData": {
"invoiceNumber": "INV-100",
"invoiceModel": [],
"singleInvoice": { "currentDate": "2026-04-01T00:00:00", "...": "..." },
"...": "..."
}
}