Unit code required for UnitQuantity

Error FX-SCH-A-001152 Factur-X

Attribute '@unitCode' is required in this context.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The unitCode attribute is missing from ram:UnitQuantity. As a result, the unit for the stated quantity is not specified.

What the rule means

The unit code describes the unit in which the referenced product quantity is stated. Without it, the quantity cannot be fully interpreted.

Please add the unit code for `ram:UnitQuantity`

The unit for the referenced product quantity is missing. Add the unit code so the quantity is clear.

What to do
  1. Locate ram:UnitQuantity in the referenced product on the invoice line.
  2. Add the unitCode attribute with the unit code for the quantity.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:UnitQuantity>2</ram:UnitQuantity>
✓ Correct
<ram:UnitQuantity unitCode="…">2</ram:UnitQuantity>
Technical details

The test checks whether the unitCode attribute is present on ram:UnitQuantity.

Where the rule applies

This rule applies to ram:UnitQuantity of a referenced product on an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:IncludedReferencedProduct/ram:UnitQuantity
Test expression (assert/@test)
@unitCode