Create ZATCA unit
/ admin/ v1/ stores/ {store_id}/ zatca/ units- settings:write
- Idempotency-Key supported
Start onboarding an e-invoicing unit: generates its secp256k1 key pair and the CSR ZATCA asks for. Next: the OTP from the Fatoora portal.
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
environmentenumrequiredThe Fatoora environment a unit joined. Only
productiondocuments are legal records; the others exist to test an integration end to end.- sandbox
- simulation
- production
namestring · or nullWhat staff call it; the branch's name when absent.
location_idstring · or nullThe branch it serves.
pos_register_idstring · or nullThe register it serves.
common_namestring · or nullDefaults to
Tijara-<VAT number>.organization_unitstring · or nullThe branch (
Online storeby default). VAT groups: the member's 10-digit TIN.locationstring · or nullThe branch's address; defaults to the seller's address.
industrystring · or nullDefaults to
Retail.
Returns
201 The unit, waiting for its OTP.
Errors
- 403
forbiddenMissing permission. - 409The store has 100 units in service (
unit_limit), another unit serves that register or location (unit_assignment_taken), or the seller is not a ZATCA seller (seller_not_ready). - 422
validation_failedValidation failed.