Production CSID

By Matheel, from ZATCA's specifications and SDK 3.4.8 · Updated

The production CSID is the certificate a ZATCA device signs and files legal invoices with. It is issued after the compliance checks and renewed with a new OTP.

The production CSID is the certificate a device works with every day: it signs every invoice and authenticates every clearance and reporting call.

It is issued once the compliance checks pass: POST /production/csids with compliance_request_id (the requestID returned with the compliance CSID) in the body, authenticated with HTTP Basic using the compliance certificate and its secret. ZATCA answers with a new binarySecurityToken and secret.

From then on, every call to /invoices/clearance/single or /invoices/reporting/single authenticates with the production CSID. The certificate expires; renewal is a PATCH to /production/csids with a new CSR and a new OTP, authenticated with the current certificate. Common mistakes: using a certificate from another environment, such as simulation, against production, and letting it lapse.

On Matheel the production CSID is the last step of POST /api/v1/onboarding, and the response includes certificate_expires_at. Before that date, send the device_token and a fresh OTP to /api/v1/onboarding/renew: you get a new token and the invoice chain (ICV and PIH) carries over.

Example

POST /production/csids
accept-version: V2
Authorization: Basic <compliance token:secret>

{"compliance_request_id": "1785585220536"}

FAQ

Does renewing the certificate reset the counter?

No. On Matheel the counter and PIH move into the renewed token unchanged.

Do I need an OTP to renew?

Yes. Renewal needs a new CSR and a new OTP from the Fatoora portal.

Related terms

Let Matheel handle this for you

Matheel signs the invoice, files it with ZATCA and keeps the counter and hash in one request, and returns the PDF with the QR.

Try Matheel, no signup Matheel API docs