B2c signature_error

Dear All,

after signing with with Simulation Enviroment PCSID, validating the xml with following command

fatooranet validate -invoice “D:\SignedInvoice.xml”

getting following error when validating thru Web Based Validator

  • ategory : QR_CODE_ERROR

  • **code :**hashedXml

  • message : hashedXml does not match with qr code hashedXml or the hashedXml is missing

  • category : SIGNATURE_ERROR

  • **code :**invoiceSignedDataDigestValue

  • message : wrong invoice hashing

  • category : SIGNATURE_ERROR

  • **code :**X509IssuerName

  • message : wrong X509IssuerName

  • category : SIGNATURE_ERROR

  • **code :**X509SerialNumber

  • message : wrong X509SerialNumber

  • category : SIGNATURE_ERROR

  • **code :**signatureValue

  • message : wrong signature Value

Dear @bhattiasadlatif ,
How fix it?

Errors

  • category : SIGNATURE_ERROR

  • **code :**invoiceSignedDataDigestValue

  • message : wrong invoice hashing

  • category : SIGNATURE_ERROR

  • **code :**X509IssuerName

  • message : wrong X509IssuerName

  • category : SIGNATURE_ERROR

  • **code :**xadesSignedPropertiesDigestValue

  • message : wrong xadesSignedPropertiesDigestValue

  • category : SIGNATURE_ERROR

  • **code :**X509SerialNumber

  • message : wrong X509SerialNumber

  • category : SIGNATURE_ERROR

  • **code :**signatureValue

  • message : wrong signature Value

  • category : SIGNATURE_ERROR

  • **code :**signingCertificateDigestValue

  • message : wrong signingCertificateDigestValue

i have the same problem with Simplified_Invoice only , but with Standard_Invoice it is workign fine .

Dear @alaa2025

Thanks for reaching out.

This error happens during signing process

You can follow the below steps to solve your problem:
1-After submitting the Certificate Signing Request (CSR) via the Compliance Request CSID API, you will receive a BinaryToken and a secret.
2-Decode the BinaryToken using a base64 decoder. The decoded value will be the x.509 certificate.
3-Navigate to the SDK directory: SDK/Data/Certificates/Cert.pem.
4-Replace the contents of the Cert.pem file with the x.509 certificate obtained from the decoded BinaryToken.
5-Insert the newly generated private key into the ec-secp256k1-priv-key.pem file.
6-if you use JAVA SDK, run the following command: fatoora -sign -invoice “invoice.xml”.
else the .Net SDK, run the following command: fatooranet sign -invoice “invoice.xml”
7-The invoice will now be signed and can be successfully submitted during the compliance checks phase via the Compliance Invoice API.

Do the same steps with production CSID to sign and submit e invoices to the reporting APIs.

Thanks

I am currently using PHP to generate and submit invoices to the ZATCA e-invoicing system. Could you kindly guide me on the procedure for integrating with the API in this case?

I would also like to inform you that I already have the necessary SSL certificate (ssl.cert) and private key (ssl.key) files available on my server. Please let me know the steps or any additional requirements to proceed successfully.
Looking forward to your assistance.

Dear @alaa2025

Please know that you need to review all the Educational Library shared by ZATCA on the official website, to ensure a full understanding of the integration phase.

So, our recommendations is to review the educational library first and start following the steps. then share any issue that you may face here or with the below emails:
E-invoicing@zatca.gov.sa
sp_support@zatca.gov.sa

Please find the educational library link: Educational library (zatca.gov.sa)

Thanks