# BR-CO-22 Document charge needs a reason or reason code

Each document level charge (BG-21) shall contain a document level charge reason (BT-104) or a document level charge reason code (BT-105), or both.

## Problem Description

> **ERROR**: EN 16931 calculation and consistency rule (BR-CO)

## Context and Significance

This EN 16931 rule requires every document level charge to state why it is added, as text or as a code, so that the buyer can see what the extra amount is for. The error often occurs when shipping, packaging or handling costs are exported only as an amount.

## Solution

For every document level charge, add a reason (BT-104) and/or a reason code (BT-105) from UNCL 7161: cbc:AllowanceChargeReason / cbc:AllowanceChargeReasonCode in UBL, ram:Reason / ram:ReasonCode in ram:SpecifiedTradeAllowanceCharge in CII.

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

## Valid Examples

- Document charge with BT-105 = FC and BT-104 = "Freight charge"

## Invalid Examples

- Document charge amount 15.00 with neither BT-104 nor BT-105

## Code Examples

### Valid XML
```
<cac:AllowanceCharge>
  <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
  <cbc:AllowanceChargeReasonCode>FC</cbc:AllowanceChargeReasonCode>
  <cbc:AllowanceChargeReason>Freight charge</cbc:AllowanceChargeReason>
  <cbc:Amount currencyID="EUR">15.00</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">15.00</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>
```

## Affected Fields

- [BG-21 Document level charges](/resources/xrechnung/bt-99-document-level-charge-amount)
- [BT-104 Document level charge reason](/resources/xrechnung/bt-104-document-level-charge-reason)
- [BT-105 Document level charge reason code](/resources/xrechnung/bt-105-document-level-charge-reason-code)

## Related Rules

- [BR-CO-06](/resources/kosit-validator-errors/br-co-06-charge-reason-code-match)
- [BR-CO-21](/resources/kosit-validator-errors/br-co-21-document-allowance-reason-required)
- [BR-CO-24](/resources/kosit-validator-errors/br-co-24-line-charge-reason-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.
