BR-KSA-CL-07: Prepayment exemption reason code must fit its VAT category
For line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, E or O (VAT), a present cbc:TaxExemptionReasonCode (KSA-41) must belong to that category: Z: VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1, VATEX-SA-34-2, VATEX-SA-34-3, VATEX-SA-34-4, VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY, VATEX-SA-DIPLOMAT, VATEX-SA-DUTYFREE; E: VATEX-SA-29, VATEX-SA-29-7, VATEX-SA-30; O: VATEX-SA-OOS. An absent or empty code does not fail this rule (BR-KSA-93 to BR-KSA-95 cover that), and it is evaluated only when the document also contains a standard-rated (S) VAT category.
How to fix it
Use a code that matches the line's category, e.g. <cbc:ID>Z</cbc:ID> with <cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>.
ZATCA's official text
[BR-KSA-CL-07]-If the Prepayment VAT Category Code(KSA-33) is 'Z', or 'E' or 'O', the Prepayment VAT exemption (or exception) reason code(KSA-41) must exist with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason code - specific to Saudi Arabia.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not(exists(cbc:TaxExemptionReasonCode) and ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='Z' and contains(' VATEX-SA-32 VATEX-SA-33 VATEX-SA-34-1 VATEX-SA-34-2 VATEX-SA-34-3 VATEX-SA-34-4 VATEX-SA-34-5 VATEX-SA-35 VATEX-SA-36 VATEX-SA-EDU VATEX-SA-HEA VATEX-SA-MLTRY VATEX-SA-DIPLOMAT VATEX-SA-DUTYFREE ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='E' and contains(' VATEX-SA-29 VATEX-SA-29-7 VATEX-SA-30 ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='O' and contains(' VATEX-SA-OOS ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or normalize-space(cbc:TaxExemptionReasonCode)='' )
Related rules
- BR-KSA-75 · Prepayment lines need taxable amount, tax amount, category and rate
- BR-KSA-76 · Zero-rated (Z) prepayment line VAT rate must be 0
- BR-KSA-77 · Exempt (E) prepayment line VAT rate must be 0
- BR-KSA-78 · Not-subject (O) prepayment line VAT rate must be 0
- BR-KSA-84 · Standard-rated (S) VAT rate must be 15 or 5
- BR-KSA-93 · Zero-rated (Z) line VAT breakdown needs an exemption reason code
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