Error Generate PCSID Invalid-CSR at simulation

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

1 Like

I have the same problem and others have, knowing that the same steps that I used before 1/1/2025 were working 100%, we did not modify or update anything, but suddenly the problem appeared with the simulation environment only, we tried to modify the language and change some values ​​and the same problem.

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

Yes , this is what happened with me .we make a lot of integration with ZATCA and we didn’t change anything .and this is first time this error is appeared .
I try to use latest SDK to avoid any updates problem in CSR generation if exist . but the issue is still exist

1 Like

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

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

Dears @m.abdelmaksoud @easyaamal @yazsys

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

Thanks,

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

2 Likes

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.

1 Like

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

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”
}

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

How long to expect to fix it

Thank you it’s working

when will this issue be resolved?

Dear @adeelshabic

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

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”
}

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 document.

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

Thanks

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