Issue coming in Simulation but working in development-portal

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,

“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”
}
],

<?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>Ekz92Q7wtcufZUhPn6FisNHBIGfsCZ4ebPppFCFl5XA=</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>MmFkNTRhOTQyMmY5ZDI2MDMyYzc1OGJkZmYwMzFjYzhiM2E5NjJiZTNkOGQ4NWUxMzIyYmQzNmVmODdmYzU5OA==</ds:DigestValue>
                                </ds:Reference>
                            </ds:SignedInfo>
                            <ds:SignatureValue>MEUCID0denr2r+BfgN5xHa3q7izh5+XLQsGFaGglbktQwdNZAiEA+cBXLqdeE73Pf+d3ucqZrAjpjGpnsX4q4/87U5C7ZjU=</ds:SignatureValue>
                            <ds:KeyInfo>
                                <ds:X509Data>
                                    <ds:X509Certificate>MIICYDCCAgagAwIBAgIGAY4X0wugMAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjQwMzA3MDczMTI1WhcNMjkwMzA2MjEwMDAwWjBoMRcwFQYDVQQDDA5FR1MxLTg4NjQzMTE0NTETMBEGA1UECwwKMTIzNDU2Nzg5MDErMCkGA1UECgwiZ2xhdWJldGVjaCBjb21wYW55IHByaXZhdGUgbGltaXRlZDELMAkGA1UEBhMCU0EwVjAQBgcqhkjOPQIBBgUrgQQACgNCAATKYRETfwyk2lMc28bHYtnlf106pzse5oc/Ln7nlfUJrDhGvmBqeEnJnToLNPlojlS1EIqc0o2ub+FckEi76IYco4HxMIHuMAwGA1UdEwEB/wQCMAAwgd0GA1UdEQSB1TCB0qSBzzCBzDFBMD8GA1UEBAw4MS1CUklER0VMQ1N8Mi1JT1N8My05YjgxNGU2Zi1jYTA0LTQ2NWEtODM2Ny1lZmJjYWJkNjU5NzgxHzAdBgoJkiaJk/IsZAEBDA8zMTA5MDYzOTA4MDAwMDMxDTALBgNVBAwMBDAxMDAxSDBGBgNVBBoMPzAwMDAgRmFsYXN0aW4sIE1pc2hyaWZhaCwgSmVkZGFoIDIzMzMxLCBTYXVkaSBBcmFiaWEsMTIsIEplZGRhaDENMAsGA1UEDwwERm9vZDAKBggqhkjOPQQDAgNIADBFAiEAsAgDMinr13928oK11fXuzVJ5IYfhEglncnRxIU58wBkCIGOVn3y7dbsKEvyWDc/JTVhe5IHrupUe1kHsLnEaGw0a</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-07T07:31:31Z</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#">ZWYxZDNkZjRhYTA1ODQ0N2ViZTU5ODJkMGViMDk4NjBmNzQ3ZjZlY2U1NzMwMTIyN2I1YjQxOTI0NDRiYjdmNQ==</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#">1709796690848</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>9b814e6f-ca04-465a-8367-efbcabd65978</cbc:UUID>
    <cbc:IssueDate>2024-03-07</cbc:IssueDate>
    <cbc:IssueTime>07:31:31</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>PIH</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">qZ4nI3/XvuxAdpghvbXWbJVbGRDtoPTXdUNwphGZmuo=</cbc:EmbeddedDocumentBinaryObject>
        </cac:Attachment>
    </cac:AdditionalDocumentReference>
    <cac:AdditionalDocumentReference>
        <cbc:ID>QR</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">ASJnbGF1YmV0ZWNoIGNvbXBhbnkgcHJpdmF0ZSBsaW1pdGVkAg8zMTA5MDYzOTA4MDAwMDMDFDIwMjQtMDMtMDdUMDc6MzE6MzFaBAc0NjU4LjM0BQU5MS4zNAYsRWt6OTJRN3d0Y3VmWlVoUG42RmlzTkhCSUdmc0NaNGViUHBwRkNGbDVYQT0HYE1FVUNJRDBkZW5yMnIrQmZnTjV4SGEzcTdpemg1K1hMUXNHRmFHZ2xia3RRd2ROWkFpRUErY0JYTHFkZUU3M1BmK2QzdWNxWnJBanBqR3Buc1g0cTQvODdVNUM3WmpVPQhYMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEymERE38MpNpTHNvGx2LZ5X9dOqc7HuaHPy5+55X1Caw4Rr5ganhJyZ06CzT5aI5UtRCKnNKNrm/hXJBIu+iGHAlHMEUCIQCwCAMyKevXf3bygrXV9e7NUnkhh+ESCWdydHEhTnzAGQIgY5WffLt1uwoS/JYNz8lNWF7kgeu6lR7WQewucRobDRo=</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>Falastin, Mishrifah, Jeddah 23331, Saudi Arabia,12</cbc:StreetName>
                <cbc:BuildingNumber>0000</cbc:BuildingNumber>
                <cbc:PlotIdentification>0000</cbc:PlotIdentification>
                <cbc:CitySubdivisionName>Jeddah</cbc:CitySubdivisionName>
                <cbc:CityName>Jeddah</cbc:CityName>
                <cbc:PostalZone>31952</cbc:PostalZone>
                <cac:Country>
                    <cbc:IdentificationCode>SA</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
                <cbc:CompanyID>310000000800003</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName>glaubetech company private limited</cbc:RegistrationName>
            </cac:PartyLegalEntity>
        </cac:Party>
    </cac:AccountingSupplierParty>
    <cac:AccountingCustomerParty/>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">91.34</cbc:TaxAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="SAR">4567.00</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="SAR">91.34</cbc:TaxAmount>
            <cac:TaxCategory>
                <cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
                <cbc:Percent>2.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">91.34</cbc:TaxAmount>
    </cac:TaxTotal>
    <cac:LegalMonetaryTotal>
        <cbc:LineExtensionAmount currencyID="SAR">4567.00</cbc:LineExtensionAmount>
        <cbc:TaxExclusiveAmount currencyID="SAR">4567.00</cbc:TaxExclusiveAmount>
        <cbc:TaxInclusiveAmount currencyID="SAR">4658.34</cbc:TaxInclusiveAmount>
        <cbc:AllowanceTotalAmount currencyID="SAR">0</cbc:AllowanceTotalAmount>
        <cbc:PrepaidAmount currencyID="SAR">0</cbc:PrepaidAmount>
        <cbc:PayableAmount currencyID="SAR">4658.34</cbc:PayableAmount>
    </cac:LegalMonetaryTotal>
    <cac:InvoiceLine>
        <cbc:ID>1531</cbc:ID>
        <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="SAR">4567.00</cbc:LineExtensionAmount>
        <cac:TaxTotal>
            <cbc:TaxAmount currencyID="SAR">91.34</cbc:TaxAmount>
            <cbc:RoundingAmount currencyID="SAR">4658.34</cbc:RoundingAmount>
        </cac:TaxTotal>
        <cac:Item>
            <cbc:Name>A Sub Test</cbc:Name>
            <cac:ClassifiedTaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>2.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:ClassifiedTaxCategory>
        </cac:Item>
        <cac:Price>
            <cbc:PriceAmount currencyID="SAR">4567</cbc:PriceAmount>
        </cac:Price>
    </cac:InvoiceLine>
</Invoice>

Please Help me to fix this issue

The replay was provided here:

Hey @lalomar did you find a solution for this, I am facing same problem.
Sandbox enviorment works for me but not production.

Your help will be appreciated, thanks.

we fixed it. what about you?

Dear @salman
Can you advise to proceed ?

@salman Did you got the solution ?

What SDK version do you use ?

Dear @hadarasoft

Kindly note there is a new version of the SDK it’s 3.3.5

Could you please provide me with the link to the version 3.3.5

Hi @hadarasoft

You can download the latest version of the SDK, through ZATCA website. go to e-invoicing click on systems developers then click on e-invoicing developer portal, you will find the SDK access to download and familiar yourself with the SDK.

Thank you.