# Simulation responce with Invoice Hashing error Error 400

**URL:** <https://zatca1.discourse.group/t/simulation-responce-with-invoice-hashing-error-error-400/918>\
**Category:** Signing process\
**Created:** [October 29, 2023, 2:56pm UTC](https://zatca1.discourse.group/t/simulation-responce-with-invoice-hashing-error-error-400/918 "2023-10-29T14:56:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wesam](https://avatars.discourse-cdn.com/v4/letter/w/b3f665/32.png) [@Wesam](https://zatca1.discourse.group/u/Wesam)\
**Post date:** [October 29, 2023, 2:56pm UTC](https://zatca1.discourse.group/t/simulation-responce-with-invoice-hashing-error-error-400/918/1 "2023-10-29T14:56:46Z")

</div>

![Hashing Error- 400](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/c925ba2ed50f9cc2dd9981ad67898067fa3d6a8d.jpeg)  
Could you please clarify why, during the onboarding test, an Error 400 shown in the attached image appeared

---

<div class="post-metadata">

**Author:** ![Aturkistani](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Aturkistani](https://zatca1.discourse.group/u/Aturkistani)\
**Post date:** [November 9, 2023, 9:57am UTC](https://zatca1.discourse.group/t/simulation-responce-with-invoice-hashing-error-error-400/918/2 "2023-11-09T09:57:01Z")

</div>

\*\*if the invoice is standard:\*\*after hashing the invoice hash using: fatoora -generatehash -invoice [name.xml], you should edit it manually in the first digestvalue tag which represents the invoice hash in the XML

**if the invoice is simplified** : sign the invoice using SDK through this command : fatoora -sign -invoice [name.xml]

this step will edit the invoice hash inside the XML automatically & will generate a new invoice with the suffix [\_signed]

also you can use this command to generate the JSON API request to prevent the dismatch between the invoice hash in the API’s body request & xml :

fatoora -InvoiceRequest -Invoice [name.xml]

---

<div class="post-metadata">

**Author:** ![Aturkistani](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Aturkistani](https://zatca1.discourse.group/u/Aturkistani)\
**Post date:** [November 9, 2023, 9:57am UTC](https://zatca1.discourse.group/t/simulation-responce-with-invoice-hashing-error-error-400/918/3 "2023-11-09T09:57:16Z")

</div>

1- **third error:** VAT number in the CSID (Certificate) should be matched with the VAT number in the invoice of the seller (Company\_ID)

2- **first error:** hash the invoice using SDK through this command : fatoora -generatehash -invoice [name.xml]

3- **Second erro** :r Clearance API only allow you to send standard invoices, please check the invoicetypecode tag inside the xml and make it start with 01

Note: if you want to send simplified invoices, you must use the reporting API & sign invoices from your end, as signing invoices only required for simplified invoices.
