Reference
Markdown exportBR-23 Invoiced quantity unit of measure code must be specified
Under EN 16931 rule BR-23, each invoiced quantity in BT-129 must have an associated unit of measure code in BT-130 (@unitCode). The unit code must be selected from the UN/ECE Recommendation 20 / Recommendation 21 code list (e.g. "H87" for piece, "C62" for one, "KGM" for kilogram, "MTR" for meter, "HUR" for hour, or "DAY" for day). Omitting the unitCode attribute leaves the invoiced physical dimension ambiguous.
Problem Description
ERROR
EN 16931 core business rule (CEN)
Interactive pipeline
Where BR-23 is checked
Click a stage to see what it checks, or type a rule ID to light up the stage that reports it.
BR-23 EN 16931 core rule
Reported in stage 2: EN 16931 rules.
Level error: the report recommends rejecting the invoice.
Stage 2 · What it checks
EN 16931 rules
- The core business terms are present (BR-01 to BR-65).
- Totals add up and related fields agree (BR-CO); codes and decimals are valid (BR-CL, BR-DEC).
- Each VAT category is consistent: S, Z, E, AE, K, G, O, L, M (BR-S, BR-Z, BR-AE, BR-IC …).
Example codes
Typical fix
Recalculate totals and VAT from the line data, and correct the VAT category in the source data.
Solution
In your ERP master data or invoice line configuration, ensure every invoiced quantity exports an approved UN/ECE unit code. In UBL 2.1 syntax, populate the unitCode attribute on InvoicedQuantity: <cbc:InvoicedQuantity unitCode="H87">10.00</cbc:InvoicedQuantity>. In UN/CEFACT CII syntax, populate the unitCode attribute on BilledQuantity: <ram:BilledQuantity unitCode="H87">10.00</ram:BilledQuantity>.
Quick actions
Context and Significance
This is an EN 16931 core rule. A quantity without a unitCode attribute fails BR-23; an attribute with an empty or unknown code fails the code list rule BR-CL-23 instead. BR-23 usually appears when the export has no unit mapping and writes the bare quantity, while an ERP unit such as "pcs" copied into unitCode triggers BR-CL-23.
Valid Examples
- Invoice line with BT-129 = 10 and BT-130 = "H87" (10 pieces)
- Invoice line with BT-129 = 40.5 and BT-130 = "HUR" (40.5 hours)
Invalid Examples
- cac:InvoiceLine element contains numeric quantity but omits unitCode attribute (<cbc:InvoicedQuantity>10</cbc:InvoicedQuantity>)
- A credit note line with <cbc:CreditedQuantity>2</cbc:CreditedQuantity> and no unitCode attribute; an empty or unknown unitCode fails the code list rule BR-CL-23 instead
Code Examples
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="H87">10</cbc:InvoicedQuantity>
</cac:InvoiceLine><cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity>10</cbc:InvoicedQuantity>
</cac:InvoiceLine>