@shiyaf_texo you may be using Simulation Certificate on Production. You need to make sure that invoice is signed using the Production CSID from Production Environment (not PCSID generated on Simulation Environment or CCSIDs or any other CSIDs).
This usually happens when the certificate used in Simulation is not the same one required for Production (Live) onboarding.
Although the XML and signing process may be identical, the certificates are not interchangeable between Simulation and Live environments.
Why Simulation Works but Live Fails
Simulation allows you to use simulation-issued CSIDs/PCSID-hosted keys, and it does not validate them against your actual VAT (TIN) registration.
Live mode, however:
Verifies that the signing certificate (CCSID/PCSID) is issued for your real VAT number.
Validates the digital signature against the certificate installed on your production device.
Using the Simulation CSID/Certificate in Production
You must generate a new CSR from your production device and activate it using the Live onboarding APIs.
CSR created with wrong TIN or Organization Identifier
The OrganizationIdentifier in the CSR must match your VAT registration number in the exact required format:
SA<TIN>
Wrong private key / certificate pair being used for signing
If the signature is created using a different private key than the one linked to the activated CSID, you’ll get invalid-digital-signature.
Certificate not properly installed on the device
ZATCA checks device identity. A mismatch between the machine CSR and the signing certificate causes failure.
Quick Checks You Can Do
Confirm you activated a Live device, not simulation.
Verify the certificate subject contains your VAT number.
Re-sign the invoice using the newly activated Live certificate’s private key.
Inspect the DigestValue and SignatureValue to ensure they correspond to the same keypair.
Recommended Fix
Regenerate a new CSR from your production environment → Activate it via the Live “Onboarding Compliance” → Use the returned CCSID/PCSID certificate for all Live invoice signing.
We are using Production CSID only, everything was working perfectly till last week.
This is after some update from Zatca side.
For understanding whether the issue is our system or not, atleast we should be able to get the same error in Simulation or Development. But both are still working.