Validate a ZATCA XML file for free · ZATCA error codes
ZATCA BR-KSA-39: seller VAT registration number (BT-31)
BR-KSA-39 · Error
[BR-KSA-39]-The invoice must contain the seller VAT registration number or seller group VAT registration number (BT-31).
The official rule requires the invoice to contain the seller VAT registration number or seller group VAT registration number (BT-31).
Official test (UBL XPath), context invoice: cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID is not empty, and a sibling cac:TaxScheme/cbc:ID is VAT.
Common causes
- The seller party has no
PartyTaxSchemeblock, orCompanyIDis empty. - A tax scheme is present but its
cbc:IDis notVAT. - The number was put in another identifier (for example BT-29) instead of BT-31.
If BT-31 is present, BR-KSA-40 also checks that it has 15 digits beginning and ending with 3. The value below is a format example, not a real VAT number. Valifakt is not a ZATCA-onboarded EGS. This page is not tax advice.
<cac:AccountingSupplierParty>
<cac:Party>
<cac:PartyTaxScheme>
<cbc:CompanyID>399999999900003</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
</cac:Party>
</cac:AccountingSupplierParty>Where is BT-31 in UBL?
Under the seller’s PartyTaxScheme as CompanyID, with TaxScheme ID VAT.
Does this rule check the 15-digit format?
No. The official BR-KSA-39 text requires the number to be present. Format (15 digits, first and last 3) is BR-KSA-40.
Is the example a real VAT number?
No. It only shows the 15-digit shape that BR-KSA-40 describes.
Related ZATCA rules
- BR-KSA-03 – Invoice UUID (KSA-1) missing or invalid
- BR-KSA-08 – Seller identification (BT-29) missing or wrong scheme
- BR-KSA-26 – Previous invoice hash (PIH, KSA-13) is not base64 SHA-256
- BR-KSA-27 – QR code (KSA-14) missing or not base64Binary
- BR-KSA-40 – Seller VAT number (BT-31) is not 15 digits starting and ending with 3
- BR-KSA-04 – Invoice issue date (BT-2) is in the future or invalid
- BR-KSA-06 – Invoice transaction code (KSA-2) missing or invalid
- BR-KSA-17 – Credit or debit note missing the reason (KSA-10)
Validate a ZATCA XML file for free Pricing
Not tax advice. Valifakt is not a ZATCA-onboarded e-invoicing solution (EGS). Official rule text is quoted from the ZATCA SDK validation-rules XSL.