# BR-37 Document level charge VAT category code is required

Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).

## Problem Description

Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).

> **ERROR**: XRechnung 3.0

## Context and Significance

This rule comes from the EN16931 core semantic model enforced by the KoSIT XRechnung 3.0.2 Schematron, ensuring invoices carry the mandatory data needed for automated processing.

## Solution

Add cac:TaxCategory/cbc:ID to the charge, using the VAT category that the charge is taxed under.

- validate
- convert

## Valid Examples

- BT-102 = S (standard rate) on a document level charge

## Invalid Examples

- Document charge amount present but no BT-102 category code

## Code Examples

### Valid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:Amount currencyID="EUR">9.90</cbc:Amount>
  <cac:TaxCategory>
    <cbc:ID>S</cbc:ID>
    <cbc:Percent>19</cbc:Percent>
    <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
  </cac:TaxCategory>
</cac:AllowanceCharge>
```

### Invalid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:Amount currencyID="EUR">9.90</cbc:Amount>
</cac:AllowanceCharge>
```

## Affected Fields

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

## Related Rules

- [BR-36](/resources/kosit-validator-errors/br-36-document-charge-amount-required)
- [BR-38](/resources/kosit-validator-errors/br-38-document-charge-reason-required)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
