# We have an issue in simulation but working in developer-portal

**URL:** <https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350>\
**Category:** FATOORA portal and Simulation portal\
**Created:** [March 12, 2024, 5:00am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350 "2024-03-12T05:00:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [March 12, 2024, 5:00am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/1 "2024-03-12T05:00:26Z")

</div>

We are trying to integrate Zatca with our Logistic application for e-invoicing. Now we are completed our development process. and we checked that in developer portel. it is working. But it is not working in simulation. how to get a support to overcome this issue?

Our error messages are shown below,

1. The invoice hash API body does not match the (calculated) Hash of the XML
2. Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’

Detailed error response is,

```auto
“errorMessages”:
[
{
“code”: “invalid-invoice-hash”,
“type”: “ERROR”,
“status”: “ERROR”,
“message”: “The invoice hash API body does not match the (calculated) Hash of the XML”,
“category”: “INVOICE_HASHING_ERRORS”
},
{
“code”: “signed-properties-hashing”,
“type”: “ERROR”,
“status”: “ERROR”,
“message”: “Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’”,
“category”: “CERTIFICATE_ERRORS”
}
],

```

The generated XML file is

```auto
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
    <ext:UBLExtensions>
        <ext:UBLExtension>
            <ext:ExtensionURI>urn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>
            <ext:ExtensionContent>
                <sig:UBLDocumentSignatures xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2" xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2" xmlns:sig="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2">
                    <sac:SignatureInformation>
                        <cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>
                        <sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>
                        <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="signature">
                            <ds:SignedInfo>
                                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
                                <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"/>
                                <ds:Reference Id="invoiceSignedData" URI="">
                                    <ds:Transforms>
                                        <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                            <ds:XPath>not(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
                                        </ds:Transform>
                                        <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                            <ds:XPath>not(//ancestor-or-self::cac:Signature)</ds:XPath>
                                        </ds:Transform>
                                        <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                            <ds:XPath>not(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID='QR'])</ds:XPath>
                                        </ds:Transform>
                                        <ds:Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"/>
                                    </ds:Transforms>
                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                    <ds:DigestValue>PmHhFlGFyY86tUX98dZkhSmZcUWfG8e0aZMyKDblMWg=</ds:DigestValue>
                                </ds:Reference>
                                <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#xadesSignedProperties">
                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                    <ds:DigestValue>ZjI3NGFmMTUxYTE1Y2M2NDBlMzMxZmY2MDkyNjZkZmVlNWZiYWI2OTJiZmU0MzAxNzQwNjEyOTNmM2E4YzIzNQ==</ds:DigestValue>
                                </ds:Reference>
                            </ds:SignedInfo>
                            <ds:SignatureValue>MEYCIQDnWghZ9uEzejRifd2cO7nzZKeVY9ysA7cyk6y307z2cwIhAKaYqfrLx/GT143eAwXQXOQrkfJ0vDk+qsf1vDmJ4/jy</ds:SignatureValue>
                            <ds:KeyInfo>
                                <ds:X509Data>
                                    <ds:X509Certificate>MIICSDCCAe2gAwIBAgIGAY4NOn8MMAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjQwMzA1MDYwODM2WhcNMjkwMzA0MjEwMDAwWjBjMRcwFQYDVQQDDA5FR1MxLTg4NjQzMTE0NTETMBEGA1UECwwKMTIzNDU2Nzg5MDEmMCQGA1UECgwdR2xhdWJldGVjaCBJbnZlbnRpb25zIFB2dCBMdGQxCzAJBgNVBAYTAlNBMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8IiqKGrY+Lvnnf8seaF9XXtgIBmNWs5MwVXDWUlHcESz0PEX2mQbDP2tnw0N4sxCyOSUyZNektBrXce0UHd1qqOB3TCB2jAMBgNVHRMBAf8EAjAAMIHJBgNVHREEgcEwgb6kgbswgbgxQTA/BgNVBAQMODEtQlJJREdFTENTfDItSU9TfDMtOWI3ZDJhZDctOGRjZC00YTE1LTlhYWItOWNkMTc5MGQ2M2MyMR8wHQYKCZImiZPyLGQBAQwPMzEwOTA2MzkwODAwMDAzMQ0wCwYDVQQMDAQwMTAwMTQwMgYDVQQaDCswMDAwIDJuZCBmbG9vciwgUGF5eW9saSBCdWlsZGluZywgS296aGlrb2RlMQ0wCwYDVQQPDARGb29kMAoGCCqGSM49BAMCA0kAMEYCIQDDrmvhN5rU/9Ogqk0qJfU2j8t10JxxyhND1eB22ziBdAIhALjCl1IEOcrj1FpmUOmPiMxRQNW/i1RvK9HBwYWKettN</ds:X509Certificate>
                                </ds:X509Data>
                            </ds:KeyInfo>
                            <ds:Object>
                                <xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature">
                                    <xades:SignedProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Id="xadesSignedProperties">
                                    <xades:SignedSignatureProperties>
                                        <xades:SigningTime>2024-03-05T06:08:41Z</xades:SigningTime>
                                        <xades:SigningCertificate>
                                            <xades:Cert>
                                                <xades:CertDigest>
                                                    <ds:DigestMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                                    <ds:DigestValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#">OGU2ODcxYmFmNmM3OWFhZjhjMjgyZGI3YTk4MmIyOTQxNWMwOWRlOTViMzFmYzk3ZTc5NjAzNzg3ZDZmMWZhZQ==</ds:DigestValue>
                                                </xades:CertDigest>
                                                <xades:IssuerSerial>
                                                    <ds:X509IssuerName xmlns:ds="http://www.w3.org/2000/09/xmldsig#">CN=eInvoicing</ds:X509IssuerName>
                                                    <ds:X509SerialNumber xmlns:ds="http://www.w3.org/2000/09/xmldsig#">1709618921228</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>EGS1-886431145-1</cbc:ID>
    <cbc:UUID>9b7d2ad7-8dcd-4a15-9aab-9cd1790d63c2</cbc:UUID>
    <cbc:IssueDate>2024-03-05</cbc:IssueDate>
    <cbc:IssueTime>06:08:41</cbc:IssueTime>
    <cbc:InvoiceTypeCode name="0211010">388</cbc:InvoiceTypeCode>
    <cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
    <cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
    <cac:AdditionalDocumentReference>
        <cbc:ID>ICV</cbc:ID>
        <cbc:UUID>1</cbc:UUID>
    </cac:AdditionalDocumentReference>
    
    <cac:AdditionalDocumentReference>
        <cbc:ID>QR</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">AR1HbGF1YmV0ZWNoIEludmVudGlvbnMgUHZ0IEx0ZAIPMzEwOTA2MzkwODAwMDAzAxQyMDI0LTAzLTA1VDA2OjA4OjQxWgQGMjAwLjAwBQQwLjAwBixQbUhoRmxHRnlZODZ0VVg5OGRaa2hTbVpjVVdmRzhlMGFaTXlLRGJsTVdnPQdgTUVZQ0lRRG5XZ2haOXVFemVqUmlmZDJjTzduelpLZVZZOXlzQTdjeWs2eTMwN3oyY3dJaEFLYVlxZnJMeC9HVDE0M2VBd1hRWE9RcmtmSjB2RGsrcXNmMXZEbUo0L2p5CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAATwiKooatj4u+ed/yx5oX1de2AgGY1azkzBVcNZSUdwRLPQ8RfaZBsM/a2fDQ3izELI5JTJk16S0Gtdx7RQd3WqCUgwRgIhAMOua+E3mtT/06CqTSol9TaPy3XQnHHKE0PV4HbbOIF0AiEAuMKXUgQ5yuPUWmZQ6Y+IzFFA1b+LVG8r0cHBhYp6200=</cbc:EmbeddedDocumentBinaryObject>
        </cac:Attachment>
    </cac:AdditionalDocumentReference>
    <cac:Signature>
      <cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>
      <cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>
    </cac:Signature>
    <cac:AccountingSupplierParty>
        <cac:Party>
            <cac:PartyIdentification>
                <cbc:ID schemeID="CRN">454634645645654</cbc:ID>
            </cac:PartyIdentification>
            <cac:PostalAddress>
                <cbc:StreetName>2nd floor, Payyoli Building</cbc:StreetName>
                <cbc:BuildingNumber>0000</cbc:BuildingNumber>
                <cbc:PlotIdentification>0000</cbc:PlotIdentification>
                <cbc:CitySubdivisionName>Kozhikode</cbc:CitySubdivisionName>
                <cbc:CityName>Kozhikode</cbc:CityName>
                <cbc:PostalZone>31952</cbc:PostalZone>
                <cac:Country>
                    <cbc:IdentificationCode>SA</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
                <cbc:CompanyID>3#######0#00003</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName>Glaubetech Inventions Pvt Ltd</cbc:RegistrationName>
            </cac:PartyLegalEntity>
        </cac:Party>
    </cac:AccountingSupplierParty>
    <cac:AccountingCustomerParty/>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="SAR">200.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
            <cac:TaxCategory>
                <cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">O</cbc:ID>
                <cbc:Percent>0.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:TaxCategory>
        </cac:TaxSubtotal>
    </cac:TaxTotal>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
    </cac:TaxTotal>
    <cac:LegalMonetaryTotal>
        <cbc:LineExtensionAmount currencyID="SAR">200.00</cbc:LineExtensionAmount>
        <cbc:TaxExclusiveAmount currencyID="SAR">200.00</cbc:TaxExclusiveAmount>
        <cbc:TaxInclusiveAmount currencyID="SAR">200.00</cbc:TaxInclusiveAmount>
        <cbc:AllowanceTotalAmount currencyID="SAR">0</cbc:AllowanceTotalAmount>
        <cbc:PrepaidAmount currencyID="SAR">0</cbc:PrepaidAmount>
        <cbc:PayableAmount currencyID="SAR">200.00</cbc:PayableAmount>
    </cac:LegalMonetaryTotal>
    <cac:InvoiceLine>
        <cbc:ID>1004</cbc:ID>
        <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="SAR">200.00</cbc:LineExtensionAmount>
        <cac:TaxTotal>
            <cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
            <cbc:RoundingAmount currencyID="SAR">200.00</cbc:RoundingAmount>
        </cac:TaxTotal>
        <cac:Item>
            <cbc:Name>12321313</cbc:Name>
            <cac:ClassifiedTaxCategory>
                <cbc:ID>O</cbc:ID>
                <cbc:Percent>0.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:ClassifiedTaxCategory>
        </cac:Item>
        <cac:Price>
            <cbc:PriceAmount currencyID="SAR">200</cbc:PriceAmount>
        </cac:Price>
    </cac:InvoiceLine>
</Invoice>

```

Please Help me to fix this issue

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [March 13, 2024, 4:27am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/2 "2024-03-13T04:27:47Z")

</div>

Please help to fix this issue

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [March 14, 2024, 5:12am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/3 "2024-03-14T05:12:51Z")

</div>

I fixed first error that is

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

Please help to fix the second one

> Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’

---

<div class="post-metadata">

**Author:** ![Mohammad.Baker](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Mohammad.Baker](https://zatca1.discourse.group/u/Mohammad.Baker)\
**Post date:** [June 3, 2024, 9:27pm UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/4 "2024-06-03T21:27:19Z")

</div>

> [@salman](#):
>
> I fixed first error that is

Can you share solution “The invoice hash API body does not match”

---

<div class="post-metadata">

**Author:** ![Sulaman](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@Sulaman](https://zatca1.discourse.group/u/Sulaman)\
**Post date:** [August 22, 2024, 5:12pm UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/5 "2024-08-22T17:12:00Z")

</div>

> [@salman](#):
>
> > Invalid signed properties hashing, SignedProperties with id=‘xadesSignedProperties’

Did you find the solution for this? What language you’re using?

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [September 24, 2024, 11:23am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/6 "2024-09-24T11:23:36Z")

</div>

I fixed it in php laravel

---

<div class="post-metadata">

**Author:** ![AhmedTarekYA](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AhmedTarekYA](https://zatca1.discourse.group/u/AhmedTarekYA)\
**Post date:** [October 31, 2024, 6:34am UTC](https://zatca1.discourse.group/t/we-have-an-issue-in-simulation-but-working-in-developer-portal/1350/7 "2024-10-31T06:34:21Z")

</div>

can you share us your code ?
