BR-KSA-51ErrorZATCA Phase 2 UBL 2.1implemented
Line Total With VAT Calculation (KSA-12 / RoundingAmount)
Line RoundingAmount (KSA-12) must equal LineExtensionAmount (BT-131) plus Line VAT Amount (KSA-11).
- Scope
- Invoice Lines
- Applicable Invoice Types
- Standard (B2B), Simplified (B2C), Credit Note, Debit Note
- Catalog Version
- v1.0.0 (2026-11-23)
- Target XPath
/Invoice/cac:InvoiceLine/cac:TaxTotal/cbc:RoundingAmount
Typical Reason for Failure
RoundingAmount is left unchanged after editing line VAT or quantity.
Invalid Synthetic Example
Before (Fails)xml
<cbc:LineExtensionAmount currencyID="SAR">1000.00</cbc:LineExtensionAmount>
<cac:TaxTotal><cbc:TaxAmount currencyID="SAR">140.00</cbc:TaxAmount><cbc:RoundingAmount currencyID="SAR">1150.00</cbc:RoundingAmount></cac:TaxTotal>Corrected Synthetic Example
After (Fixed)xml
<cbc:LineExtensionAmount currencyID="SAR">1000.00</cbc:LineExtensionAmount>
<cac:TaxTotal><cbc:TaxAmount currencyID="SAR">150.00</cbc:TaxAmount><cbc:RoundingAmount currencyID="SAR">1150.00</cbc:RoundingAmount></cac:TaxTotal>Explanation of the Fix
Set RoundingAmount strictly to LineExtensionAmount + Line TaxAmount.
Official Source Reference
ZATCA Electronic Invoice XML Implementation Standard (Phase 2)
Open official specificationTest your invoice against BR-KSA-51 now
Browser quick check; raw XML is never stored.