The invoice hash API body does not match the (calculated) Hash of the XML

i always recive this error

{
“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”
}
],
“status”: “ERROR”
},
“reportingStatus”: null,
“clearanceStatus”: “NOT_CLEARED”,
“qrSellertStatus”: null,
“qrBuyertStatus”: null
}

Environment: Simulation
Link: https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/precompliance/invoices

SignResult signedResult = eInvoiceSigner.SignDocument(eInvoice, cer, privateKey);

  • eInvoice: Standard_Invoice.xml (uploaded in this email)
  • cer: Decoded from base64 for binarySecurityToken
  • privateKey:“MHQCAQEEID6mGxPXV6jTrkeKrYHeTNtFAEzy3Kqd/dIU99Xmt80xoAcGBSuBBAAKoUQDQgANJFcTJu0msyQvS5n9z7NpLO0TopSeCAFYpM4gIYCh+aisKxd7iRYzdQyBF7bFkclWJSaGb0D0RsZ6YOA==”

Notice:
When I use the following commands, everything works well:

fatoora -sign -qr -invoice Standard_Invoice.xml -signedinvoice signedinvoice.xml
fatoora -generateHash -invoice Standard_Invoice.xml

Dear @mohmed58264

Thanks for reaching out.

Please refer to the Fatoora Simulation Portal and find the tab for API documentation to locate the correct endpoint for each step in the onboarding process.

It seems that you are still not integrated with ZATCA successfully. Could you kindly answer the following questions:

  1. Are you using our SDK tool? If yes, are you using Java or .Net?
  2. Have you reviewed all the materials in the educational library provided on the ZATCA site?

Thank you,
Ibrahem Daoud.

hi IDaoud.
i am having the same issue, with .net SDK,
Fatoora command and .net SDK generate different HASH,
clearene api get clear the fatoora command generated HASH only

If you still didn’t fix this problem send me your contact by mail
Eng.Osama@topex-solutions.com