Dry run
Check a JSON invoice payload, or preview its UBL, without sending it.
Two endpoints, same body — the exact JSON Create an invoice accepts. Neither sends anything, and neither costs an invoice number.
/v1/api/invoices/validateRuns everything a real send would check: the business rules only your company record can settle (e.g.
whether the seller is Omani), invoice number uniqueness — this reports the same conflict a send
would, so a dry run genuinely predicts whether a send will succeed — and the full Oman schematron set,
fatal errors and warnings both. Answers 200 either way; valid carries the verdict, not the status
code.
| Field | Type | Description | |
|---|---|---|---|
| (body) | object | required | Same shape as Create an invoice, sender_id included — it's used to prove ownership before validating, same as a real send |
Response fields
| Field | Type | Description | |
|---|---|---|---|
| valid | boolean | — | true when there are no errors. Warnings don't make a payload invalid |
| profile | string | — | Always om-pint here — this validates the JSON payload, not a resolved UBL profile the way /documents/validate does |
| issues[].code | string | — | Same value as rule_id on a schematron issue; a field-level check may leave it null |
| issues[].rule_id | string | — | The Oman rule identifier, e.g. IBR-019-OM, when the issue came from a schematron |
| sender_id | null | — | Always null on this endpoint — parties aren't resolved from a JSON payload the way they are from XML |
| receiver_id | null | — | Always null, same reason |
| document_id | string | — | Echoes invoice_number from the request |
The same issues[] shape Validate and Create an invoice's
400 VALIDATION_ERROR both use — one handler for all three.
Preview the UBL
/v1/api/invoices/preview-xmlSame request body. Returns the raw UBL XML a send would transmit — Content-Type: application/xml,
not the JSON envelope — so you can diff it or feed it to your own tooling. Unlike /validate, this
doesn't check invoice number uniqueness; it only builds the document. A payload that can't be built at
all fails the same way a send would — 400 VALIDATION_ERROR, see Errors.