# BR-CL-17 Document-level VAT category code must come from UNCL5305

VAT category codes at document level, in the VAT breakdown (BT-118) and on document-level allowances (BT-95) and charges (BT-102), must be one of the UNCL5305 codes allowed by EN 16931: S, Z, E, AE, K, G, O, L, M or B.

## Problem Description

> **ERROR**: EN 16931 code-list rule (BR-CL)

## Context and Significance

In UBL, the rule checks every cac:TaxCategory/cbc:ID, which covers the VAT breakdown and document-level allowances and charges. In CII, it checks ram:CategoryTradeTax/ram:CategoryCode on allowances and charges; the CII VAT breakdown is checked by BR-CL-18. The rule fails when an ERP exports its own tax keys ("V19", "HIGH"), a rate ("19") or a UNCL5305 code outside the EN 16931 subset, such as AA (lower rate). Example: a VAT breakdown at the German reduced rate uses category S with rate 7, not AA.

## Solution

Use an allowed code: S (standard rate), Z (zero rated), E (exempt from VAT), AE (VAT reverse charge), K (intra-community supply), G (export outside the EU), O (not subject to VAT), L (IGIC, Canary Islands), M (IPSI, Ceuta and Melilla) or B (transferred VAT, split payment in Italy). A reduced rate is not a separate category: use S with the reduced percentage.

- [Validate XML](/en/xrechnung-validator?source=resource&rule=BR-CL-17)
- [Convert invoice](/en/pdf-to-xrechnung?source=resource&rule=BR-CL-17)

## Valid Examples

- BT-118 = S — standard rate, also with a reduced percentage
- BT-102 = AE — VAT reverse charge on a document-level charge

## Invalid Examples

- BT-118 = AA — in UNCL5305 (lower rate) but not allowed in EN 16931; use S
- BT-118 = 19 — a rate value, not a category code

## Code Examples

### Valid XML
```
<cac:TaxCategory>
  <cbc:ID>S</cbc:ID>
  <cbc:Percent>7</cbc:Percent>
  <cac:TaxScheme>
    <cbc:ID>VAT</cbc:ID>
  </cac:TaxScheme>
</cac:TaxCategory>
```

### Invalid XML
```
<cac:TaxCategory>
  <cbc:ID>AA</cbc:ID>
  <cbc:Percent>7</cbc:Percent>
  <cac:TaxScheme>
    <cbc:ID>VAT</cbc:ID>
  </cac:TaxScheme>
</cac:TaxCategory>
```

## Affected Fields

- [BT-95 Document level allowance VAT category code](/resources/xrechnung/bt-95-document-level-allowance-vat-category-code)
- [BT-102 Document level charge VAT category code](/resources/xrechnung/bt-102-document-level-charge-vat-category-code)
- [BT-118 VAT category code](/resources/xrechnung/bt-118-vat-category-code)

## Related Rules

- [BR-CL-18](/resources/kosit-validator-errors/br-cl-18-uncl5305-line-tax-category)
- [BR-AE-02](/resources/kosit-validator-errors/br-ae-02-reverse-charge-seller-vat-id-required)
- [BR-E-01](/resources/kosit-validator-errors/br-e-01-exempt-vat-breakdown-required)

## Validation Tools

- [Official KoSIT Validator](https://github.com/itplr-kosit/validator): Run the official KoSIT validator with the XRechnung configuration to check EN 16931 and XRechnung rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Find validation errors during conversion and review each correction.

## Related Resources

- [Official Specification](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [All validation errors](/resources/kosit-validator-errors): Overview of the EN 16931, XRechnung and Peppol validation rules explained here.
