BR-DE-13 Unit Code
What this rule checks
BR-DE-13 validates that the unit of measure for an invoice line in field BT-130 (Invoiced quantity unit of measure) uses a valid code from UN/ECE Recommendation No. 20. The code is specified in the XML as the unitCode attribute of the cbc:InvoicedQuantity element.
The rule ensures that free-text units (e.g., “pieces”, “hours”, “Stück”) are not used — only standardized alphanumeric codes from the UN/ECE codelist are accepted.
Why this rule exists
Standardized unit codes are essential for automated invoice processing:
- Interoperability: Receiving systems must be able to interpret quantities programmatically. The code
C62is universally understood as “one/piece”, whereas “pcs”, “Stück”, or “pieces” can be ambiguous. - Automated goods receipt matching: ERP systems compare the unit of measure on invoices against purchase orders. Only matching UN/ECE codes enable automated three-way matching.
- European Standard EN 16931: Directive 2014/55/EU on electronic invoicing mandates the use of UN/ECE Recommendation 20.
What triggers a failure
The rule fails when:
- The
unitCodeattribute contains free text (e.g.,Stück,Stunden,pieces) - An invalid or non-existent code is used
- The
unitCodeattribute is missing entirely - A deprecated or withdrawn code is used
Failing XML example
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<!-- ERROR: German free text instead of UN/ECE code -->
<cbc:InvoicedQuantity unitCode="Stück">10</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">500.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Office Chair Model X</cbc:Name>
</cac:Item>
</cac:InvoiceLine>
The value Stück is not a valid UN/ECE Rec 20 code. While a human reader understands the meaning, validation systems cannot process this value.
The fix
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<!-- CORRECT: C62 = one/piece per UN/ECE Rec 20 -->
<cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">500.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Office Chair Model X</cbc:Name>
</cac:Item>
</cac:InvoiceLine>
Use the correct UN/ECE code as the value of the unitCode attribute. Note that the code is an XML attribute, not element content.
Edge cases and common mistakes
Commonly used UN/ECE Rec 20 codes
| Code | Meaning | Typical use |
|---|---|---|
C62 | One (piece) | Goods, articles, units |
H87 | Piece | Alternative to C62 |
HUR | Hour | Services, consulting |
DAY | Day | Daily rates |
MON | Month | Monthly subscriptions |
KGM | Kilogram | Weight-based goods |
MTR | Metre | Length-based goods |
LTR | Litre | Liquids |
MTK | Square metre | Area-based services |
KWH | Kilowatt hour | Energy |
SET | Set | Bundles, kits |
LS | Lump sum | Flat-rate services |
Further important notes
C62vs.H87: Both mean “piece” but are technically different codes.C62(one) is more commonly used in German practice. Clarify with your trading partner which code is expected.- Case sensitivity: Codes are case-sensitive.
c62is invalid; useC62. - Attribute, not element:
unitCodeis an XML attribute ofcbc:InvoicedQuantity, not a separate element. Write<cbc:InvoicedQuantity unitCode="C62">, not<cbc:UnitCode>C62</cbc:UnitCode>. - Deprecated codes: Some codes have been withdrawn in newer versions of the recommendation. Make sure you are using the current version (Revision 11 or later).
- Order matching: Use the same
unitCodein invoices and corresponding purchase orders to enable automated matching processes.