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

  1. Create a zatca_test_ key in the dashboard.
  2. Onboard an EGS unit until active.
  3. POST /v1/invoices/simplified with Authorization: Bearer … and egs_unit_id.
Example (sandbox)
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.