Invoice has an out-of-scope VAT breakdown but an allowance in another category
Reported asallowance_not_out_of_scopean allowance in a category other than out of scope
What is wrong
A cac:TaxSubtotal directly under the invoice's own cac:TaxTotal is coded O - out of scope - under the VAT tax scheme, and at least one allowance is in a different category. EN 16931 rule BR-O-13, which ZATCA runs, requires every allowance on such an invoice to be out of scope. Only allowances are counted, meaning a cac:AllowanceCharge whose cbc:ChargeIndicator is false; a charge, where the indicator is true, is outside this rule. An allowance whose cac:TaxCategory has no cbc:ID at all counts as a different category, because an absent code is read as an empty one.
What to check in your ERP
Compare the category letter on every discount against the breakdown's. The mismatch normally comes from a discount that takes a default tax code rather than the one on the supply it reduces - a settlement discount, a promotional discount, or a rounding adjustment posted as an allowance. Check both the document-level discounts and any written inside an invoice line, since the rule counts them wherever they appear. If the invoice genuinely covers both out-of-scope and other supplies it has to be split into two documents.