Skip to content

Validation rules ​

Rules checked before a counter is used or anything is signed. Rule IDs follow ZATCA's XML Implementation Standard and EN 16931 where one exists. ZATCA validates more rules on its side; their errors appear on rejected invoices.

Document ​

CodeFieldRule
BR-02invoice_numberRequired
BR-KSA-05typeinvoice, credit_note, debit_note (388, 381, 383)
WORKFLOWworkflowb2b or b2c, matching the issuer used
BR-KSA-04issued_atNot in the future
BR-KSA-07subtypeExport only for B2B; export cannot be self-billed
BR-KSA-16payment_means_codeUNTDID 4461 code
BR-KSA-35supply_dateRequired when supply_end_date is given
BR-KSA-36supply_end_dateNot before supply_date
KSA-24supply_end_dateSummary invoices need both supply dates
BR-KSA-56billing_referenceRequired for credit/debit notes
BR-KSA-17reasonRequired for credit/debit notes
BR-16linesAt least one line
BR-CO-13allowancesAllowances not above the invoice amount; no negative taxable amount per category
BR-CO-16prepaid_amountNot above the total
UNSUPPORTEDprepaid_amountAdvance payments not supported yet
FORMATanyDecimal numbers (max 6 decimals), ISO 8601 dates

Seller (from the taxpayer registration) ​

CodeRule
BR-KSA-39VAT number: 15 digits, starts and ends with 3
BR-KSA-08ID scheme one of CRN, MOM, MLS, 700, SAG, OTH; alphanumeric value
BR-KSA-09Address fields required
BR-KSA-37Building number: 4 digits
BR-KSA-66Postal code: 5 digits

Buyer ​

CodeRule
BR-KSA-42B2B: buyer and buyer name required
BR-KSA-44VAT number: 15 digits, starts and ends with 3
BR-CUSTOM-VALIDATION-01Buyer VAT number differs from the seller's
BR-KSA-46Export invoices: no buyer VAT number
BR-KSA-81B2B: VAT number or another ID (error by default, configurable)
BR-KSA-14ID scheme one of TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, PAS, OTH; alphanumeric value
BR-KSA-63Address fields required (when an address is given)
BR-KSA-37 / BR-KSA-67Building number 4 digits / postal code 5 digits (Saudi addresses)
BR-CL-14Country: ISO 3166 alpha-2
BR-KSA-49B2C: VATEX-SA-EDU / VATEX-SA-HEA need the buyer's national ID (NAT)

Lines ​

CodeFieldRule
BR-25nameRequired
BR-22quantityGreater than zero (use a credit note for returns)
BR-27unit_price, discountPrice not negative; discount between 0 and the line amount
BR-CL-18vat_categoryRequired; S, Z, E or O
BR-S-05vat_rateRequired; percentage (15, not 0.15); greater than 0 for S
BR-S-10exemption_reason_codeNot allowed for S
BR-KSA-CL-04exemption_reason_codeRequired for Z, E, O; must be valid for the category

Warnings ​

CodeMeaning
INFERREDVAT category S was assumed for a 15 % line without a category
BR-KSA-81Buyer without ID, when b2b.require_buyer_identification = false

Not affiliated with or endorsed by ZATCA. Verify regulatory requirements with ZATCA and your tax advisor.