Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The signed-properties-hashing error appears only on simplified invoices #19

Open
Khalid-Sami opened this issue Feb 28, 2025 · 1 comment

Comments

@Khalid-Sami
Copy link

I'm trying to send a simplified invoice to compliance/invoices. I've successfully sent three standard invoices (invoice, credit, and debit), but when I send the simplified invoice, I receive the following response:

{ "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": "signed-properties-hashing", "category": "CERTIFICATE_ERRORS", "message": "Invalid signed properties hashing, SignedProperties with id='xadesSignedProperties'", "status": "ERROR" } ], "status": "ERROR" }, "reportingStatus": "NOT_REPORTED", "clearanceStatus": null, "qrSellertStatus": null, "qrBuyertStatus": null }

Here is the xml file

<?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: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: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>vBuxDu9jTQKaaBKWNjpjgusaoD+erUVe9l5+RZI9yQc=</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>YmNlMThiNmQ4MTRmNzBkYjVlN2NhN2NiOGQ0YTdhOWIwMzZkOTNkYWI3ZGVlNGVkNDJmNzQ3N2I5MWQ4YWE2Mg==</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>MEQCIHG6ZOlgDG4bH2plfJVm2jFFqfErvy6eE78g7Y+dyhiHAiBm9d410Xt3If0iUtWYKwIX5gES3qqb79m9F3e9FfFDWw==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICEDCCAbegAwIBAgIGAZVH6xIYMAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjUwMjI3MTQ1ODU3WhcNMzAwMjI2MjEwMDAwWjBZMR8wHQYDVQQDDBZTYWpsaGEtMzEyNDQzNjk3NDAwMDAzMQ8wDQYDVQQKDAZTYWpsaGExGDAWBgNVBAsMDzMxMjQ0MzY5NzQwMDAwMzELMAkGA1UEBhMCU0EwVjAQBgcqhkjOPQIBBgUrgQQACgNCAATJceGRpHA3AnJqWDo7GMeVpG9WdzpneXGO1Iy37Aelr+dbtwd86i5B4zPqYQMQ5QGS4Ga3FFjAGSMBprzRTjxMo4GxMIGuMAwGA1UdEwEB/wQCMAAwgZ0GA1UdEQSBlTCBkqSBjzCBjDE+MDwGA1UEBAw1MS1TYWpsaGF8Mi1WMnwzLTdkY2NlMGU2LTYzNjMtNDIzM2MtYWFhMy1mNjM4Y2E3YzQwNDIxHzAdBgoJkiaJk/IsZAEBDA8zMTI0NDM2OTc0MDAwMDMxDTALBgNVBAwMBDExMDAxDTALBgNVBBoMBEhhaWwxCzAJBgNVBA8MAklUMAoGCCqGSM49BAMCA0cAMEQCIDnBf6D1cLD4yMsygOxCaZjhDGnFWXvq/teluVBPl/62AiBtj5Ab5UYkPJV4ye0SHExO7vGxbqUV1aVKgxi6FyW5Vg==</ds:X509Certificate></ds:X509Data></ds:KeyInfo><ds:Object><xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature"><xades:SignedProperties Id="xadesSignedProperties"><xades:SignedSignatureProperties><xades:SigningTime>2025-02-28T23:34:10Z</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>MjRhMjUwZTNjNDc4YzlkMGUxYzNiM2FlZTcxMTcxNTYwNjg4YjE2MmZhM2Y3MTk5NWZjZDhjYzExYjgwMTkyNg==</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>CN=eInvoicing</ds:X509IssuerName><ds:X509SerialNumber>1740668342808</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>3cf5ee18-ee25-44ea-a444-2c37ba7f28be</cbc:UUID><cbc:IssueDate>2024-09-07</cbc:IssueDate><cbc:IssueTime>17:41:08Z</cbc:IssueTime><cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode><cbc:Note languageID="ar">ABC</cbc:Note><cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode><cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode><cac:AdditionalDocumentReference><cbc:ID>ICV</cbc:ID><cbc:UUID>10</cbc:UUID></cac:AdditionalDocumentReference><cac:AdditionalDocumentReference><cbc:ID>PIH</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain" filename="base64">NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference><cac:AdditionalDocumentReference><cbc:ID>QR</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">ARlNYXhpbXVtIFNwZWVkIFRlY2ggU3VwcGx5Ag8zMTI0NDM2OTc0MDAwMDMDFDIwMjQtMDktMDdUMTc6NDE6MDhaBAQ0LjYwBQMwLjYGLHZCdXhEdTlqVFFLYWFCS1dOanBqZ3VzYW9EK2VyVVZlOWw1K1JaSTl5UWM9B2BNRVFDSUhHNlpPbGdERzRiSDJwbGZKVm0yakZGcWZFcnZ5NmVFNzhnN1krZHloaUhBaUJtOWQ0MTBYdDNJZjBpVXRXWUt3SVg1Z0VTM3FxYjc5bTlGM2U5RmZGRFd3PT0IWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABMlx4ZGkcDcCcmpYOjsYx5Wkb1Z3Omd5cY7UjLfsB6Wv51u3B3zqLkHjM+phAxDlAZLgZrcUWMAZIwGmvNFOPEwJRjBEAiA5wX+g9XCw+MjLMoDsQmmY4QxpxVl76v7XpblQT5f+tgIgbY+QG+VGJDyVeMntEhxMTu7xsW6lFdWlSoMYuhcluVY=</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">1010010000</cbc:ID></cac:PartyIdentification><cac:PostalAddress><cbc:StreetName>Prince Sultan</cbc:StreetName><cbc:BuildingNumber>2322</cbc:BuildingNumber><cbc:CitySubdivisionName>Al-Murabba</cbc:CitySubdivisionName><cbc:CityName>Riyadh</cbc:CityName><cbc:PostalZone>23333</cbc:PostalZone><cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>312443697400003</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Maximum Speed Tech Supply</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PostalAddress><cbc:StreetName>Salah Al-Din</cbc:StreetName><cbc:BuildingNumber>1111</cbc:BuildingNumber><cbc:CitySubdivisionName>Al-Murooj</cbc:CitySubdivisionName><cbc:CityName>Riyadh</cbc:CityName><cbc:PostalZone>12222</cbc:PostalZone><cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>312444697400003</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fatoora Samples</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans><cac:AllowanceCharge><cbc:ChargeIndicator>false</cbc:ChargeIndicator><cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason><cbc:Amount currencyID="SAR">0.00</cbc:Amount><cac:TaxCategory><cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID><cbc:Percent>15</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.60</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:Percent>15</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:ChargeTotalAmount currencyID="SAR">0.00</cbc:ChargeTotalAmount><cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount><cbc:PayableAmount currencyID="SAR">4.60</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</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:Name>Product</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>15.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID="SAR">2.0000</cbc:PriceAmount><cac:AllowanceCharge><cbc:ChargeIndicator>true</cbc:ChargeIndicator><cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason><cbc:Amount currencyID="SAR">0.00</cbc:Amount></cac:AllowanceCharge></cac:Price></cac:InvoiceLine></Invoice>

@Khalid-Sami
Copy link
Author

@Saleh7 any updates ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant