The invoice hash API body does not match the (calculated) Hash of the XML in Connect to zatca sandbox

The result of the test using the SDK is correct and also using Zatca is correct
And incorrect when sharing the invoice with https://gw-fatoora.zatca.gov.sa/e-invoicing/developer-portal/compliance/invoices

,"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"}]

Dear @Mohee_b ,

Thank you for reaching out.

Based on the error you have shared, kindly note that the data on the Sandbox is always static that’s why the error will always appear if you use your own data.

Therefore, we would recommend using the simulation environment as a start to integrate successfully. Thus, follow the steps of the “Fatoora Portal User Manual” on the fatoora platform (https://fatoora.zatca.gov.sa/).

Kindly find the APIs_sim image that shows the correct APIs for simulation environment.

In order to get the solution onboarded either in a production or simulation environment with real data ( not static with sandbox) , you must have the credentials to access fatoora portal to obtain the OTP.

After following the previous steps, the validation process should pass successfully.

Do not hesitate to reach out our support team via below mail.

SP support mail: sp_support@zatca.gov.sa

Thanks,

1 Like

Dear @Lina-alrehaili1
Thank you for your support and dedication to providing assistance.

1 Like

Dear @Lina-alrehaili1

Where can I get the SandBox static data so that I can simulate the entire process before moving to the Fatoora portal or the simulation portal?
Knowing that I have prepared the CSR DTO data from zatca-einvoicing-sdk-238-R3.3.3/Data/Input/csr-config-example-AR.properties and yet the error is still there
Thank you in advance

1 Like

Dear @Mohee_b ,

Thank you for reaching out.

The Sandbox environment has built -in static data that is primarily intended for understanding the onboarding steps. It is not designed for testing your actual invoicing scenarios.

For testing with your real invoicing setup, we recommend using the Simulation environment. This environment is specifically created to test and validate your configurations and processes before moving to production.

Here are the steps you can follow to resolve the issue:

  1. Make sure that you have access to fatoora simulation portal to get the OTP from it since you are using in the .cnf file certificateTemplateName to simulation env.
    2- from the fatoora simulation portal you will find an APIs documentation which showing the right API to use in order (compliance, compliance checks, PCSID, clerance, and reporting) APIs.
    3- after successfully onboarding in simulation env, you can start with production.

Please follow the steps in the below documentation, and you will be able to test signing your invoices successfully.

Fatoora_Portal_User_Manual_English.pdf

If you continue to face issues, please let me know, and I will do my best to assist further.

Best regards,

1 Like