# BR-CL-18 Line-level VAT category code must come from UNCL5305

The invoiced item VAT category code (BT-151) 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

Every invoice line needs a VAT category (BR-CO-4) that links it to a VAT breakdown. In CII, this rule checks every ram:ApplicableTradeTax/ram:CategoryCode, so it also covers the VAT breakdown in the header (BT-118). The rule fails when line data from an ERP or shop system carries lowercase codes ("s"), a "0" for missing tax keys, or intuitive but wrong letters such as "N" for "no VAT". L means IGIC (Canary Islands), not "low rate". Example: a zero-rated line uses Z, a line not subject to VAT uses O.

## Solution

Set BT-151 to an allowed category (S, Z, E, AE, K, G, O, L, M or B) that matches a VAT breakdown with the same category and rate. In UBL, the code is in cac:Item/cac:ClassifiedTaxCategory/cbc:ID; in CII, in ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode.

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

## Valid Examples

- BT-151 = S — standard-rated line
- BT-151 = O — line not subject to VAT

## Invalid Examples

- BT-151 = s — lowercase; codes are case-sensitive
- BT-151 = N — not a UNCL5305 category
- BT-151 = 0 — numeric value, not a category code

## Code Examples

### Valid XML
```
<cac:Item>
  <cac:ClassifiedTaxCategory>
    <cbc:ID>S</cbc:ID>
    <cbc:Percent>19</cbc:Percent>
    <cac:TaxScheme>
      <cbc:ID>VAT</cbc:ID>
    </cac:TaxScheme>
  </cac:ClassifiedTaxCategory>
</cac:Item>
```

### Invalid XML
```
<cac:Item>
  <cac:ClassifiedTaxCategory>
    <cbc:ID>N</cbc:ID>
    <cbc:Percent>19</cbc:Percent>
    <cac:TaxScheme>
      <cbc:ID>VAT</cbc:ID>
    </cac:TaxScheme>
  </cac:ClassifiedTaxCategory>
</cac:Item>
```

## Affected Fields

- [BT-151 Invoiced item VAT category code](/resources/xrechnung/bt-151-invoice-line-vat-category-code)

## Related Rules

- [BR-CL-17](/resources/kosit-validator-errors/br-cl-17-uncl5305-document-tax-category)
- [BR-CO-4](/resources/kosit-validator-errors/br-co-4-each-invoice-line-must-have-vat-category-code)
- [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.
