All explained rules

BR-CL-23: The unit is not a valid code. How to fix it

A line's unit of measure (BT-130) is not a UN/ECE Recommendation 20 code, such as "Hour" instead of HUR. This is a warning, not an error.

Warning: the invoice is acceptedFrom the European norm EN 16931

The rule, in its own words

Unit code MUST be coded according to the UN/ECE Recommendation 20 with Rec 21 extension

Fields involved: BT-130, BT-150

What the rule checks

The rule checks a line's unit of measure (BT-130) and the unit of the price base quantity (BT-150) against the code list of UN/ECE Recommendation 20 with the Recommendation 21 extension. The code is compared exactly, including upper and lower case. In the European norm a breach is an error; XRechnung validation downgrades it to a warning.

Why files fail it

  • The unit was written as a word or an abbreviation, such as "Stunde", "Stk" or "HR". None of these is in the code list.
  • A code was used that is not in the list, such as KTM instead of KMT for kilometre.
  • Your software keeps its own table of units and does not translate it into codes on export. That often affects the unit of the price base quantity (BT-150) as well, which is easy to overlook.
  • The code is right but in lower case, such as hur instead of HUR.

How to fix it

  1. Write the code instead of the word: HUR for hour, C62 for piece, DAY for day, KMT for kilometre, LS for a lump sum.
  2. The fields are "Invoiced quantity unit of measure code" (BT-130) and "Item price base quantity unit of measure code" (BT-150) in the standard. The same list applies to both.
  3. This is a warning, not a refusal: the official report accepts the invoice. The report still carries valid=false because that attribute is false whenever the report contains any message at all; whether the invoice is accepted is stated in the report's assessment. Correct the unit anyway, because the receiving software cannot reliably match a word to a unit.
  4. In our form you choose the unit in the "Unit" field from a list. You see "Hour", for example, and HUR is what goes into the file; free text is not possible there.

Check your file

Upload your invoice. It runs through the same official validator that applies this rule, and you see immediately whether it passes now.

Check an invoice

or drop it here

XRechnung XML, or a ZUGFeRD / Factur-X PDF. Up to 10 MB.

  • Run against the official EN 16931 and XRechnung rules
  • Your file is deleted the moment the result appears
  • No sign-up, and a result in seconds