# BR-23: Unit of measure code (BT-130) missing

Source: https://veriport.io/einvoice-rules/br-23 (published 2026-11-17)

The invoiced quantity must carry a unit of measure code, BT-130, from UN/ECE Recommendation 20 or 21: the `unitCode` attribute of `cbc:InvoicedQuantity` in UBL, of `ram:BilledQuantity` in CII. Below: the message, the cause and the fix, and an invoice our validator checked, failing and fixed.

- **Specification:** [EN 16931 business rules](/einvoice-rules/en16931), CEN EN 16931 validation artefacts 1.3.16
- **Severity:** error
- **Business terms:** BT-130, BG-25
- **Reported by** `POST /einvoice/validate` and our free validators, with a link to this page

## The message validators print

BR-23 is a rule of the EN 16931 business rules (CEN validation artefacts 1.3.16) for UBL and CII. It is an error (fatal): a validator rejects the invoice.

```text
[BR-23]-An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130).
```

## What it checks

The invoiced quantity must carry a unit of measure code, BT-130, from UN/ECE Recommendation 20 or 21: the `unitCode` attribute of `cbc:InvoicedQuantity` in UBL, of `ram:BilledQuantity` in CII.

## Why invoices fail it

The unit is written as text (« Stück », « hours ») elsewhere, and the attribute is left out.

## How to fix it

Map your units to UN/ECE codes (C62 one, HUR hour, DAY day, KGM kilogram, LS lump sum) and write the code in `unitCode`.

## A failing invoice and its fix, checked

We start from our sample invoice (two lines at 19 %, Berlin to Stuttgart), written by our own generator as EN 16931 in UBL. The change below (`-` the failing version, `+` the fixed one) makes the rule fail. Both versions went through our validator on 2026-11-17 (the XML schema and the official rule files, as `POST /einvoice/validate` runs them): the fixed one is valid, the failing one reports BR-23.

| Rule | Severity | Where | Message |
|---|---|---|---|
| **BR-23** | error | `/ubl:Invoice/cac:InvoiceLine[1]` | An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130). |

```diff
  …
    <cac:InvoiceLine>
      <cbc:ID>1</cbc:ID>
-     <cbc:InvoicedQuantity>24.00</cbc:InvoicedQuantity>
+     <cbc:InvoicedQuantity unitCode="HUR">24.00</cbc:InvoicedQuantity>
      <cbc:LineExtensionAmount currencyID="EUR">2280.00</cbc:LineExtensionAmount>
      <cac:Item>
  …
```

## The rule as published

Where the rule applies (`context`) and what must hold (`test`), unmodified from CEN EN 16931 validation artefacts 1.3.16. An `assert` fails when its test is false.

Text and test: © CEN/TC 434, EN 16931 validation artefacts, EUPL 1.2. Quoted unmodified; the explanations on this page are Veriport’s.

```xpath
context: cac:InvoiceLine | cac:CreditNoteLine
test:    exists(cbc:InvoicedQuantity/@unitCode) or exists(cbc:CreditedQuantity/@unitCode)
```

```xpath
context: //ram:IncludedSupplyChainTradeLineItem
test:    (ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode)
```

## Check your own invoice

Drop your XRechnung, ZUGFeRD or Peppol file into a free validator ([Peppol BIS](/tools/peppol-validator), [XRechnung](/tools/xrechnung-pruefen), [Factur-X](/tools/valider-factur-x)): each runs the same rule files and links every finding to its rule page. From your own code, `POST /einvoice/validate` ([reference](/docs/einvoice)) returns the same check as JSON, each finding with an `explanation` field pointing here (5 calls a check, anonymous within the daily allowance).

## Read next

- [BR-21: Invoice line identifier (BT-126) missing](https://veriport.io/einvoice-rules/br-21)
- [BR-22: Invoiced quantity (BT-129) missing](https://veriport.io/einvoice-rules/br-22)
- [BR-24: Line net amount (BT-131) missing](https://veriport.io/einvoice-rules/br-24)
- [BR-25: Item name (BT-153) missing](https://veriport.io/einvoice-rules/br-25)
- [BR-CO-04: Line VAT category code (BT-151) missing](https://veriport.io/einvoice-rules/br-co-04)
- [BR-AE-05: Category AE: wrong rate on a line](https://veriport.io/einvoice-rules/br-ae-05)
- [All EN 16931 business rules](https://veriport.io/einvoice-rules/en16931)
- [All e-invoice rules, search](https://veriport.io/einvoice-rules)
- [Check an e-invoice free (XRechnung prüfen)](https://veriport.io/tools/xrechnung-pruefen)
- [Create a valid e-invoice free (German form)](https://veriport.io/tools/e-rechnung-erstellen)

## Sources

- EN 16931 validation artefacts 1.3.16 (UBL and CII schematron, the business rules BR-*) — https://github.com/ConnectingEurope/eInvoicing-EN16931/releases/tag/validation-1.3.16 (2026-10-28)
- EN 16931 validation artefacts: licence, European Union Public Licence (EUPL) v1.2 (LICENSE.txt, the README « License » section and the release notes of validation-1.3.16) — https://github.com/ConnectingEurope/eInvoicing-EN16931/blob/master/LICENSE.txt (2026-11-17)
