D365 F&O to ZACTA integration Error

Zatca service communication error:
The remote server returned an error: (400) Bad Request.
Detailed error message: {"errorCode":"400","errorCategory":"Invalid-CSR","errorMessage":"The provided Certificate Signing Request (CSR) is invalid."}
The process of obtaining a Compliance CSID (CCSID) is interrupted.

Environment:

  • Integration Environment: Simulation
  • Endpoint URL: https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation

I followed the documented steps for generating the CSR and ensured all required fields and configurations are included. Below is the CSR configuration I used:

CSR Configuration:

makefile

Copy code

oid_section = OIDs
[OIDs]
certificateTemplateName = 1.3.6.1.4.1.311.20.2
 
[req]
default_bits = 2048
emailAddress = invst@baghlaf.com
req_extensions = v3_req
x509_extensions = v3_ca
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
 
[dn]
C=SA
OU=BHG TSTuser
O=BHG
CN=PREZATCA-Code-Signing
 
[v3_req]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment
 
[req_ext]
certificateTemplateName = ASN1:PRINTABLESTRING:PREZATCA-Code-Signing
subjectAltName = dirName:alt_names
 
[alt_names]
SN=

1-BAGHLAF|2-BAGHLAF|3-12210125

UID=300251875100003
title=1100
registeredAddress=Jeddah
businessCategory=Investment

Despite following the steps and validating the CSR configuration, the error persists.

Thank you for your time and support. Please let me know if you need further details or configurations to assist with this issue.

Try my sugesstion here, maybe this can help