What does BR-23 mean?
Every line needs the unit of the quantity under UN/ECE Rec 20, such as piece or kilogram. That makes the quantity unambiguous.
Common causes of BR-23
- The attribute 'unitCode' on the element 'ram:BilledQuantity' is missing.
- The unit was given as plain text (for example 'piece') instead of a UN/ECE code.
- The unit coding was lost when converting from a legacy format.
How to fix BR-23
- Find the faulty spot in the XML. Open the XML of the invoice and go to field BT-130 along this XPath:
//ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode - Apply the fix. Add the unit of measure of the quantity (BT-130) for every Invoice line (BG-25) in the attribute 'unitCode' of the element 'ram:BilledQuantity'. Use a code from UN/ECE Recommendation 20, for example 'C62' for piece or 'HUR' for hour.
- Validate again. Save the file and validate it again to check that BR-23 is no longer reported.
Add the unit of measure of the quantity (BT-130) for every Invoice line (BG-25) in the attribute 'unitCode' of the element 'ram:BilledQuantity'. Use a code from UN/ECE Recommendation 20, for example 'C62' for piece or 'HUR' for hour.
//ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCodeBefore / after: the XML example
This is the spot in question before and after the fix (Cross Industry Invoice, ZUGFeRD/Factur-X).
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity>3</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="C62">3</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
Frequent questions about BR-23
Which code list applies to the unit of measure?
What do I use for flat-fee services without a real unit?
Related error codes
Check BR-23 automatically
Instead of digging through the XML by hand you can validate your ZUGFeRD or XRechnung file online – upload the PDF or the XML and you get every error with rule ID, affected field, fix and XPath, as a readable report or as JSON through the API.