Pro forma invoices in the API: see the invoice before you issue it
The OrdoGrid API now computes a pro forma: the invoice's totals, its PDF titled pro forma and its Peppol validation, without issuing, numbering or sending anything.
- Published on
- min read
- 4 min read
In short
With contract 1.5 of the public API, POST /api/v1/pro-forma-invoices takes an invoice body and returns the invoice it would give, as a pro forma: totals, a PDF that says it is not an invoice, and the Peppol document it would become with the result of the Peppol checks. Nothing is stored, numbered or sent.
Webshops, ERPs and integrators often need to show a customer the exact invoice before the order is confirmed, or to check that an invoice will pass Peppol before they issue it. Until now, the closest call in our public API was POST /api/v1/peppol/send with "send": false. Despite appearances, it is not a preview: it issues a real, numbered invoice in your books, only without transmitting it. Contract 1.5 of the API adds a call made for the job, which issues nothing.
What the new call returns
POST /api/v1/pro-forma-invoices takes the same body as POST /api/v1/invoices, without number, external_id, attachments, pdf and communication. It goes through the same checks as an invoice, such as the purchase order and the supplier's and client's VAT details, and answers 200 with:
- The totals the invoice would have, computed exactly as on the issued invoice.
- The PDF, laid out like the invoice but titled Facture pro forma, or its translation in the document language, with the notice that the document is not an invoice and does not allow the customer to deduct VAT.
- The Peppol document the invoice would become, described field by field in
peppol.document, and the result of the Peppol and EN 16931 rules inpeppol.validandpeppol.errors. A refusal is reported there, not as an HTTP error, so you can show the customer what to fix.
With the payments:write scope, the body can include prepayments. They are deducted as on the invoice: the PDF shows the prepayments and the amount still to pay, and peppol.document.totals the prepaid and payable amounts.
What it does not do
- Nothing is stored or numbered. No document, no file, no number taken from your invoice sequence, no Peppol transmission. The call changes nothing, so it needs no
Idempotency-Key. - No payment instructions. A payment cannot be matched to a document that does not exist. Where the invoice shows the structured communication and the payment QR code, the pro forma shows a placeholder in the document language. Your IBAN appears only in the header, with your company details, because article III.25 of the Code of Economic Law requires a bank account on every business document. The bank details remain visible in
peppol.document.payment_means. - No XML file. Peppol has no document type for a pro forma, and an XML file would be an invoice that anyone could transmit. The response describes the document without returning the XML.
Why a pro forma is never the invoice
No Belgian law defines a pro forma, and VAT shown on an invoice is owed by whoever shows it. That is why the PDF says plainly what it is not. When the customer pays on the basis of a pro forma, you still issue the real invoice within the legal deadline; OrdoGrid does not link the two automatically. The rules, and when a quote, a payment request or an advance invoice is the better document, are in our guide to pro forma invoices in Belgium and the article quote, pro forma or advance invoice.
Who can use it
The API is part of the Business plan. Create a company API key with the invoices:write scope, and payments:write if you send prepayments. The request and response formats are in the API reference; the invoicing API page gives the overview, and our API integration playbook covers keys, scopes and acceptance testing. If you used "send": false as a preview, switch to the new call: it gives the same totals and Peppol check without leaving an invoice behind.