I would like to raise a query regarding the errors encountered while generating the XML using the 9-digit Invoice Type Code format.
Scenario: Simplified tax Einvoicing for nominal supply for cash sales.
Invoice Type in XML sent as <cbc:InvoiceTypeCode name=“020100000”>388</cbc:InvoiceTypeCode>and customer details in XML are cac:AccountingCustomerParty<cac:Party /></cac:AccountingCustomerParty>
When entering ‘0’ in the 8th digit for Continuous Supply and 9th digit for B2G Supplies, in these positions results in XML generation errors. However, when these digits are left blank, the XML validates successfully. The specific errors are provided below. Kindly look into this issue and provide a solution at the earliest.
BR-KSA-42-KSA-The buyer name (BT-44) must be present in the tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 ,
BR-KSA-81-KSA-The other Buyer ID (BT-46) must present in the tax invoice and associated debit notes and credit notes (KSA-2, position 1 and 2 = 01), where the buyer VAT registration number or buyer group VAT registration number (BT-48) is not provided.,
BR-KSA-F-06-C23-KSA-[BR-KSA-F-06-C23] - Field character limits for the Buyer Address - Street field (BT-50) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.,
BR-KSA-F-06-C25-KSA-[BR-KSA-F-06-C25] - Field character limits for the Buyer Address - City field (BT-52) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.,
BR-KSA-10-KSA-BR-KSA-10 - Where the Buyer Country Code (BT-55) is other than ‘’‘‘SA’’‘’ Buyer address must contain a street (BT-50), city (BT-52), country code (BT-55). This rule does not apply on the simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02). 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 Id=“signature” xmlns:ds=“XML-Signature Syntax and Processing> ds:SignedInfo <ds:CanonicalizationMethod Algorithm=“http://www.w3.org/2006/12/xml-c14n11” /> <ds:SignatureMethod Algorithm=“xmldsig-more namespace /> <ds:Reference Id=“invoiceSignedData” URI=“”> ds:Transforms <ds:Transform Algorithm=“http://www.w3.org/TR/1999/REC-xpath-19991116”> ds:XPathnot(//ancestor-or-self::ext:UBLExtensions)</ds:XPath> </ds:Transform> <ds:Transform Algorithm=“http://www.w3.org/TR/1999/REC-xpath-19991116”> ds:XPathnot(//ancestor-or-self::cac:Signature)</ds:XPath> </ds:Transform> <ds:Transform Algorithm=“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=“http://www.w3.org/2006/12/xml-c14n11” /> </ds:Transforms> <ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing /> ds:DigestValuebJJAANzeMatjVZX4aUkVWAJwwrYiZ+hL9yTvm0Uc7t8=</ds:DigestValue> </ds:Reference> <ds:Reference Type=“XML-Signature Syntax and Processing URI=“#xadesSignedProperties”> <ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing /> ds:DigestValueOTYwZTZiNzI3NDU5OWM1ZmYyZDM5OTg4ODNhMWQwMzZhZDBjYzU2YjIzNTcyZDczMjExODQzZjAyYWFjYzVhZg==</ds:DigestValue> </ds:Reference> </ds:SignedInfo> ds:SignatureValueMEUCIBARLvc42pD9AJpCn1SkP1EFvPyDDBCaEKZnjTD2z4zyAiEA0YbKxdROGcnSwO769WHGsVzxvlZJcwlaISTsdYI2+i0=</ds:SignatureValue> ds:KeyInfo ds:X509Data ds:X509CertificateMIIFAjCCBKmgAwIBAgITEwAANX3pNwyJ1RS2QwABAAA1fTAKBggqhkjOPQQD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0aW9uUG9pbnQwgc4GCCsGAQUFBwEBBIHBMIG+MIG7BggrBgEFBQcwAoaBrmxkYXA6Ly8vQ049UEVaRUlOVk9JQ0VTQ0EyLUNBLENOPUFJQSxDTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNlcyxDTj1Db25maWd1cmF0aW9uLERDPWV4dHphdGNhLERDPWdvdixEQz1sb2NhbD9jQUNlcnRpZmljYXRlP2Jhc2U/b2JqZWN0Q2xhc3M9Y2VydGlmaWNhdGlvbkF1dGhvcml0eTAOBgNVHQ8BAf8EBAMCB4AwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIgYaoHYTQ+xKG7Z0kh877GdPAVWaBnNgtg+XFXQIBZAIBEDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwMwJwYJKwYBBAGCNxUKBBowGDAKBggrBgEFBQcDAjAKBggrBgEFBQcDAzAKBggqhkjOPQQDAgNHADBEAiAXovHLOkfnxhuMIQH6nhxMXf6aCmt+AR3YC1n4q/fxZAIgI/iW11cxDt/Du1TcN5vepITHDMFE5JhafFHlXWdxkjk=</ds:X509Certificate> </ds:X509Data> </ds:KeyInfo> ds:Object <xades:QualifyingProperties Target=“signature” xmlns:xades=“Assigned ETSI XML URIs> <xades:SignedProperties Id=“xadesSignedProperties”> xades:SignedSignatureProperties xades:SigningTime2025-11-25T10:53:35Z</xades:SigningTime> xades:SigningCertificate xades:Cert xades:CertDigest <ds:DigestMethod Algorithm=“XML Encryption Syntax and Processing /> ds:DigestValueNWJkZDJkNWFkOTM4MThmNzkwNzZlN2IxNzllMmE1M2YzMTUzZDdlNzViMWM1ZDJmNWNjYWJiNDVjOGZiNTIyOQ==</ds:DigestValue> </xades:CertDigest> xades:IssuerSerial ds:X509IssuerNameCN=PEZEINVOICESCA2-CA, DC=extgazt, DC=gov, DC=local</ds:X509IssuerName> ds:X509SerialNumber423714229874932886473611689668171131982460285</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:ID624</cbc:ID> cbc:UUID81df892a-c696-4850-a925-26cac265dcd2</cbc:UUID> cbc:IssueDate2025-11-25</cbc:IssueDate> cbc:IssueTime10:53:34Z</cbc:IssueTime> <cbc:InvoiceTypeCode name=“020100000”>388</cbc:InvoiceTypeCode> cbc:DocumentCurrencyCodeSAR</cbc:DocumentCurrencyCode> cbc:TaxCurrencyCodeSAR</cbc:TaxCurrencyCode> cac:AdditionalDocumentReference cbc:IDICV</cbc:ID> cbc:UUID693</cbc:UUID> </cac:AdditionalDocumentReference> cac:AdditionalDocumentReference cbc:IDPIH</cbc:ID> cac:Attachment <cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>vMkPanSvcHRwS0A78Ht96sqajAqhmAuul8+Cq7LPclI=</cbc:EmbeddedDocumentBinaryObject> </cac:Attachment> </cac:AdditionalDocumentReference> cac:AdditionalDocumentReference cbc:IDQR</cbc:ID> cac:Attachment <cbc:EmbeddedDocumentBinaryObject mimeCode=“text/plain”>AQZEQU1NQU0CDzMwMDQ2Mjk1ODIwMDAwMwMUMjAyNS0xMS0yNVQxMDo1MzozNFoEBzIwNzAuMDAFBjI3MC4wMAYsYkpKQUFOemVNYXRqVlpYNGFVa1ZXQUp3d3JZaVoraEw5eVR2bTBVYzd0OD0HYE1FVUNJQkFSTHZjNDJwRDlBSnBDbjFTa1AxRUZ2UHlEREJDYUVLWm5qVEQyejR6eUFpRUEwWWJLeGRST0djblN3Tzc2OVdIR3NWenh2bFpKY3dsYUlTVHNkWUkyK2kwPQhYMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErcSZOl8Pu+JsaIGYtgH/9mhiYDzonRJ78t0qjHj4VMmEDd/dozoMvLe1XirO+4+ViM47iAWGUJKhnj8KM6JxOQlGMEQCIBei8cs6R+fGG4whAfqeHExd/poKa34BHdgLWfir9/FkAiAj+JbXVzEO38O7VNw3m96khMcMwUTkmFp8UeVdZ3GSOQ==</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”>2211445599</cbc:ID> </cac:PartyIdentification> cac:PostalAddress cbc:StreetNameDAMMAM1</cbc:StreetName> cbc:AdditionalStreetNameDAMMMAM2</cbc:AdditionalStreetName> cbc:BuildingNumber1322</cbc:BuildingNumber> cbc:CitySubdivisionNameDD300 AA</cbc:CitySubdivisionName> cbc:CityNameDDAMM</cbc:CityName> cbc:PostalZone23423</cbc:PostalZone> cbc:CountrySubentityKKSAA</cbc:CountrySubentity> cac:Country cbc:IdentificationCodeSA</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> cac:PartyTaxScheme cbc:CompanyID300462958200003</cbc:CompanyID> cac:TaxScheme cbc:IDVAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> cac:PartyLegalEntity cbc:RegistrationNameDAMMAM</cbc:RegistrationName> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingSupplierParty> cac:AccountingCustomerParty <cac:Party /> </cac:AccountingCustomerParty> cac:Delivery cbc:ActualDeliveryDate2024-02-08</cbc:ActualDeliveryDate> cbc:LatestDeliveryDate2024-02-08</cbc:LatestDeliveryDate> </cac:Delivery> cac:PaymentMeans cbc:PaymentMeansCode1</cbc:PaymentMeansCode> </cac:PaymentMeans> cac:PaymentMeans cbc:PaymentMeansCode3</cbc:PaymentMeansCode> </cac:PaymentMeans> cac:TaxTotal <cbc:TaxAmount currencyID=“SAR”>270.00</cbc:TaxAmount> cac:TaxSubtotal <cbc:TaxableAmount currencyID=“SAR”>1800.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID=“SAR”>270.00</cbc:TaxAmount> cac:TaxCategory cbc:IDS</cbc:ID> cbc:Percent15.00</cbc:Percent> cac:TaxScheme cbc:IDVAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> cac:TaxTotal <cbc:TaxAmount currencyID=“SAR”>270.00</cbc:TaxAmount> </cac:TaxTotal> cac:LegalMonetaryTotal <cbc:LineExtensionAmount currencyID=“SAR”>1800.00</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID=“SAR”>1800.00</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID=“SAR”>2070.00</cbc:TaxInclusiveAmount> <cbc:AllowanceTotalAmount currencyID=“SAR”>0.00</cbc:AllowanceTotalAmount> <cbc:ChargeTotalAmount currencyID=“SAR”>0.00</cbc:ChargeTotalAmount> <cbc:PayableRoundingAmount currencyID=“SAR”>0</cbc:PayableRoundingAmount> <cbc:PayableAmount currencyID=“SAR”>2070.00</cbc:PayableAmount> </cac:LegalMonetaryTotal> cac:InvoiceLine cbc:ID1</cbc:ID> <cbc:InvoicedQuantity unitCode=“NOS”>1.00000</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID=“SAR”>1800.00</cbc:LineExtensionAmount> cac:AllowanceCharge cbc:ChargeIndicatorfalse</cbc:ChargeIndicator> cbc:AllowanceChargeReasonCode20</cbc:AllowanceChargeReasonCode> cbc:AllowanceChargeReasonTransfer commission</cbc:AllowanceChargeReason> cbc:MultiplierFactorNumeric10.00</cbc:MultiplierFactorNumeric> <cbc:Amount currencyID=“SAR”>100.00</cbc:Amount> <cbc:BaseAmount currencyID=“SAR”>1000.00</cbc:BaseAmount> </cac:AllowanceCharge> cac:AllowanceCharge cbc:ChargeIndicatortrue</cbc:ChargeIndicator> cbc:AllowanceChargeReasonCodeABT</cbc:AllowanceChargeReasonCode> cbc:AllowanceChargeReasonHessian wrapped</cbc:AllowanceChargeReason> <cbc:Amount currencyID=“SAR”>900.00</cbc:Amount> </cac:AllowanceCharge> cac:TaxTotal <cbc:TaxAmount currencyID=“SAR”>270.00</cbc:TaxAmount> <cbc:RoundingAmount currencyID=“SAR”>2070.00</cbc:RoundingAmount> </cac:TaxTotal> cac:Item cbc:NameItem T</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”>1000.00000</cbc:PriceAmount> </cac:Price> </cac:InvoiceLine>