Esnad API
JSON in, signed ZATCA Phase 2 invoices out. You send seller, lines, and an EGS unit — we build UBL, sign, maintain the PIH chain, and submit to Fatoora.
First invoice in three steps
- Create a
zatca_test_key in the dashboard. - Onboard an EGS unit until
active. POST /v1/invoices/simplifiedwithAuthorization: Bearer …andegs_unit_id.
curl -X POST 'https://api.esnadapi.com/v1/invoices/simplified' \
-H 'Authorization: Bearer zatca_test_…' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: unique-key-123' \
-d '{ "egs_unit_id": "egs_…", "invoice_number": "INV-001", … }'Base URL: https://api.esnadapi.com. Full body shapes: API objects.
Responses
HTTP 200 vs 202, and why accepted invoices can still have ZATCA warnings (resubmit: false).
Errors
The error object and API 4xx codes. ZATCA content rules are not API validation errors.
Invoices
Simplified, standard, credit/debit — create, list, XML, PDF.
API objects
Seller, buyer, line items, and response compliance fields.