Validate a ZATCA XML file for free · ZATCA error codes

ZATCA BR-KSA-40: seller VAT number (BT-31) format

BR-KSA-40 · Error

[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"..

Official rule text: ZATCA e-invoice validation rules (official SDK XSL, 20210819).

The official rule: 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.

Official test (UBL XPath), context the seller VAT tax scheme when CompanyID is present: matches(CompanyID, '^[0-9]{15}$') and starts-with(..., '3') and ends-with(..., '3').

Common causes

  • A 10-digit identifier was used (a commercial registration belongs in BT-29, not BT-31).
  • Spaces, hyphens or a country prefix were included.
  • The value does not start or end with 3, or is shorter or longer than 15 digits.

The number below is a format example only, not a real VAT registration. Presence of BT-31 is BR-KSA-39. Valifakt is not a ZATCA-onboarded EGS. This page is not tax advice.

<cac:PartyTaxScheme>
  <cbc:CompanyID>399999999900003</cbc:CompanyID>
  <cac:TaxScheme>
    <cbc:ID>VAT</cbc:ID>
  </cac:TaxScheme>
</cac:PartyTaxScheme>

What if BT-31 is omitted?

BR-KSA-40 applies when the number exists. A missing seller VAT number is BR-KSA-39.

Are letters allowed?

The official test is 15 digits only, with 3 at both ends.

Is the example a real number?

No. It only illustrates the official 15-digit shape.

Related ZATCA rules

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.