i get error {“validationResults”:{“infoMessages”:,“warningMessages”:[{“type”:“WARNING”,“code”:“BR-KSA-29”,“category”:“KSA”,“message”:“If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact “urn:oasis:names:specification:ubl:signature:Invoice” value for referenced signature ID and signature ID.”,“status”:“WARNING”}],“errorMessages”:[{“type”:“ERROR”,“code”:“XSD_ZATCA_INVALID”,“category”:“XSD validation”,“message”:“Schema validation failed; XML does not comply with UBL 2.1 standards in line with ZATCA specifications. ERROR: org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 142; cvc-datatype-valid.1.2.1: ‘urn:oasis:names:specification:ubl:signature:Invoice’ is not a valid value for ‘NCName’.”,“status”:“ERROR”},{“type”:“ERROR”,“code”:“BR-KSA-28”,“category”:“KSA”,“message”:“If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact “urn:oasis:names:specification:ubl:signature:1” value for signature information ID.”,“status”:“ERROR”},{“type”:“ERROR”,“code”:“invalid-certificate”,“category”:“CERTIFICATE_ERRORS”,“message”:“Production CSID format is not valid”,“status”:“ERROR”}],“status”:“ERROR”},“reportingStatus”:“NOT_REPORTED”,“clearanceStatus”:null,“qrSellertStatus”:null,“qrBuyertStatus”:null}
.In standard invoice case passed.If there is any difference b/w signing of standard invoice and simplified 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
sac:SignatureInformation
cbc:IDurn:oasis:names:specification:ubl:signature:1</cbc:ID>
sbc:ReferencedSignatureIDurn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>
<ds:Signature Id=“signature”>
ds:SignedInfo
<ds:CanonicalizationMethod Algorithm=“Canonical XML 1.1”/>
<ds:SignatureMethod Algorithm=“xmldsig-more namespace”/>
<ds:Reference Id=“invoiceSignedData” URI=“”>
ds:Transforms
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::cac:Signature)</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“XML Path Language (XPath)”>
ds:XPathnot(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID=‘QR’])</ds:XPath>
</ds:Transform>
<ds:Transform Algorithm=“Canonical XML 1.1”/>
</ds:Transforms>
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValueYQCE2OE5We30epCFrYYGECtRxzxnfKLmr/wniccpk2A=</ds:DigestValue>
</ds:Reference>
<ds:Reference Type=“XML-Signature Syntax and Processing” URI=“#xadesSignedProperties”>
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValueYmM5ZmUzNWRkN2MzM2Q4NzJiODdlOWU5ZDcxZTc3MzMwYjYwOTNjNjE4MWViZTU2OWYzY2ZlMmNiZTczYzQ0NQ==</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
ds:SignatureValueMEQCIE9PFxGZhUz/pcHG8pU5zq/oESuvIzcW4OH5rz9ZoGiDAiB+lTskoN4JTPcTsALC8HaHLEkrOk4XTsOUKT0n4pcQYg==</ds:SignatureValue>
ds:KeyInfo
ds:X509Data
ds:X509CertificateMIICPzCCAeagAwIBAgIGAZI5UhYEMAoGCCqGSM49BAMCMBUxEzARBgNVBAMMCmVJbnZvaWNpbmcwHhcNMjQwOTI4MTU0ODQ4WhcNMjkwOTI3MjEwMDAwWjB/MQswCQYDVQQGEwJTQTEVMBMGA1UECwwMUml5YWQgQnJhbmNoMTEwLwYDVQQKDChBbCBIYWJhc2ggVHJhdmVsIGFuZCBVbXJhaCBTZXJ2aWNlcyBMdGQuMSYwJAYDVQQDDB1UU1QtODE2ODM1Mzk3LTMwMTMyOTk3NzQwMDAwMzBWMBAGByqGSM49AgEGBSuBBAAKA0IABJtgICAvqV3M2IytfHm+OE3Odl9YcRqiYr+vzpLKlSzjEi5sirtof5dOoqqo3owj4Njf7T74dPvD8BqxZ2KikM+jgbowgbcwDAYDVR0TAQH/BAIwADCBpgYDVR0RBIGeMIGbpIGYMIGVMS0wKwYDVQQEDCQxLVRyYXZlYXwyLVdlYnwzLTMzMDc4MDM3ODIzMjc4NjU5OTYxHzAdBgoJkiaJk/IsZAEBDA8zMDEzMjk5Nzc0MDAwMDMxDTALBgNVBAwMBDExMDAxIjAgBgNVBBoMGUhhc3NhbiBCaW4gVGhhYml0IFN0cmVldC4xEDAOBgNVBA8MB1RyYXZlbHMwCgYIKoZIzj0EAwIDRwAwRAIgDyxabh+nKFxYVlqBwE/Bm1p6lspQbv/OrRJShO+T5usCIH3wcgyUjfphb4PanCRNBuwgTJm6QZmk8JXGJiK7zIzC</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
ds:Object
<xades:QualifyingProperties Target=“signature”>
<xades:SignedProperties Id=“xadesSignedProperties”>
xades:SignedSignatureProperties
xades:SigningTime2024-10-01T04:13:16</xades:SigningTime>
xades:SigningCertificate
xades:Cert
xades:CertDigest
<ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing”/>
ds:DigestValueN2Q5MTdiZjBlOWRkYTM0ZDRkZDYwMmE2N2NmYWVkMjQ2NDYyYjQyMWFkODM4YzU3YmJjMDA2ODc5OGJlMzEwYQ==</ds:DigestValue>
</xades:CertDigest>
xades:IssuerSerial
ds:X509IssuerNameCN=eInvoicing</ds:X509IssuerName>
ds:X509SerialNumber1727538533892</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:ProfileIDreporting:1.0</cbc:ProfileID>
cbc:IDINV-00000006</cbc:ID>
cbc:UUID87263c7a-7e40-11ef-af2e-95e0b55908c4</cbc:UUID>
cbc:IssueDate2024-09-29</cbc:IssueDate>
cbc:IssueTime14:25:08</cbc:IssueTime>
<cbc:InvoiceTypeCode name=“0200000”>388</cbc:InvoiceTypeCode>
cbc:DocumentCurrencyCodeSAR</cbc:DocumentCurrencyCode>
cbc:TaxCurrencyCodeSAR</cbc:TaxCurrencyCode>
cac:AdditionalDocumentReference
cbc:IDICV</cbc:ID>
cbc:UUID156</cbc:UUID>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDPIH</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>ABHlK3Uk+CJ0M5qYjrlfiRqSn0jxAtPKVcXq2hT6fEc=</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
cac:AdditionalDocumentReference
cbc:IDQR</cbc:ID>
cac:Attachment
<cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>AQNyZWcCDzMwMTMyOTk3NzQwMDAwMwMTMjAyNC0wOS0yOVQxNDoyNTowOAQGMTcwMC4wBQQwLjA0BixZUUNFMk9FNVdlMzBlcENGcllZR0VDdFJ4enhuZktMbXIvd25pY2NwazJBPQdgTUVRQ0lFOVBGeEdaaFV6L3BjSEc4cFU1enEvb0VTdXZJemNXNE9INXJ6OVpvR2lEQWlCK2xUc2tvTjRKVFBjVHNBTEM4SGFITEVrck9rNFhUc09VS1QwbjRwY1FZZz09CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAASbYCAgL6ldzNiMrXx5vjhNznZfWHEaomK/r86SypUs4xIubIq7aH+XTqKqqN6MI+DY3+0++HT7w/AasWdiopDPCUYwRAIgDyxabh+nKFxYVlqBwE/Bm1p6lspQbv/OrRJShO+T5usCIH3wcgyUjfphb4PanCRNBuwgTJm6QZmk8JXGJiK7zIzC</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”>4030165752</cbc:ID>
</cac:PartyIdentification>
cac:PostalAddress
cbc:StreetNameKing Abdulaziz Branch Rd.</cbc:StreetName>
cbc:BuildingNumber6507</cbc:BuildingNumber>
cbc:PlotIdentification3597</cbc:PlotIdentification>
cbc:CitySubdivisionNameAl Muhammadiyah Dist.</cbc:CitySubdivisionName>
cbc:CityNameJeddah</cbc:CityName>
cbc:PostalZone23617</cbc:PostalZone>
cbc:CountrySubentityMakkah</cbc:CountrySubentity>
cac:Country
<cbc:IdentificationCode listID=“ISO3166-1”>SA</cbc:IdentificationCode>
cbc:NameSaudi Arabia</cbc:Name>
</cac:Country>
</cac:PostalAddress>
cac:PartyTaxScheme
cbc:CompanyID301329977400003</cbc:CompanyID>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
cac:PartyLegalEntity
cbc:RegistrationNamereg</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingSupplierParty>
cac:AccountingCustomerParty
cac:Party
cac:PostalAddress/
cac:PartyLegalEntity
cbc:RegistrationNameCash Sales Sys Controll Account</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
cac:Delivery
cbc:ActualDeliveryDate2024-09-29</cbc:ActualDeliveryDate>
</cac:Delivery>
cac:PaymentMeans
<cbc:PaymentMeansCode listID=“UNTDID 4461 Subset”>1</cbc:PaymentMeansCode>
</cac:PaymentMeans>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>0.04</cbc:TaxAmount>
cac:TaxSubtotal
<cbc:TaxableAmount currencyID=“SAR”>0.26</cbc:TaxableAmount>
<cbc:TaxAmount currencyID=“SAR”>0.04</cbc:TaxAmount>
cac:TaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.0</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
cac:TaxSubtotal
<cbc:TaxableAmount currencyID=“SAR”>1699.7</cbc:TaxableAmount>
<cbc:TaxAmount currencyID=“SAR”>0.0</cbc:TaxAmount>
cac:TaxCategory
cbc:IDZ</cbc:ID>
cbc:Percent0.0</cbc:Percent>
cbc:TaxExemptionReasonCodeVATEX-SA-34-2</cbc:TaxExemptionReasonCode>
cbc:TaxExemptionReasonInternational transport of passengers</cbc:TaxExemptionReason>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>0.04</cbc:TaxAmount>
</cac:TaxTotal>
cac:LegalMonetaryTotal
<cbc:LineExtensionAmount currencyID=“SAR”>1699.96</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID=“SAR”>1699.96</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID=“SAR”>1700.0</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID=“SAR”>0.0</cbc:AllowanceTotalAmount>
<cbc:PrepaidAmount currencyID=“SAR”>0.0</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID=“SAR”>1700.0</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
cac:InvoiceLine
cbc:ID1</cbc:ID>
cbc:InvoicedQuantity1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>0.26</cbc:LineExtensionAmount>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
cbc:MultiplierFactorNumeric0.0</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID=“SAR”>0.0</cbc:Amount>
<cbc:BaseAmount currencyID=“SAR”>0.26</cbc:BaseAmount>
</cac:AllowanceCharge>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>0.04</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>0.3</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:NameService Fee</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.0</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>0.26</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
cac:InvoiceLine
cbc:ID2</cbc:ID>
cbc:InvoicedQuantity1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>1699.7</cbc:LineExtensionAmount>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
cbc:MultiplierFactorNumeric0.0</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID=“SAR”>0.0</cbc:Amount>
<cbc:BaseAmount currencyID=“SAR”>1699.7</cbc:BaseAmount>
</cac:AllowanceCharge>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>0.0</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>1699.7</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:NameFAIZAH/TALHA MR/ULH/JED</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDZ</cbc:ID>
cbc:Percent0.0</cbc:Percent>
cbc:TaxExemptionReasonCodeVATEX-SA-34-2</cbc:TaxExemptionReasonCode>
cbc:TaxExemptionReasonInternational transport of passengers</cbc:TaxExemptionReason>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>1699.7</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
This is my Xml.
I also have the same issue, where I got this response
{
“InvoiceHash”: null,
“Status”: null,
“Warnings”: null,
“Errors”: null,
“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”: [
{
“Type”: “WARNING”,
“Code”: “BR-KSA-98”,
“Category”: “KSA”,
“Message”: “\u064A\u0646\u0628\u063A\u064A \u062A\u0642\u062F\u064A\u0645 \u0627\u0644\u0641\u0627\u062A\u0648\u0631\u0629 \u0627\u0644\u0645\u0628\u0633\u0637\u0629 \u062E\u0644\u0627\u0644 24 \u0633\u0627\u0639\u0629 \u0645\u0646 \u0625\u0635\u062F\u0627\u0631 \u0627\u0644\u0641\u0627\u062A\u0648\u0631\u0629.”,
“Status”: “WARNING”
}
],
“ErrorMessages”: [
{
“Type”: “ERROR”,
“Code”: “QRCODE_INVALID”,
“Category”: “QRCODE_VALIDATION”,
“Message”: “Failed to validate QR code”,
“Status”: “ERROR”
},
{
“Type”: “ERROR”,
“Code”: “invalid-certificate”,
“Category”: “CERTIFICATE_ERRORS”,
“Message”: “Production CSID format is not valid”,
“Status”: “ERROR”
}
],
“Status”: “ERROR”
},
“ReportingStatus”: “NOT_REPORTED”,
“ClearanceStatus”: null,
“HttpStatusCode”: 400,
“IsSuccess”: false,
“Code”: null,
“Message”: null
}
did you discover the root cause of this error
Dear @Ahmad_Al_Arabi,
Can you please open a ticket through calling 19993 or raise it to our SP_Support@zatca.gov.sa
Also, please provide the full API request which includes the endpoint, the API bode and response.
Regards,
Dear Anas
I sent to this email address SP_Support@zatca.gov.sa my issue by the required details, but I don’t get any response from them, not even a ticket number,
So kindly can you please help me
Have u find any solution ?
@Ankit_Tiwari , @idaoud , @Aturkistani
I have a few clarifications regarding the use of “Organization Unit Name (OU)” and Other Seller ID (CRN) in the context of onboarding clients and submitting invoices to ZATCA. Kindly help me confirm the correct approach in the following scenarios:
1. For a Tax Group client using the same invoicing software across all branches under the same TIN (with active CRNs):
- In this case, should we use the TIN number as the Organization Unit Name (OU) in the onboarding configuration?
- And include the respective branch CRN (of the issuing branch) in the invoice XML under “Other Seller ID”?
2. For a Tax Group client with multiple CRNs, but they are using this invoicing software only in one branch:
- Should the Organization Unit Name (OU) in this case be the TIN number or the name of the branch using the software?
- And in the invoice XML, we are including the CRN of the branch that is issuing the invoice – is that correct?
3. For a client that is not a Tax Group and does not have a TIN, only a single CRN (standalone branch):
- In this case, should we use the Branch Name as the Organization Unit Name (OU) in the config file?
- And continue using the same branch CRN in the invoice XML?
4. For a previously onboarded Tax Group client who is using the software in only one branch (but the OU was set as the TIN):
They received a notification from ZATCA stating:
“It has been noted that your invoices do not comply with the requirements of the second phase of electronic invoicing – linking and integration, which includes:
Commercial Records: When choosing the commercial record identifier and there are multiple commercial records, the supplier must enter the commercial record of the branch from which the tax invoice is issued. Therefore, all branches through which invoices are issued must be registered, and the correct entry of the identifier field for the commercial record must be verified, which is considered a violation of the provisions of the electronic invoicing regulations…”
In this case:
- Do we need to revoke the existing Device and re-onboard it using the Branch Name as the OU?
- Or can we continue using the current setup with OU as TIN without any technical or compliance issues, as they are issuing invoices only from one branch?
Please confirm if the above understanding is correct for these three onboarding scenarios, or let us know the appropriate guidelines as per ZATCA requirements.