# BR-47 VAT category code must be present in every VAT breakdown

Under EN 16931 rule BR-47, each VAT breakdown group (BG-23) must specify the VAT category code in BT-118 (TaxCategory ID) from the subset of UNTDID 5305 allowed by the standard (BR-CL-17 in UBL / BR-CL-18 in CII): "S" for standard rate (also used for reduced rates, with the rate in BT-119), "Z" for zero rate, "E" for exempt, "AE" for reverse charge, "K" for intra-community supply, "G" for export outside the EU, "O" for services outside the scope of tax, "L" for the Canary Islands general indirect tax (IGIC), "M" for the Ceuta and Melilla tax (IPSI) and "B" for split payment (Italy only). Each VAT breakdown groups the taxable amount (BT-116) and VAT amount (BT-117) for one category and rate.

## Problem Description

> **ERROR**: EN 16931 core business rule (CEN)

## Context and Significance

This is an EN 16931 core rule. Without BT-118 neither the recipient nor the tax authority can assign the taxable amount and VAT amount to a category, and the category rules (BR-S, BR-AE, BR-E and so on) cannot be applied. The error often appears when an export writes only the percentage in cac:TaxCategory. A code outside the allowed list, such as "AA" for a reduced rate, does not trigger BR-47 but fails BR-CL-17 (UBL) or BR-CL-18 (CII).

## Solution

In your ERP accounting and tax configuration, ensure that every VAT breakdown entry in TaxTotal includes the tax category code. In UBL 2.1 syntax, populate <cac:TaxSubtotal><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal> under <cac:TaxTotal>. In UN/CEFACT CII syntax, populate <ram:CategoryCode>S</ram:CategoryCode> within <ram:ApplicableTradeTax> under <ram:ApplicableHeaderTradeSettlement>.

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

## Valid Examples

- VAT breakdown BG-23 with BT-118 = "S" (Standard VAT rate 19%)
- VAT breakdown BG-23 with BT-118 = "AE" (Reverse charge supply)

## Invalid Examples

- cac:TaxSubtotal declares taxable amount and tax amount but omits cbc:ID inside cac:TaxCategory
- CII ram:ApplicableTradeTax with ram:TypeCode VAT, ram:BasisAmount and ram:CalculatedAmount but no ram:CategoryCode

## Code Examples

### Valid XML
```
<cac:TaxTotal>
  <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>
  <cac:TaxSubtotal>
    <cbc:TaxableAmount currencyID="EUR">100.00</cbc:TaxableAmount>
    <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>
    <cac:TaxCategory>
      <cbc:ID>S</cbc:ID>
      <cbc:Percent>19.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:TaxCategory>
  </cac:TaxSubtotal>
</cac:TaxTotal>
```

### Invalid XML
```
<cac:TaxTotal>
  <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>
  <cac:TaxSubtotal>
    <cbc:TaxableAmount currencyID="EUR">100.00</cbc:TaxableAmount>
    <cbc:TaxAmount currencyID="EUR">19.00</cbc:TaxAmount>
    <cac:TaxCategory>
      <cbc:Percent>19.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:TaxCategory>
  </cac:TaxSubtotal>
</cac:TaxTotal>
```

## Affected Fields

- [BT-118 VAT category code](/resources/xrechnung/bt-118-vat-category-code)
- [BG-23 VAT breakdown](/resources/xrechnung/bt-116-vat-category-taxable-amount)
- [BT-116 VAT category taxable amount](/resources/xrechnung/bt-116-vat-category-taxable-amount)
- [BT-117 VAT category tax amount](/resources/xrechnung/bt-117-vat-category-tax-amount)

## Related Rules

- [BR-CO-17](/resources/kosit-validator-errors/br-co-17-vat-category-tax-amount-must-match-base-times-rate)
- [BR-48](/resources/kosit-validator-errors/br-48-vat-breakdown-category-rate-required)
- [BR-CL-17](/resources/kosit-validator-errors/br-cl-17-uncl5305-document-tax-category)
- [BR-CL-18](/resources/kosit-validator-errors/br-cl-18-uncl5305-line-tax-category)

## 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.
