VAT categories (S, Z, E, O)
ZATCA invoices use four VAT category codes: S standard, Z zero-rated, E exempt, O out of scope. Each line has one, each category its own breakdown.
Every invoice line carries a VAT category, and ZATCA accepts only four (BR-KSA-18): S standard rate, Z zero-rated (exports, for instance), E exempt, and O outside the scope of VAT. An S rate must be 15 or 5 (BR-KSA-84); the others are 0%.
In the XML the category appears in two places: on the line, in cac:Item/cac:ClassifiedTaxCategory/cbc:ID, and in the document's VAT breakdown, cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID. Each category used on the lines needs its own TaxSubtotal (BR-S-01, BR-Z-01, BR-E-01, BR-O-01).
What goes wrong: a Z, E or O breakdown without an exemption reason code fails BR-KSA-69, BR-KSA-23 or BR-KSA-24. The reverse, a reason code on S, breaks BR-S-10. A non-zero tax amount in a Z breakdown fails BR-Z-09. Any gap between the lines and a category's TaxableAmount shows up in BR-S-08 and its siblings.
On Matheel each line takes tax_category (S, Z, E or O) and tax_exemption_reason_code. An unknown category becomes S, because guessing exempt would under-report VAT. Matheel writes one TaxSubtotal per category with its reason code and text.
Example
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="SAR">100.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">Z</cbc:ID>
<cbc:Percent>0.00</cbc:Percent>
<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>
<cbc:TaxExemptionReason>Export of goods</cbc:TaxExemptionReason>
<cac:TaxScheme>
<cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
FAQ
What is the difference between zero-rated (Z) and exempt (E)?
Both carry 0% on the invoice, but each has its own list of reason codes: Z covers exports and medicines, for example; E covers financial services and real estate.
Which rates are allowed for category S?
15 or 5, per BR-KSA-84.
Related ZATCA rules
Related terms
Let Matheel handle this for you
Matheel signs the invoice, files it with ZATCA and keeps the counter and hash in one request, and returns the PDF with the QR.
Try Matheel, no signup Matheel API docs