Invoices with correct invoice hash failing with hash error on production

There are multiple invoices that have failed with the error ‘The invoice hash API body does not match the (calculated) Hash of the XML’.

We have verified the hash of all the invoices and they all are correct. Retried submitting the same invoice 12 times and they are still in rejected state.
Please suggest how to resolve this error and how many retries ideally are required for resolving this error.
There are other error codes which are resolved upon retrying but the number if retries is not always consistent i.e. sometime they get resolved with 3 retries while sometimes they get resolved with 5-6 or more retries.

you can generate the API request body (JSON request) simply by using the SDK and this command :
Fatoora -invoicerequest -invoice [invoice.xml]

just to ensure that the invoice encoded and the hash parameter sent in the request both are identical.

Regards,

Thanks! Did this and the hash and encoded invoice match exactly.
Even after this the invoice is not getting cleared after multiple retries.

what is the error returned for which the invoice is not cleared ?

“The invoice hash API body does not match the (calculated) Hash of the XML” - This is the error message. I have verified and the calculated hash matches with the invoice hash in the API body.

please provide us with the XML and your request through the RM to investigate it more

Thanks! We have asked the finance team to submit the xml through the RM for further investigation. Please check and update.

1 Like

Hi. I have the same issue previously and I got this problem when submitting invoice with arabic text. make sure that your xml is properly converted into UTF8 before hashing it and the same xml in UTF8 is submitted. you can try using postman to check and use this link (https://www.base64encode.org/) to convert your xml to UTF8. Please let me know if you got it fix

Dear @rcamartin
please note that hashing is working fine with invoices containing arabice or english text,
please share with us the invoice to investigate it more.

Regards,

Hi Sir,

Like I’ve said, we manage to fix the issue after we got a meeting with our RM and we found out that the xml were submitting were not in UTF8 format which clears our issue. It might be the same problem they are facing.

1 Like