Skip to main content

Get Single Invoice As JSON API

Introduction​

Produces individual invoice print JSON using INDIVIDUAL_INVOICE_TEMPLATE_NAME from invoice.properties. Loads invoice and lines, enriches customer (DO number when not blank type), formats costs/row totals with DecimalFormat #,###.00, parses the first line’s description into truckTonnage, truckType, and routing (handles "Ex." variant), adds currency and truck (from first getInvoiceListForMail row) to invoiceDetails.

Source: GenerateInvoiceAPI.getSingleInvoiceJSON (@Path("getSingleInvoiceAsJson")).

See also: Generate Invoice — all endpoints.


HTTP Endpoint​

| URL | /rest/generateinvoice/getSingleInvoiceAsJson | | Method | POST |


Request Body (JSON)​

FieldRequired
userNameYes
authKeyYes
branchYes
invoiceNumberYes

Response (top-level)​

KeyDescription
invoiceDetailsNumber, date, credit terms, remarks, currency, truck, subtotal/tax/grand total, amountInWords, templateName.
customerDetailssingleInvoice customer block.
firstPageDetailsArray of line items with display formatting.

Headers: Access-Control-Allow-Origin: *


Example​

{
"userName": "alice",
"authKey": "k",
"branch": "default",
"invoiceNumber": "INV-2026-050"
}