# BR-CL-23 Unit code must come from UN/ECE Rec 20 with Rec 21

Unit of measure codes (e.g. invoiced quantity unit BT-130, base quantity unit BT-150) must be coded per UN/ECE Recommendation 20 with the Rec 21 extension.

## Problem Description

Unit of measure codes (e.g. invoiced quantity unit BT-130, base quantity unit BT-150) must be coded per UN/ECE Recommendation 20 with the Rec 21 extension.

> **ERROR**: XRechnung 3.0

## Context and Significance

This EN16931 core code-list rule guarantees that quantities carry a globally recognised unit for pricing and delivery.

## Solution

Use a valid UN/ECE Rec 20/21 code such as C62 (one/piece), KGM (kilogram), MTR (metre), LTR (litre) or HUR (hour).

- validate
- convert

## Valid Examples

- BT-130 = C62 — one/piece
- BT-130 = KGM — kilogram

## Invalid Examples

- BT-130 = PCS — not a UN/ECE Rec 20/21 code
- BT-130 = Stk — local abbreviation

## Code Examples

### Valid XML
```
<cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity>
```

### Invalid XML
```
<cbc:InvoicedQuantity unitCode="PCS">10</cbc:InvoicedQuantity>
```

## Affected Fields

- [BT-130 Invoiced quantity unit of measure code](/resources/xrechnung/bt-130-invoice-line-quantity-unit-of-measure-code)
- [BT-150 Item price base quantity unit of measure code](/resources/xrechnung/bt-150-item-price-base-quantity-unit-code)

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