Invoicing
The canonical invoice model and how each country adapter transforms and transmits it.
There is one canonical invoice model in the platform. Every adapter — FBR, ZATCA, UAE EIS, Peppol AU/NZ, HMRC MTD — implements the same interface: transform, submit, poll, cancel, amend.
When you post an invoice, a domain event is emitted. If the tenant's country has an active e-invoicing regime, the corresponding adapter subscribes to that event and handles transformation to the local format and transmission to the authority.
The adapter is responsible for its own idempotency, its own retry policy, and its own error taxonomy. A rejection from the FBR is surfaced in the UI with the exact rejection code and a suggested remediation. A network failure is retried on a backoff schedule and does not block the user.
Invoice numbering is country-aware. Pakistan, Saudi Arabia, and Italy require gap-free sequences for tax documents; the platform reserves a number when an invoice is drafted and keeps the gap if the invoice is later cancelled, rather than allowing out-of-order numbers.