BR-KSA-31: Simplified invoices cannot be self-billed (KSA-2 position 7 = 0)
For InvoiceTypeCode @name starting '02' (simplified), the check requires characters 3 to 6 of @name to each be '0' or '1' and character 7 (self-billing) to be '0'. So a value such as '0200001' fails, as does any non-binary flag in positions 3–6.
How to fix it
Set the 7th character of the InvoiceTypeCode name attribute to 0, e.g. <cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>; self-billing is not allowed on simplified invoices.
ZATCA's official text
[BR-KSA-31]- For Simplified Tax Invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02), transaction types "self-billing" (KSA-2, position 7 = True) is not allowed.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not( (substring(./@name, 3,1) = '1' or substring(./@name, 3,1) = '0') and (substring(./@name, 4,1) = '1' or substring(./@name, 4,1) = '0') and (substring(./@name, 5,1) = '1' or substring(./@name, 5,1) = '0') and (substring(./@name, 6,1) = '1' or substring(./@name, 6,1) = '0') and (substring(./@name, 7,1) = '0'))
Related rules
- BR-KSA-06 · Invoice transaction code (name attribute) must follow NNPNESB
- BR-KSA-07 · Export invoices cannot be self-billed
- BR-KSA-10 · Standard invoices need buyer street, city and country code
- BR-KSA-15 · Standard tax invoices (388) need a supply date
- BR-KSA-25 · Simplified invoice with EDU/HEA exemption needs the buyer name
- BR-KSA-42 · Standard tax invoices and their notes need the buyer name (BT-44)
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