ZATCA Phase 2 for developers: the rules that cause rejections
Rejected invoices often fail on the same few rules. None of them are hard — they are just easy to miss.
On this page
Key takeaways
- Common rejections come from rounding, the invoice hash chain, and missing buyer fields.
- Validate locally with the same rules before calling the API.
- Treat the hash chain as data you must never lose.
Rounding is the first trap
VAT must be rounded per line and per invoice in a specific order. Round in the wrong place and totals differ by one halala — enough for a rejection.
The hash chain
Every invoice includes the hash of the previous one. Lose or reorder one, and every invoice after it fails. Store the chain like financial data, with backups.
If the chain breaks, every invoice after it breaks too.
Missing buyer fields
A standard tax invoice to a business needs the buyer's VAT number and address. A simplified invoice does not. Decide the invoice type first, then require the fields that type needs.
Validate before you submit
Run the same validation rules locally first. Rejections then become test failures you fix in development, not support tickets in production.
- ZATCA
- E-invoicing
- Compliance
Was this article useful? Thanks for the feedback!
Software & AI Engineer in Riyadh. I write about building systems where mistakes are expensive.