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

**URL:** https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271
**Category:** Clearance and Reporting
**Created:** [August 5, 2024, 7:15pm UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271 "2024-08-05T19:15:27Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 5, 2024, 7:15pm UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/1 "2024-08-05T19:15:28Z")

</div>

{“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  
}

i used .NET SDK

i signed invoice by  
SignResult signedResult = \_eInvoiceSigner.SignDocument(eInvoice, cer, privateKey);

---

<div class="post-metadata">

### Author: ![Malik](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/malik/32/708_2.png) [@Malik](https://zatca1.discourse.group/u/Malik)
#### Post date: [August 6, 2024, 5:25am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/2 "2024-08-06T05:25:31Z")

</div>

Salam Mohammad,  
As the error is not cleared means you are trying B2B invoices and if so then why you are signing it using SDK? B2B you don’t need to sign locally and generate QR code but ZATCA will do once your will send for clearance and will send back signed xml. Please elaborate. thanks

---

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 6, 2024, 9:48am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/3 "2024-08-06T09:48:29Z")

</div>

thanks : but the error when compliance invoice by using link : [https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices](https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices)

---

<div class="post-metadata">

### Author: ![Malik](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/malik/32/708_2.png) [@Malik](https://zatca1.discourse.group/u/Malik)
#### Post date: [August 6, 2024, 9:52am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/4 "2024-08-06T09:52:09Z")

</div>

Hi,  
Please share your full XML and also how you calculated hash of invoice seems it is wrong calculated or you have special characters in your xml and when sent to ZATCA those are getting removed hence hash will not match with your hash sent in json. thanks

---

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 6, 2024, 10:23am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/5 "2024-08-06T10:23:07Z")

</div>

my invoice

\<?xml version="1.0" encoding="UTF-8"?\>

ext:UBLExtensions  
ext:UBLExtension  
ext:ExtensionURIurn:oasis:names:specification:ubl:dsig:enveloped:xades\</ext:ExtensionURI\>  
ext:ExtensionContent  
\<sig:UBLDocumentSignatures xmlns:sig=“urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2” xmlns:sac=“urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2” xmlns:sbc=“urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2”\>  
sac:SignatureInformation  
cbc:IDurn:oasis:names:specification:ubl:signature:1\</cbc:ID\>  
sbc:ReferencedSignatureIDurn:oasis:names:specification:ubl:signature:Invoice\</sbc:ReferencedSignatureID\>  
\<ds:Signature xmlns:ds=“[XML-Signature Syntax and Processing](http://www.w3.org/2000/09/xmldsig#)” Id=“signature”\>  
ds:SignedInfo  
\<ds:CanonicalizationMethod Algorithm=“[Canonical XML 1.1](http://www.w3.org/2006/12/xml-c14n11)”/\>  
\<ds:SignatureMethod Algorithm=“[xmldsig-more namespace](http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256)”/\>  
\<ds:Reference Id=“invoiceSignedData” URI=“”\>  
ds:Transforms  
\<ds:Transform Algorithm=“[XML Path Language (XPath)](http://www.w3.org/TR/1999/REC-xpath-19991116)”\>  
ds:XPathnot(//ancestor-or-self::ext:UBLExtensions)\</ds:XPath\>  
\</ds:Transform\>  
\<ds:Transform Algorithm=“[XML Path Language (XPath)](http://www.w3.org/TR/1999/REC-xpath-19991116)”\>  
ds:XPathnot(//ancestor-or-self::cac:Signature)\</ds:XPath\>  
\</ds:Transform\>  
\<ds:Transform Algorithm=“[XML Path Language (XPath)](http://www.w3.org/TR/1999/REC-xpath-19991116)”\>  
ds:XPathnot(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID=‘QR’])\</ds:XPath\>  
\</ds:Transform\>  
\<ds:Transform Algorithm=“[Canonical XML 1.1](http://www.w3.org/2006/12/xml-c14n11)”/\>  
\</ds:Transforms\>  
\<ds:DigestMethod Algorithm=“[XML Encryption Syntax and Processing](http://www.w3.org/2001/04/xmlenc#sha256)”/\>  
ds:DigestValuef+0WCqnPkInI+eL9G3LAry12fTPf+toC9UX07F4fI+s=\</ds:DigestValue\>  
\</ds:Reference\>  
\<ds:Reference Type=“[XML-Signature Syntax and Processing](http://www.w3.org/2000/09/xmldsig#SignatureProperties)” URI=“#xadesSignedProperties”\>  
\<ds:DigestMethod Algorithm=“[XML Encryption Syntax and Processing](http://www.w3.org/2001/04/xmlenc#sha256)”/\>  
ds:DigestValueODQwNTg1NTBhMjMzM2YxY2ZkZjVkYzdlNTZiZjY0ODJjMjNkYWI4MTUzNjdmNDVjMjAwZTBjODc2YTNhMWQ1Ng==\</ds:DigestValue\>  
\</ds:Reference\>  
\</ds:SignedInfo\>  
ds:SignatureValueMEUCIBxyR8rc4K8728wdSF4XSDqPs+rIL+3TFh9m+aNxQPtSAiEA6cHapItvp13yMSu66NbOg2CpomHwUSnYJ9h6uGQ65aY=\</ds:SignatureValue\>  
ds:KeyInfo  
ds:X509Data  
ds:X509CertificateMIID3jCCA4SgAwIBAgITEQAAOAPF90Ajs/xcXwABAAA4AzAKBggqhkjOPQQDAjBiMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnYXp0MRswGQYDVQQDExJQUlpFSU5WT0lDRVNDQTQtQ0EwHhcNMjQwMTExMDkxOTMwWhcNMjkwMTA5MDkxOTMwWjB1MQswCQYDVQQGEwJTQTEmMCQGA1UEChMdTWF4aW11bSBTcGVlZCBUZWNoIFN1cHBseSBMVEQxFjAUBgNVBAsTDVJpeWFkaCBCcmFuY2gxJjAkBgNVBAMTHVRTVC04ODY0MzExNDUtMzk5OTk5OTk5OTAwMDAzMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEoWCKa0Sa9FIErTOv0uAkC1VIKXxU9nPpx2vlf4yhMejy8c02XJblDq7tPydo8mq0ahOMmNo8gwni7Xt1KT9UeKOCAgcwggIDMIGtBgNVHREEgaUwgaKkgZ8wgZwxOzA5BgNVBAQMMjEtVFNUfDItVFNUfDMtZWQyMmYxZDgtZTZhMi0xMTE4LTliNTgtZDlhOGYxMWU0NDVmMR8wHQYKCZImiZPyLGQBAQwPMzk5OTk5OTk5OTAwMDAzMQ0wCwYDVQQMDAQxMTAwMREwDwYDVQQaDAhSUlJEMjkyOTEaMBgGA1UEDwwRU3VwcGx5IGFjdGl2aXRpZXMwHQYDVR0OBBYEFEX+YvmmtnYoDf9BGbKo7ocTKYK1MB8GA1UdIwQYMBaAFJvKqqLtmqwskIFzVvpP2PxT+9NnMHsGCCsGAQUFBwEBBG8wbTBrBggrBgEFBQcwAoZfaHR0cDovL2FpYTQuemF0Y2EuZ292LnNhL0NlcnRFbnJvbGwvUFJaRUludm9pY2VTQ0E0LmV4dGdhenQuZ292LmxvY2FsX1BSWkVJTlZPSUNFU0NBNC1DQSgxKS5jcnQwDgYDVR0PAQH/BAQDAgeAMDwGCSsGAQQBgjcVBwQvMC0GJSsGAQQBgjcVCIGGqB2E0PsShu2dJIfO+xnTwFVmh/qlZYXZhD4CAWQCARIwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMCMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwMwCgYIKwYBBQUHAwIwCgYIKoZIzj0EAwIDSAAwRQIhALE/ichmnWXCUKUbca3yci8oqwaLvFdHVjQrveI9uqAbAiA9hC4M8jgMBADPSzmd2uiPJA6gKR3LE03U75eqbC/rXA==\</ds:X509Certificate\>  
\</ds:X509Data\>  
\</ds:KeyInfo\>  
ds:Object  
\<xades:QualifyingProperties xmlns:xades=“[Assigned ETSI XML URIs](http://uri.etsi.org/01903/v1.3.2#)” Target=“signature”\>  
\<xades:SignedProperties Id=“xadesSignedProperties”\>  
xades:SignedSignatureProperties  
xades:SigningTime2024-01-14T10:21:40\</xades:SigningTime\>  
xades:SigningCertificate  
xades:Cert  
xades:CertDigest  
\<ds:DigestMethod Algorithm=“[XML Encryption Syntax and Processing](http://www.w3.org/2001/04/xmlenc#sha256)”/\>  
ds:DigestValueZDMwMmI0MTE1NzVjOTU2NTk4YzVlODhhYmI0ODU2NDUyNTU2YTVhYjhhMDFmN2FjYjk1YTA2OWQ0NjY2MjQ4NQ==\</ds:DigestValue\>  
\</xades:CertDigest\>  
xades:IssuerSerial  
ds:X509IssuerNameCN=PRZEINVOICESCA4-CA, DC=extgazt, DC=gov, DC=local\</ds:X509IssuerName\>  
ds:X509SerialNumber379112742831380471835263969587287663520528387\</ds:X509SerialNumber\>  
\</xades:IssuerSerial\>  
\</xades:Cert\>  
\</xades:SigningCertificate\>  
\</xades:SignedSignatureProperties\>  
\</xades:SignedProperties\>  
\</xades:QualifyingProperties\>  
\</ds:Object\>  
\</ds:Signature\>  
\</sac:SignatureInformation\>  
\</sig:UBLDocumentSignatures\>  
\</ext:ExtensionContent\>  
\</ext:UBLExtension\>  
\</ext:UBLExtensions\>

```
<cbc:ProfileID>reporting:1.0</cbc:ProfileID>
<cbc:ID>SME00023</cbc:ID>
<cbc:UUID>8d487816-70b8-4ade-a618-9d620b73814a</cbc:UUID>
<cbc:IssueDate>2022-09-07</cbc:IssueDate>
<cbc:IssueTime>12:21:28</cbc:IssueTime>
<cbc:InvoiceTypeCode name="0100000">388</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
<cac:AdditionalDocumentReference>
    <cbc:ID>ICV</cbc:ID>
    <cbc:UUID>23</cbc:UUID>
</cac:AdditionalDocumentReference>
<cac:AdditionalDocumentReference>
    <cbc:ID>PIH</cbc:ID>
    <cac:Attachment>
        <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject>
    </cac:Attachment>
</cac:AdditionalDocumentReference>

<cac:AdditionalDocumentReference>
    <cbc:ID>QR</cbc:ID>
    <cac:Attachment>
        <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">AW/YtNix2YPYqSDYqtmI2LHZitivINin2YTYqtmD2YbZiNmE2YjYrNmK2Kcg2KjYo9mC2LXZiSDYs9ix2LnYqSDYp9mE2YXYrdiv2YjYr9ipIHwgTWF4aW11bSBTcGVlZCBUZWNoIFN1cHBseSBMVEQCDzM5OTk5OTk5OTkwMDAwMwMTMjAyMi0wOS0wN1QxMjoyMToyOAQENC42MAUDMC42BixmKzBXQ3FuUGtJbkkrZUw5RzNMQXJ5MTJmVFBmK3RvQzlVWDA3RjRmSStzPQdgTUVVQ0lCeHlSOHJjNEs4NzI4d2RTRjRYU0RxUHMrcklMKzNURmg5bSthTnhRUHRTQWlFQTZjSGFwSXR2cDEzeU1TdTY2TmJPZzJDcG9tSHdVU25ZSjloNnVHUTY1YVk9CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAShYIprRJr0UgStM6/S4CQLVUgpfFT2c+nHa+V/jKEx6PLxzTZcluUOru0/J2jyarRqE4yY2jyDCeLte3UpP1R4</cbc:EmbeddedDocumentBinaryObject>
    </cac:Attachment>

```

\</cac:AdditionalDocumentReference\>cac:Signature  
cbc:IDurn:oasis:names:specification:ubl:signature:Invoice\</cbc:ID\>  
cbc:SignatureMethodurn:oasis:names:specification:ubl:dsig:enveloped:xades\</cbc:SignatureMethod\>  
\</cac:Signature\>cac:AccountingSupplierParty  
cac:Party  
cac:PartyIdentification  
\<cbc:ID schemeID=“CRN”\>1010010000\</cbc:ID\>  
\</cac:PartyIdentification\>  
cac:PostalAddress  
cbc:StreetNamejazan\</cbc:StreetName\>  
cbc:BuildingNumber2322\</cbc:BuildingNumber\>  
cbc:CitySubdivisionNameAl-Murabba\</cbc:CitySubdivisionName\>  
cbc:CityNameRiyadh\</cbc:CityName\>  
cbc:PostalZone23333\</cbc:PostalZone\>  
cac:Country  
cbc:IdentificationCodeSA\</cbc:IdentificationCode\>  
\</cac:Country\>  
\</cac:PostalAddress\>  
cac:PartyTaxScheme  
cbc:CompanyID302125376400003\</cbc:CompanyID\>  
cac:TaxScheme  
cbc:IDVAT\</cbc:ID\>  
\</cac:TaxScheme\>  
\</cac:PartyTaxScheme\>  
cac:PartyLegalEntity  
cbc:RegistrationNameFatoora Samples LTD\</cbc:RegistrationName\>  
\</cac:PartyLegalEntity\>  
\</cac:Party\>  
\</cac:AccountingSupplierParty\>  
cac:AccountingCustomerParty  
cac:Party  
cac:PostalAddress  
cbc:StreetNameSalah Al-Din\</cbc:StreetName\>  
cbc:BuildingNumber1111\</cbc:BuildingNumber\>  
cbc:CitySubdivisionNameAl-Murooj\</cbc:CitySubdivisionName\>  
cbc:CityNameRiyadh\</cbc:CityName\>  
cbc:PostalZone12222\</cbc:PostalZone\>  
cac:Country  
cbc:IdentificationCodeSA\</cbc:IdentificationCode\>  
\</cac:Country\>  
\</cac:PostalAddress\>  
cac:PartyTaxScheme  
cbc:CompanyID311344436300003\</cbc:CompanyID\>  
cac:TaxScheme  
cbc:IDVAT\</cbc:ID\>  
\</cac:TaxScheme\>  
\</cac:PartyTaxScheme\>  
cac:PartyLegalEntity  
cbc:RegistrationNameMaximum Speed Tech Supply LTD\</cbc:RegistrationName\>  
\</cac:PartyLegalEntity\>  
\</cac:Party\>  
\</cac:AccountingCustomerParty\>  
cac:Delivery  
cbc:ActualDeliveryDate2022-09-07\</cbc:ActualDeliveryDate\>  
\</cac:Delivery\>  
cac:PaymentMeans  
cbc:PaymentMeansCode10\</cbc:PaymentMeansCode\>  
\</cac:PaymentMeans\>  
cac:AllowanceCharge  
cbc:ChargeIndicatorfalse\</cbc:ChargeIndicator\>  
cbc:AllowanceChargeReasondiscount\</cbc:AllowanceChargeReason\>  
\<cbc:Amount currencyID=“SAR”\>0.00\</cbc:Amount\>  
cac:TaxCategory  
\<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”\>S\</cbc:ID\>  
cbc:Percent15\</cbc:Percent\>  
cac:TaxScheme  
\<cbc:ID schemeID=“UN/ECE 5153” schemeAgencyID=“6”\>VAT\</cbc:ID\>  
\</cac:TaxScheme\>  
\</cac:TaxCategory\>  
\</cac:AllowanceCharge\>  
cac:TaxTotal  
\<cbc:TaxAmount currencyID=“SAR”\>0.6\</cbc:TaxAmount\>  
\</cac:TaxTotal\>  
cac:TaxTotal  
\<cbc:TaxAmount currencyID=“SAR”\>0.6\</cbc:TaxAmount\>  
cac:TaxSubtotal  
\<cbc:TaxableAmount currencyID=“SAR”\>4.00\</cbc:TaxableAmount\>  
\<cbc:TaxAmount currencyID=“SAR”\>0.60\</cbc:TaxAmount\>  
cac:TaxCategory  
\<cbc:ID schemeID=“UN/ECE 5305” schemeAgencyID=“6”\>S\</cbc:ID\>  
cbc:Percent15.00\</cbc:Percent\>  
cac:TaxScheme  
\<cbc:ID schemeID=“UN/ECE 5153” schemeAgencyID=“6”\>VAT\</cbc:ID\>  
\</cac:TaxScheme\>  
\</cac:TaxCategory\>  
\</cac:TaxSubtotal\>  
\</cac:TaxTotal\>  
cac:LegalMonetaryTotal  
\<cbc:LineExtensionAmount currencyID=“SAR”\>4.00\</cbc:LineExtensionAmount\>  
\<cbc:TaxExclusiveAmount currencyID=“SAR”\>4.00\</cbc:TaxExclusiveAmount\>  
\<cbc:TaxInclusiveAmount currencyID=“SAR”\>4.60\</cbc:TaxInclusiveAmount\>  
\<cbc:AllowanceTotalAmount currencyID=“SAR”\>0.00\</cbc:AllowanceTotalAmount\>  
\<cbc:PrepaidAmount currencyID=“SAR”\>0.00\</cbc:PrepaidAmount\>  
\<cbc:PayableAmount currencyID=“SAR”\>4.60\</cbc:PayableAmount\>  
\</cac:LegalMonetaryTotal\>  
cac:InvoiceLine  
cbc:ID1\</cbc:ID\>  
\<cbc:InvoicedQuantity unitCode=“PCE”\>2.000000\</cbc:InvoicedQuantity\>  
\<cbc:LineExtensionAmount currencyID=“SAR”\>4.00\</cbc:LineExtensionAmount\>  
cac:TaxTotal  
\<cbc:TaxAmount currencyID=“SAR”\>0.60\</cbc:TaxAmount\>  
\<cbc:RoundingAmount currencyID=“SAR”\>4.60\</cbc:RoundingAmount\>  
\</cac:TaxTotal\>  
cac:Item  
cbc:Namepencel\</cbc:Name\>  
cac:ClassifiedTaxCategory  
cbc:IDS\</cbc:ID\>  
cbc:Percent15.00\</cbc:Percent\>  
cac:TaxScheme  
cbc:IDVAT\</cbc:ID\>  
\</cac:TaxScheme\>  
\</cac:ClassifiedTaxCategory\>  
\</cac:Item\>  
cac:Price  
\<cbc:PriceAmount currencyID=“SAR”\>2.00\</cbc:PriceAmount\>  
cac:AllowanceCharge  
cbc:ChargeIndicatortrue\</cbc:ChargeIndicator\>  
cbc:AllowanceChargeReasondiscount\</cbc:AllowanceChargeReason\>  
\<cbc:Amount currencyID=“SAR”\>0.00\</cbc:Amount\>  
\</cac:AllowanceCharge\>  
\</cac:Price\>  
\</cac:InvoiceLine\>

---

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 6, 2024, 10:24am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/6 "2024-08-06T10:24:42Z")

</div>

this is my code :

```
     var hashInvoice = _eInvoiceHashGenerator.GenerateEInvoiceHashing(eInvoice);

        var cer = Base64Converter.Base64Decode(binarySecurityToken);

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

```

---

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 6, 2024, 10:25am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/7 "2024-08-06T10:25:22Z")

</div>

hi\>\>thank you \>\> ok i will send now

---

<div class="post-metadata">

### Author: ![Malik](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/malik/32/708_2.png) [@Malik](https://zatca1.discourse.group/u/Malik)
#### Post date: [August 6, 2024, 11:24am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/8 "2024-08-06T11:24:02Z")

</div>

Hi,  
As you have B2B then remove ext:UBLExtensions to \</ext:UBLExtensions\> secondly upload as text document it is not a proper xml.

> [@mohmed58264](#):
>
> \</ext:UBLExtensions\>

---

<div class="post-metadata">

### Author: ![mohmed58264](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mohmed58264](https://zatca1.discourse.group/u/mohmed58264)
#### Post date: [August 6, 2024, 12:04pm UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/9 "2024-08-06T12:04:08Z")

</div>

thank you\>

i removed ext:UBLExtensions to \</ext:UBLExtensions\> and uploaded it as text but i still have same 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  
}

notic : i am use .NET SDK to sign invice and when i use cmd :fatoora -sign -qr -invoice Standard\_Invoice.xml -signedinvoice signed.xml it’s work well

---

<div class="post-metadata">

### Author: ![Madleen](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Madleen](https://zatca1.discourse.group/u/Madleen)
#### Post date: [August 29, 2024, 10:13am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/10 "2024-08-29T10:13:10Z")

</div>

Dear @mohmed58264 ,  
How you solve this problem?

---

<div class="post-metadata">

### Author: ![Eng.Osama](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@Eng.Osama](https://zatca1.discourse.group/u/Eng.Osama)
#### Post date: [November 6, 2024, 12:26pm UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/11 "2024-11-06T12:26:37Z")

</div>

If you still didn’t fix this problem send me your contact by mail  
[Eng.Osama@topex-solutions.com](mailto:Eng.Osama@topex-solutions.com)

---

<div class="post-metadata">

### Author: ![Eng.Osama](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@Eng.Osama](https://zatca1.discourse.group/u/Eng.Osama)
#### Post date: [November 7, 2024, 1:48pm UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/12 "2024-11-07T13:48:22Z")

</div>

@Madleen Did you fix this problem ?

---

<div class="post-metadata">

### Author: ![AhmedNofal](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@AhmedNofal](https://zatca1.discourse.group/u/AhmedNofal)
#### Post date: [May 20, 2025, 9:50am UTC](https://zatca1.discourse.group/t/he-invoice-hash-api-body-does-not-match-the-calculated-hash-of-the-xml/2271/13 "2025-05-20T09:50:09Z")

</div>

Dear Mohamed,

I encountered the same issue and fixed it by using the hash of the signed invoice instead of the the hash of the invoice before it was signed like so:  
{  
“invoiceHash”: _The Hash generated from the signed invoice_,  
“uuid”: _the UUID_,  
“invoice”: _Encoded XML_  
}

keep in mind that the DotNet sdk currently generates the request body with the the hash of the invoice before it was signed which causes this error when submitted to the api.

hope this helps 🙂
