What the field is for
The specification's description (above, in German) translates as: "The unit of measure that applies to the invoiced quantity (BT-129)." BT-130 says in which unit the quantity of a line is given: pieces, hours, kilograms. Every line needs a unit (BR-23).
The unit is a code, not free text. The codes come from the lists UN/ECE Recommendation 20 and 21. According to KoSIT's field description, a seller only needs to support the units it uses for its goods and services; the buyer checks that they match the order, contract or delivery note.
Common codes
| Unit | Code |
|---|---|
| piece | H87 (piece) or C62 (one) |
| hour | HUR |
| minute | MIN |
| day | DAY |
| month | MON |
| kilogram | KGM |
| litre | LTR |
| metre | MTR |
| pair | PR |
| set | SET |
| lump sum | LS |
C62 is a valid code: it means "one", a unit with no further name. Many shops use it for goods
sold by the piece. If you mean "piece" explicitly, use H87.
Which rules check the field
| Rule | What it requires | Level in XRechnung |
|---|---|---|
| BR-23 | every line has a unit | error |
| BR-CL-23 | the unit is a code from UN/ECE Rec. 20 / 21 | warning |
| PEPPOL-EN16931-R130 | the unit of the base quantity (BT-149) is the same | error |
Where the field is in the file
| Syntax | Element |
|---|---|
| CII | attribute unitCode of ram:SpecifiedLineTradeDelivery/ram:BilledQuantity |
| UBL | attribute unitCode of cbc:InvoicedQuantity (credit note: cbc:CreditedQuantity) |
Common mistakes
- The unit is copied from the item master (
Stk,pcs,h,kg) → BR-CL-23. The invoice is accepted, but with a warning; other validators treat it as an error. - No unit → BR-23, the invoice is rejected.
- Lower case (
kgm) → BR-CL-23.
Example
<!-- CII: 3 hours -->
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="HUR">3</ram:BilledQuantity> <!-- BT-129, BT-130 -->
</ram:SpecifiedLineTradeDelivery>
<!-- UBL -->
<cbc:InvoicedQuantity unitCode="HUR">3</cbc:InvoicedQuantity>
Sources: KoSIT, XRechnung specification 3.0.2 (BT-130, BR-23); XRechnung 3.0.2 validator configuration (BR-CL-23 and its level, PEPPOL-EN16931-R130); code lists for EN 16931 v17b in the Factur-X 1.09.2 / ZUGFeRD 2.5.2 package (meaning of the codes).