Hello,
We are currently facing issues generating the Compliance CSID in the Simulation portal. Every attempt ends with the error:
{“errorCode”:“400”,“errorCategory”:“Invalid-CSR”,“errorMessage”:“The provided Certificate Signing Request (CSR) is invalid.”}
What we have tried so far
-
Using the official ZATCA SDK (C# .NET)
-
We created a .NET console app and referenced the SDK DLLs.
-
We used
CsrGeneratorand also tried building the CSR manually with BouncyCastle. -
CSR is generated and private key saved.
-
Inspector shows the Subject DN contains all required RDNs:
-
C=SA -
O=<CompanyName> -
OU=<OrgUnit> -
CN=<DeviceName> -
serialNumber=1-<Seg1>|2-<Seg2>|3-<Seg3> -
2.5.4.15=<InvoiceTypeMask> -
2.5.4.97=<VATNumber>
-
-
Signature algorithm shows as
ECDSA with SHA-256. -
Curve should be P-256 (
prime256v1 / secp256r1) but in some attempts the curve OID prints asunknown
-
We are calling the Simulation endpoint:
POST https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance
Headers:
OTP: <SimulationPortalOTP>RequestID: <GUID>Accept-Version: V2Accept: application/jsonAccept-Language: en
### Issue
Despite including all required fields (masked above for security) and ensuring the CSR is generated on P-256 with SHA256withECDSA, the API always returns Invalid-CSR.
We have validated that:
- The CSR has
serialNumber,businessCategory, andorganizationIdentifier (2.5.4.97). - The VAT number is 15 digits, starting and ending with 3.
serialNumberfollows the required format:1-...|2-...|3-....- InvoiceType is 4 digits (only 0/1).
- An extension with OID
1.3.6.1.4.1.311.20.2and valuePREZATCA-Code-Signingis included.