# Error Generate PCSID Invalid-CSR at simulation

**URL:** <https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026>\
**Category:** FATOORA portal and Simulation portal\
**Created:** [January 9, 2025, 11:00am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026 "2025-01-09T11:00:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.abdelmaksoud](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@m.abdelmaksoud](https://zatca1.discourse.group/u/m.abdelmaksoud)\
**Post date:** [January 9, 2025, 11:00am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/1 "2025-01-09T11:00:17Z")

</div>

Dears,  
I generated CSR file using SDK and complete operations till Try to generate PCSID ,when I call service  
[https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/production/csids](https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/production/csids)  
the response is  
{  
“errorCode”: “400”,  
“errorCategory”: “Invalid-CSR”,  
“errorMessage”: “The provided Certificate Signing Request (CSR) is invalid.”  
}  
and I don’t know what is the problem . I call compliance and get CSI using this CSR .  
My environment is simulation

The CSR file:

> **Summary**
>
> LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0NCk1JSUNPekNDQWVJQ0FRQXdnWmd4Q3pBSkJnTlZCQVlUQWxOQk1SY3dGUVlEVlFRTERBNU1ZV1IxYmkxVVUxUXQNClZVNUpWREZETUVFR0ExVUVDZ3c2MkxUWXNkbUQyS2tnMllUWXI5bUdJTm1FMllUWXA5aXoyS3JZcTltRjJLZlkNCnNTRFpoZGl6MktmWmg5bUYyS2tnMllYWmd0bUIyWVRZcVRFck1Da0dBMVVFQXd3aVRHRmtkVzVVVTFRdE16QXcNCk5EZ3pOalkyTnpBd01EQXpMVlZ1YVhReFZHVnpkREJXTUJBR0J5cUdTTTQ5QWdFR0JTdUJCQUFLQTBJQUJEVS8NCkpNWHNGbk42SUxtUFBoS25RRkFkTjRFdDN3ejRHa2lvSGU3S0pVSzRtMDVkODZLWUdLZ0xPNitXMGx6UEZYQUENCk5ENmVxZTJnSVRPUytQellhTWVnZ2Vrd2dlWUdDU3FHU0liM0RRRUpEakdCMkRDQjFUQWtCZ2tyQmdFRUFZSTMNCkZBSUVGd3dWVUZKRldrRlVRMEV0UTI5a1pTMVRhV2R1YVc1bk1JR3NCZ05WSFJFRWdhUXdnYUdrZ1o0d2dac3gNClFUQS9CZ05WQkFRTU9ERXRUR0ZrZFc1VVUxUjhNaTFVVTFReGZETXRaRFkwT1RNM05XTXRNRFEyWVMwME5UWTUNCkxUZzNZemt0WVRNeU1qSmpaak0wWmpObU1SOHdIUVlLQ1pJbWlaUHlMR1FCQVF3UE16QXdORGd6TmpZMk56QXcNCk1EQXpNUTB3Q3dZRFZRUU1EQVF4TVRBd01SRXdEd1lEVlFRYURBaFNTRTFCTnpReE5URVRNQkVHQTFVRUR3d0sNClNXNWtkWE4wY21saGJEQUtCZ2dxaGtqT1BRUURBZ05IQURCRUFpQnd3U2IyanpieFoxRVF5RGVPMXFKOFdwTG4NCmRQL0NIaUthM0ZVWmFUL0pPUUlnWm5RSFFJTENFS1dxbFJYSkprcjU1STAwK3FiMll4ZWFsSzRlWUY3cUhuaz0NCi0tLS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQ0K

could you please support me in this

---

<div class="post-metadata">

**Author:** ![easyaamal](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/easyaamal/32/780_2.png) [@easyaamal](https://zatca1.discourse.group/u/easyaamal)\
**Post date:** [January 9, 2025, 11:47am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/3 "2025-01-09T11:47:10Z")

</div>

Dear tech team in Zatca, this is not an individual error; it’s a public error. Please refer to this post for more information.  
look at this post

> [@The compliance certificate is not done with the following compliance steps yet](https://zatca1.discourse.group/t/the-compliance-certificate-is-not-done-with-the-following-compliance-steps-yet/2272/49):
>
> @idaoud I Had also onboarded about 3 EGS units in Sep Oct and Dec and on the 8-01-2025 i tried to onbaord another one but i am getting this error of Invalid CSR (Provided CSR is Invalid). i had changed the OpenSSL version Nothing worked for me Please Focus on it as it is very important .

---

<div class="post-metadata">

**Author:** ![saalotaibi](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@saalotaibi](https://zatca1.discourse.group/u/saalotaibi)\
**Post date:** [January 9, 2025, 12:39pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/5 "2025-01-09T12:39:01Z")

</div>

Dears,

@m.abdelmaksoud@easyaamal@yazsys

Thank you for reaching out.

Kindly note that this is a known general issue, that the team is investigating it, we appreciate your patience and apologize for any inconveniences. We will keep you updated once it is solved ASAP.

Thank you!

Regards,

Sara Alotaibi

---

<div class="post-metadata">

**Author:** ![m.abdelmaksoud](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@m.abdelmaksoud](https://zatca1.discourse.group/u/m.abdelmaksoud)\
**Post date:** [January 9, 2025, 12:55pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/6 "2025-01-09T12:55:11Z")

</div>

Thank you for your reply .  
Waiting your updates when issues is solved

---

<div class="post-metadata">

**Author:** ![saalotaibi](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@saalotaibi](https://zatca1.discourse.group/u/saalotaibi)\
**Post date:** [January 12, 2025, 11:22am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/7 "2025-01-12T11:22:02Z")

</div>

Dears @m.abdelmaksoud @easyaamal @yazsys

The issue is resolved, Kindly check it now and and confirm.

Thanks,

---

<div class="post-metadata">

**Author:** ![AmrSobhy](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/amrsobhy/32/805_2.png) [@AmrSobhy](https://zatca1.discourse.group/u/AmrSobhy)\
**Post date:** [January 12, 2025, 2:09pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/8 "2025-01-12T14:09:06Z")

</div>

Dear Sara Alotaibi thanks it works with me now .  
but we face a new Issue when we send any invoice(simplified(b2c)-standard(b2b)) in simulation we get a warning message “X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.”

this issue occurs today only.

Kindly see the below response of reporting api  
{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD\_ZATCA\_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“invalid-signing-certificate”,“category”:“CERTIFICATE\_ERRORS”,“message”:“X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.”,“status”:“WARNING”}],“errorMessages”:,“status”:“WARNING”},“reportingStatus”:“REPORTED”}

thank you for your efforts @saalotaibi

---

<div class="post-metadata">

**Author:** ![mollahsamim4](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@mollahsamim4](https://zatca1.discourse.group/u/mollahsamim4)\
**Post date:** [January 12, 2025, 5:22pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/9 "2025-01-12T17:22:14Z")

</div>

We also facing same issue. previous issue is solved for me also.  
But current issue is.

**X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.**

---

<div class="post-metadata">

**Author:** ![Shzzamx](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/shzzamx/32/480_2.png) [@Shzzamx](https://zatca1.discourse.group/u/Shzzamx)\
**Post date:** [January 13, 2025, 1:54pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/10 "2025-01-13T13:54:02Z")

</div>

Dear  
the issue still exists but now it is coming during generating CCSID  
Before it was coming when i generate PCSID after the compliance of the invoices

---

<div class="post-metadata">

**Author:** ![Kraken007](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/kraken007/32/686_2.png) [@Kraken007](https://zatca1.discourse.group/u/Kraken007)\
**Post date:** [January 13, 2025, 4:31pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/11 "2025-01-13T16:31:05Z")

</div>

i’m also face same problem there is anyone have solution for this

{  
“validationResults”: {  
“infoMessages”: [  
{  
“type”: “INFO”,  
“code”: “XSD\_ZATCA\_VALID”,  
“category”: “XSD validation”,  
“message”: “Complied with UBL 2.1 standards in line with ZATCA specifications”,  
“status”: “PASS”  
}  
],  
“warningMessages”: [  
{  
“type”: “WARNING”,  
“code”: “invalid-signing-certificate”,  
“category”: “CERTIFICATE\_ERRORS”,  
“message”: “X509Certificate (CCSID / PCSID) used for signing is not valid certificate (CCSID / PCSID) for this VAT Registration Number.”,  
“status”: “WARNING”  
}  
],  
“errorMessages”: ,  
“status”: “WARNING”  
},  
“reportingStatus”: “REPORTED”  
}

---

<div class="post-metadata">

**Author:** ![Shzzamx](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/shzzamx/32/480_2.png) [@Shzzamx](https://zatca1.discourse.group/u/Shzzamx)\
**Post date:** [January 16, 2025, 6:43pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/12 "2025-01-16T18:43:51Z")

</div>

you will get PCSID after the compliance of the invoices  
share this one in the xml of the invoice

i had the same issue then i checked and i was sending CCSID instead of PCSID

---

<div class="post-metadata">

**Author:** ![Bill](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@Bill](https://zatca1.discourse.group/u/Bill)\
**Post date:** [January 21, 2025, 11:13am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/13 "2025-01-21T11:13:31Z")

</div>

How long to expect to fix it

---

<div class="post-metadata">

**Author:** ![m.abdelmaksoud](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@m.abdelmaksoud](https://zatca1.discourse.group/u/m.abdelmaksoud)\
**Post date:** [January 21, 2025, 11:39am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/14 "2025-01-21T11:39:22Z")

</div>

Thank you it’s working

---

<div class="post-metadata">

**Author:** ![adeelshabic](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@adeelshabic](https://zatca1.discourse.group/u/adeelshabic)\
**Post date:** [January 30, 2025, 8:05am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/15 "2025-01-30T08:05:16Z")

</div>

when will this issue be resolved?

---

<div class="post-metadata">

**Author:** ![saalotaibi](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@saalotaibi](https://zatca1.discourse.group/u/saalotaibi)\
**Post date:** [February 2, 2025, 7:46am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/16 "2025-02-02T07:46:40Z")

</div>

Dear @adeelshabic

Kindly note that this issue has been resolved and is working fine.

---

<div class="post-metadata">

**Author:** ![Rushi1995](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@Rushi1995](https://zatca1.discourse.group/u/Rushi1995)\
**Post date:** [February 5, 2025, 8:52am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/17 "2025-02-05T08:52:23Z")

</div>

Dear @saalotaibi, I am facing below issue in simulation on /e-invoicing/simulation/invoices/reporting/single  
{  
“validationResults”: {  
“infoMessages”: [  
{  
“type”: “INFO”,  
“code”: “XSD\_ZATCA\_VALID”,  
“category”: “XSD validation”,  
“message”: “Complied with UBL 2.1 standards in line with ZATCA specifications”,  
“status”: “PASS”  
}  
],  
“warningMessages”: ,  
“errorMessages”: [  
{  
“type”: “ERROR”,  
“code”: “invalid-invoice-hash”,  
“category”: “INVOICE\_HASHING\_ERRORS”,  
“message”: “The invoice hash API body does not match the (calculated) Hash of the XML”,  
“status”: “ERROR”  
},  
{  
“type”: “ERROR”,  
“code”: “sellerName\_QRCODE\_INVALID”,  
“category”: “QRCODE\_VALIDATION”,  
“message”: “seller name does not match with qr code seller name”,  
“status”: “ERROR”  
}  
],  
“status”: “ERROR”  
},  
“reportingStatus”: “NOT\_REPORTED”  
}

---

<div class="post-metadata">

**Author:** ![saalotaibi](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@saalotaibi](https://zatca1.discourse.group/u/saalotaibi)\
**Post date:** [February 5, 2025, 3:05pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/18 "2025-02-05T15:05:38Z")

</div>

Dear @Rushi1995

Thank you for reaching out & welcome to the community.

The issue you are facing may be due to one of the following reasons:

**1. Incorrect Hash Generation for Invoices**

• Ensure that the invoice hash is correctly generated before submission.

• Use the following command to generate the hash: fatoora -generateHash -invoice “invoice.xml”

• Replace the first DigestValue in the invoice with the newly generated hash.

**2. Incorrect Signing Process for Simplified Invoices**

• Simplified invoices must be signed correctly using the taxpayer’s X.509 certificate (CSID).

• There are two X.509 certificates obtained in the onboarding process:

• CCSID (Compliance CSID): Used for signing invoices in the Compliance API.

• PCSID (Production CSID): Used for signing invoices in the Reporting API.

Manual Signing Steps Using ZATCA’s JAVA SDK:

1. After sending the CSR in the Compliance request CSID API, a BinaryToken & Secret will be returned.

2. Decode the BinaryToken using Base64 to obtain the X.509 certificate.

3. Navigate to the SDK directory: SDK/Data/Certificates/Cert.pem

4. Replace the existing certificate with your obtained X.509 certificate.

5. Use the following command to sign the invoice: fatoora -sign -invoice “invoice.xml”

6. Submit the signed invoice to the Compliance API for validation.

7. Repeat the same process using the PCSID to sign invoices before submitting them to the Reporting API.

For more details on implementing the signing process within your own code, please refer to the [SigningProcessUpdated.pdf](https://zatca1.discourse.group/uploads/short-url/b4kLmEjVf0VIx81thKX33X4tc43.pdf) document.

If you require any further assistance, please do not hesitate to reach out to the below email:  
sp\_support@zatca.gov.sa

Thanks

---

<div class="post-metadata">

**Author:** ![Shraddha](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@Shraddha](https://zatca1.discourse.group/u/Shraddha)\
**Post date:** [May 14, 2025, 5:53am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/19 "2025-05-14T05:53:50Z")

</div>

Yes , this is what happened with me .I had done integration with Business central in feb and now working for navsion with ZATCA and we didn’t change anything .and this is first time this error is appeared . just changed parameters.  
I try to use latest SDK to avoid any updates problem in CSR generation if exist . but the issue is still exist.  
Please Help ASAP

---

<div class="post-metadata">

**Author:** ![tariqhattab](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tariqhattab](https://zatca1.discourse.group/u/tariqhattab)\
**Post date:** [December 18, 2025, 1:51pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/21 "2025-12-18T13:51:32Z")

</div>

Dears,

I am facing this exact issue that appeared one year ago , after i finish compliance and call for the PCSID I get this  
{“errorCode”:“400”,“errorCategory”:“Invalid-CSR”,“errorMessage”:“The provided Certificate Signing Request (CSR) is invalid.”}

Can you help with this please ?

Thank you

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [December 21, 2025, 7:09am UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/22 "2025-12-21T07:09:14Z")

</div>

Morning @tariqhattab

Thanks for reaching out. Welcome to our community.

To provide comprehensive support as usual, can I kindly ask you to mention the exact steps you followed to generate your CSR?

Thanks,  
Ibrahem Daoud.

---

<div class="post-metadata">

**Author:** ![Mohannad.R](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@Mohannad.R](https://zatca1.discourse.group/u/Mohannad.R)\
**Post date:** [February 11, 2026, 9:01pm UTC](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026/23 "2026-02-11T21:01:20Z")

</div>

I’m facing this issue now when trying in simulation environment, I followed the steps in the ( **Integration Process Steps For E-Invoicing Phase 2 )** video

- use my company VAT number and information to generate a csr using ZATCA JAVA SDK
- use the csr to get binarySecurityToken, secret, and requestID
- use the binarySecurityToken and secret to send invoices for compliance checks
- finally use the compliance request id to get the production CSID and got this response {  
“errorCode”: “400”,  
“errorCategory”: “Invalid-CSR”,  
“errorMessage”: “The provided Certificate Signing Request (CSR) is invalid.” }

Checks:

- I update the cert.pem with secret from secret and ec-secp256k1-priv-key.pem file with the decoded from base64 value of the binarySecurityToken
- I updated the companyID in all the invoices for the compliance checks and re-generated the hash for standard invoices, and signed the simplified ones before sending all using the JAVA SDK
- I’m using zatca-einvoicing-sdk-Java-238-R3.4.6

I’m really struggling to know what is going wrong with my simulation can you please help me ?

[Next page](https://zatca1.discourse.group/t/error-generate-pcsid-invalid-csr-at-simulation/5026.md?page=2)
