BR-KSA-40: Seller VAT number (BT-31): 15 digits, starting and ending with 3
When the seller has a cac:PartyTaxScheme with TaxScheme cbc:ID 'VAT' and a cbc:CompanyID, that CompanyID (BT-31) must be exactly 15 digits, with the first and last digit both '3'.
How to fix it
Use the seller's 15-digit VAT number in cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, with no spaces, letters or prefixes.
ZATCA's official text
[BR-KSA-40]-If it exists in the invoice, the seller VAT registration number (BT-31) must contain 15 digits. The first and the last digits are "3"..
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not(matches(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '^[0-9]{15}$') and starts-with(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3') and ends-with(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3'))
Related rules
- BR-CUSTOM-VALIDATION-01 · Seller and buyer VAT numbers must not be the same
- BR-KSA-39 · Seller VAT registration number (BT-31) is required
- BR-KSA-36 · Supply end date (KSA-24) must not be before supply date (KSA-5)
- BR-KSA-37 · Seller building number must be exactly 4 digits
- BR-KSA-42 · Standard tax invoices and their notes need the buyer name (BT-44)
- BR-KSA-44 · Buyer VAT number (BT-48): 15 digits, starting and ending with 3
Validate your invoice against ZATCA's rules
Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.
Validate an invoice or try Matheel