# XML validation for different vat category codes

**URL:** <https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627>\
**Category:** General\
**Created:** [February 4, 2025, 7:51am UTC](https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627 "2025-02-04T07:51:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![malar](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@malar](https://zatca1.discourse.group/u/malar)\
**Post date:** [February 4, 2025, 7:51am UTC](https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627/1 "2025-02-04T07:51:57Z")

</div>

@Ankit.K.Tiwari @Malik  
I am trying to generate an invoice line that is Standard S, another that is zero-rated Z, and allowance charge that is also Zero-rated Z.  
I get a warning. I cant figure out my mistake.  
cac:AllowanceCharge  
cbc:ChargeIndicatortrue\</cbc:ChargeIndicator\>  
cbc:AllowanceChargeReasonCodeLF\</cbc:AllowanceChargeReasonCode\>  
cbc:AllowanceChargeReasonLegalisation fee\</cbc:AllowanceChargeReason\>  
\<cbc:Amount currencyID=“SAR”\>60.00\</cbc:Amount\>  
cac:TaxCategory  
cbc:IDZ\</cbc:ID\>  
cbc:Percent00.00\</cbc:Percent\>  
cac:TaxScheme  
cbc:IDVAT\</cbc:ID\>  
cbc:TaxTypeCodeVATEX-SA-HEA\</cbc:TaxTypeCode\>  
\</cac:TaxScheme\>  
\</cac:TaxCategory\>  
\</cac:AllowanceCharge\>  
cac:TaxTotal  
\<cbc:TaxAmount currencyID=“SAR”\>30.00\</cbc:TaxAmount\>  
\</cac:TaxTotal\>  
cac:TaxTotal  
\<cbc:TaxAmount currencyID=“SAR”\>30.00\</cbc:TaxAmount\>  
cac:TaxSubtotal  
\<cbc:TaxableAmount currencyID=“SAR”\>200.00\</cbc:TaxableAmount\>  
\<cbc:TaxAmount currencyID=“SAR”\>30.00\</cbc:TaxAmount\>  
cac:TaxCategory  
cbc:IDS\</cbc:ID\>  
cbc:Percent15.00\</cbc:Percent\>  
cac:TaxScheme  
cbc:IDVAT\</cbc:ID\>  
  
  
\</cac:TaxScheme\>  
\</cac:TaxCategory\>  
\</cac:TaxSubtotal\>  
\</cac:TaxTotal\>  
cac:LegalMonetaryTotal  
\<cbc:LineExtensionAmount currencyID=“SAR”\>2200.00\</cbc:LineExtensionAmount\>  
\<cbc:TaxExclusiveAmount currencyID=“SAR”\>2260.00\</cbc:TaxExclusiveAmount\>  
\<cbc:TaxInclusiveAmount currencyID=“SAR”\>2290.00\</cbc:TaxInclusiveAmount\>  
\<cbc:ChargeTotalAmount currencyID=“SAR”\>60.00\</cbc:ChargeTotalAmount\>  
\<cbc:PayableAmount currencyID=“SAR”\>2290.00\</cbc:PayableAmount\>  
\</cac:LegalMonetaryTotal\>

```
<cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">1.00</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">2000.00</cbc:LineExtensionAmount>
    <cac:TaxTotal>
         <cbc:TaxAmount currencyID="SAR">00.00</cbc:TaxAmount>
         <cbc:RoundingAmount currencyID="SAR">2000.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
        <cbc:Name>Legal services |خدمات قانونية</cbc:Name>
        <cac:ClassifiedTaxCategory>
            <cbc:ID>Z</cbc:ID>
            <cbc:Percent>0.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
                <cbc:TaxTypeCode>VATEX-SA-HEA</cbc:TaxTypeCode>
            </cac:TaxScheme>
        </cac:ClassifiedTaxCategory>
    </cac:Item>
    <cac:Price>
        <cbc:PriceAmount currencyID="SAR">2000.00</cbc:PriceAmount>
    </cac:Price>
</cac:InvoiceLine>

<cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">2.00</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">200.00</cbc:LineExtensionAmount>
    <cac:TaxTotal>
         <cbc:TaxAmount currencyID="SAR">30.00</cbc:TaxAmount>
         <cbc:RoundingAmount currencyID="SAR">230.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
        <cbc:Name>Legal services |خدمات قانونية</cbc:Name>
        <cac:ClassifiedTaxCategory>
            <cbc:ID>S</cbc:ID>
            <cbc:Percent>15.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
            </cac:TaxScheme>
        </cac:ClassifiedTaxCategory>
    </cac:Item>
    <cac:Price>
        <cbc:PriceAmount currencyID="SAR">100.00</cbc:PriceAmount>
    </cac:Price>
</cac:InvoiceLine>

```

## Warnings

- **category :** BR\_WARNING
- \*\*code :\*\*BR-Z-01
- **message :** An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is ‘Zero rated’ shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with ‘Zero rated’.

Also If there are different line items - S, Z, E, O what should be the ‘TaxCategory’ at the document level. Should it be S?

---

<div class="post-metadata">

**Author:** ![Ather](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ather/32/848_2.png) [@Ather](https://zatca1.discourse.group/u/Ather)\
**Post date:** [February 5, 2025, 8:19am UTC](https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627/2 "2025-02-05T08:19:48Z")

</div>

```auto
<cac:TaxTotal>
    <!-- Standard-rated (S) VAT section -->
    <cbc:TaxAmount currencyID="SAR">30.00</cbc:TaxAmount>  
    <cac:TaxSubtotal>
        <cbc:TaxableAmount currencyID="SAR">200.00</cbc:TaxableAmount>
        <cbc:TaxAmount currencyID="SAR">30.00</cbc:TaxAmount>  
        <cac:TaxCategory>
            <cbc:ID>S</cbc:ID>
            <cbc:Percent>15.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
            </cac:TaxScheme>
        </cac:TaxCategory>
    </cac:TaxSubtotal>

    <!-- Zero-rated (Z) VAT section (THIS WAS MISSING) -->
    <cac:TaxSubtotal>
        <cbc:TaxableAmount currencyID="SAR">2000.00</cbc:TaxableAmount>
        <cbc:TaxAmount currencyID="SAR">0.00</cbc:TaxAmount>  
        <cac:TaxCategory>
            <cbc:ID>Z</cbc:ID>
            <cbc:Percent>0.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
                <cbc:TaxTypeCode>VATEX-SA-HEA</cbc:TaxTypeCode>
            </cac:TaxScheme>
        </cac:TaxCategory>
    </cac:TaxSubtotal>
</cac:TaxTotal>

```

---

<div class="post-metadata">

**Author:** ![malar](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@malar](https://zatca1.discourse.group/u/malar)\
**Post date:** [February 6, 2025, 9:29am UTC](https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627/3 "2025-02-06T09:29:59Z")

</div>

@Ather Thank you very much. it worked. I had tried this earlier but i landed with other errors on TaxExemptionCode. Now its resolved

---

<div class="post-metadata">

**Author:** ![Ather](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ather/32/848_2.png) [@Ather](https://zatca1.discourse.group/u/Ather)\
**Post date:** [February 6, 2025, 11:21am UTC](https://zatca1.discourse.group/t/xml-validation-for-different-vat-category-codes/5627/4 "2025-02-06T11:21:28Z")

</div>

Good to hear that that your problem has been solved 😍
