# D365 F&O to ZACTA integration Error

**URL:** <https://zatca1.discourse.group/t/d365-f-o-to-zacta-integration-error/4175>\
**Category:** FATOORA portal and Simulation portal\
**Created:** [November 15, 2024, 7:10am UTC](https://zatca1.discourse.group/t/d365-f-o-to-zacta-integration-error/4175 "2024-11-15T07:10:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michelsaloumi](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Michelsaloumi](https://zatca1.discourse.group/u/Michelsaloumi)\
**Post date:** [November 15, 2024, 7:10am UTC](https://zatca1.discourse.group/t/d365-f-o-to-zacta-integration-error/4175/1 "2024-11-15T07:10:48Z")

</div>

```auto
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

```auto
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

```auto
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.

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [November 15, 2024, 7:31am UTC](https://zatca1.discourse.group/t/d365-f-o-to-zacta-integration-error/4175/2 "2024-11-15T07:31:22Z")

</div>

Try my sugesstion here, maybe this can help

> [@Transitioning from Sandbox to Simulation Environment: Handling CSR and Compliance API with ZATCA](https://zatca1.discourse.group/t/transitioning-from-sandbox-to-simulation-environment-handling-csr-and-compliance-api-with-zatca/4028/10):
>
> Try modifying OpenSSL command for generating CSR, remove parameter -extensions v3\_req Not sure in simulation as i try this on sanbox, but maybe this will help
