HomeError code lexicon › FX-SCH-A-275
FX-SCH-A-275 Field BT-130 EN 16931 core rules (BR)

Fix FX-SCH-A-275: Unit of measure (unitCode) is not a valid code

[FX-SCH-A-275] Value of '@unitCode' is not allowed.

FX-SCH-A-275 in your own invoice? Upload the file and find every error in seconds.

What does FX-SCH-A-275 mean?

Every quantity carries a "unitCode" attribute - the invoiced quantity of a line (BT-130) as well as the item price base quantity (BT-149). This code must come from UN/ECE Rec 20 with the Rec 21 extension. Free text such as "pcs" or a private abbreviation triggers the error. In Factur-X, Mustang checks this through rule FX-SCH-A-275; it matches BR-CL-23 of EN 16931 in substance.

Common causes of FX-SCH-A-275

How to fix FX-SCH-A-275

  1. Find the faulty spot in the XML. Open the XML of the invoice and go to field BT-130 along this XPath://ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode
  2. Apply the fix. Use a valid unit of measure code from UN/ECE Rec 20 (with the Rec 21 extension), for example 'H87' for piece, 'KGM' for kilogram, 'LTR' for litre, 'MTR' for metre, 'HUR' for hour, 'DAY' for day or 'C62' for a dimensionless unit. Free text such as 'Stk' or 'piece' is not allowed. The 'unitCode' attribute sits on the invoiced quantity (ram:BilledQuantity) and on the price base quantity.
  3. Validate again. Save the file and validate it again to check that FX-SCH-A-275 is no longer reported.
Concrete fix

Use a valid unit of measure code from UN/ECE Rec 20 (with the Rec 21 extension), for example 'H87' for piece, 'KGM' for kilogram, 'LTR' for litre, 'MTR' for metre, 'HUR' for hour, 'DAY' for day or 'C62' for a dimensionless unit. Free text such as 'Stk' or 'piece' is not allowed. The 'unitCode' attribute sits on the invoiced quantity (ram:BilledQuantity) and on the price base quantity.

XPath//ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode

Before / after: the XML example

This is the spot in question before and after the fix (Cross Industry Invoice, ZUGFeRD/Factur-X).

Wrong
<ram:SpecifiedLineTradeDelivery>
  <ram:BilledQuantity unitCode="Stk">3</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
Correct
<ram:SpecifiedLineTradeDelivery>
  <ram:BilledQuantity unitCode="H87">3</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>

Frequent questions about FX-SCH-A-275

Which code stands for piece?
"H87". It is the UN/ECE code for "piece" and the most common value for goods sold by the piece.
Where do I find the allowed codes?
In UN/ECE Rec 20 together with the Rec 21 extension. Common values include "H87" (piece), "KGM" (kilogram), "LTR" (litre), "MTR" (metre), "MTK" (square metre), "HUR" (hour), "DAY" (day) and "C62" (dimensionless unit).
Why does the validator report this although I did give a code?
The code must be exact and in upper case. "h87", "H 87" or "PCE" are not in the list and trigger the error.

Related error codes

Check FX-SCH-A-275 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.

Find every error automatically instead of searching by hand

Upload your ZUGFeRD, Factur-X or XRechnung file – you get every violation back with rule ID, field, fix and XPath.

Validate online for free
Check invoice