Skip to main content

Update Draft to Summary Invoice API

Introduction​

Promotes a draft summary invoice to a generated invoice: assigns a new invoice number (respects company code from booking, customer-specific prefix feature, and invoice format settings), sets status GENERATED, updateInvoiceOriginalWithNativeSQL, updates related Invoicing rows and line items, persists summary first page. If generateEInvoice on the payload is true, invokes eInvoiceService.updateEinvoiceXml after success.

Source: GenerateInvoiceAPI.updateDraftToSummaryInvoice.

See also: Generate Invoice — all endpoints.


HTTP Endpoint​

| URL | /rest/generateinvoice/updateDraftToSummaryInvoice | | Method | POST |


Request Body (JSON)​

FieldRequiredDescription
userNameYesAuth.
authKeyYesAuth.
branchYesContract.
userIdYesActivity.
invoiceDataYesInvoiceOriginal (includes generateEInvoice, summaryFirstPageData, etc.).
selectedDataNoAdditional Invoicing entries; merged with booking lines per loop logic.

Success Response​

{
"data": true,
"invoiceNumber": "<new number>",
"bookingId": "..."
}

Headers: Access-Control-Allow-Origin: *


Behaviour notes​

  • Settings may be loaded per company code of the booking when present.
  • Invoice number generation branches on customer-specific prefix and use invoice format flags.

Example​

{
"userName": "alice",
"authKey": "k",
"branch": "default",
"userId": "42",
"invoiceData": {
"generateEInvoice": false,
"bookingId": "BK-REF",
"...": "draft summary InvoiceOriginal"
},
"selectedData": []
}