Compliance CSID

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

The compliance CSID is the first certificate a device gets from ZATCA, in exchange for a CSR and an OTP, used to pass the compliance checks.

The compliance CSID is step one of onboarding a device. The device sends a CSR with an OTP from the taxpayer's account, and ZATCA answers with a compliance certificate.

The call: POST /compliance with the OTP in an otp header plus accept-version: V2, and a body holding the base64 csr. There is no Basic auth, because the device has no certificate yet. The response carries binarySecurityToken, secret and requestID.

With this certificate the device submits the compliance-check samples to /compliance/invoices, and once they pass it requests the production CSID using the requestID. What goes wrong: an expired OTP (they last one hour), a CSR rejected with Invalid-CSR, or a type mismatch on requestID, which the gateway returns as a JSON number while the production call takes it as a string.

On Matheel this is the compliance_csid step inside POST /api/v1/onboarding and runs automatically. If it fails you get 422 onboarding_failed with step: "compliance_csid".

Example

POST /compliance
otp: 123345
accept-version: V2

{"csr": "<base64 CSR>"}

FAQ

Can I file real invoices with a compliance CSID?

Its job is the compliance checks. Legal invoices are signed and filed with the production CSID issued after the checks pass.

Why did ZATCA answer Invalid-CSR?

Usually extra extensions such as keyUsage, non-ASCII values inside subjectAltName, or a certificate template that does not match the environment.

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