CSID (Cryptographic Stamp Identifier)

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

A CSID is the certificate ZATCA issues to one e-invoicing device (EGS) in the taxpayer's name; the device signs invoices and calls the Fatoora API with it.

CSID stands for Cryptographic Stamp Identifier. ZATCA defines it as a unique identifier linking an e-invoicing solution unit to a trusted party that can confirm the taxpayer's identity and uniquely identify the unit. In practice it is an X.509 certificate ZATCA issues to one device in exchange for a CSR, together with a secret.

Where it is used: in the XML, the certificate sits in ds:X509Certificate inside the signature, its issuer and serial in xades:IssuerSerial, and its public key in QR tag 8. On the API, binarySecurityToken and secret are the HTTP Basic username and password of every call.

There are two kinds: a compliance CSID for testing and a production CSID for legal invoices. Each environment issues its own, so a developer-portal certificate does not work in production. Note that binarySecurityToken is base64 of base64: decode it once before placing it in ds:X509Certificate.

Matheel signs every invoice with the device's CSID. With a device_token the certificate and key live inside the sealed token; to hold them yourself, send include_credentials: true at onboarding to get private_key, binary_security_token and secret. Renew before certificate_expires_at with /api/v1/onboarding/renew.

Example

"csid": {
  "private_key": "…",
  "binary_security_token": "…",
  "secret": "…"
}

FAQ

Can I get a CSID for my customer?

Not without an OTP from their Fatoora portal account: the certificate is issued in the taxpayer's own name.

Is one CSID enough for all of a company's devices?

No. Each device (EGS) is onboarded separately and gets its own certificate and invoice chain.

Related ZATCA rules

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