The short answer
BR-22 fails when a line has no quantity element: no cbc:InvoicedQuantity inside a cac:InvoiceLine, or no cbc:CreditedQuantity inside a cac:CreditNoteLine. Add the number of units the line charges or credits, with its unitCode, before cbc:LineExtensionAmount.
Expect two more findings on the same line until the quantity is back. The unit code is an attribute of the quantity element, so BR-23 fails with it, and the Peppol line calculation carries on with a quantity of 1 in place of the missing one.
What the rule checks
For every cac:InvoiceLine or cac:CreditNoteLine, the rule looks for a direct child named cbc:InvoicedQuantity or cbc:CreditedQuantity and passes if either exists. It does not read the number.
Only absence is caught here. An empty quantity element is refused by the XSD layer, which expects a number, so the business rules never run on it. A quantity of 0 passes this rule; on the recorded line it was reported by PEPPOL-EN16931-R120 instead, because 0 x 12.5 is not 25.00.
The rule itself accepts either element name in either document type, but the schema does not. When tried, a cbc:InvoicedQuantity inside a cac:CreditNoteLine failed at the XSD layer.
A missing quantity always brings BR-23. Whether PEPPOL-EN16931-R120 joins them depends on the price, because that rule counts the missing quantity as 1. When tried with the price raised to 25, so that 1 x 25 matched the line amount of 25.00, only BR-22 and BR-23 were reported.
| Term | Meaning | UBL element |
|---|---|---|
| BT-129 | Invoiced quantity | cac:InvoiceLine/cbc:InvoicedQuantity (cac:CreditNoteLine/cbc:CreditedQuantity in a credit note) |
| BT-130 | Invoiced quantity unit of measure code | cac:InvoiceLine/cbc:InvoicedQuantity/@unitCode (cac:CreditNoteLine/cbc:CreditedQuantity/@unitCode in a credit note) |
How an integration ends up here
Possible causes, from the shape of the rule rather than from measured usage:
- Service or fixed-fee lines have an amount but no quantity in the source system, and the mapping skips the element when the field is null.
- The quantity is held on a delivery or order line that is not joined when the invoice line is built.
- Credit notes are built from the invoice mapping, and the step that should rename
cbc:InvoicedQuantitytocbc:CreditedQuantitydrops the element instead. - A template writes the quantity only for stock items, and a manual or free-text line falls through without one.
How to fix it
- Find the line from the finding location.
- Take the quantity from the source line: the number of units supplied, or the number being credited. A fee or service charged once has a quantity of 1 in a suitable unit such as
C62; send that rather than leaving the quantity out. - Write it as
cbc:InvoicedQuantityin an invoice orcbc:CreditedQuantityin a credit note, with the UN/ECE unit code inunitCode, immediately beforecbc:LineExtensionAmount. - Recalculate the line: quantity x (net price / base quantity), plus line charges and minus line allowances, must come back to the line net amount within 0.02, which
PEPPOL-EN16931-R120checks. If it does not, one of those values is wrong in the source.
Validate your corrected invoice
Before and after
These are fragments, not complete documents. The complete synthetic documents they come from are linked below.
Fragment of the failing invoice: the line has a net amount and a price but no quantity
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:LineExtensionAmount currencyID="GBP">25.00</cbc:LineExtensionAmount>
<!-- item omitted from this fragment -->
<cac:Price>
<cbc:PriceAmount currencyID="GBP">12.5</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>Fragment of the corrected invoice: a quantity of 2 in unit C62 before the line net amount
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">2</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="GBP">25.00</cbc:LineExtensionAmount>
<!-- item omitted from this fragment -->
<cac:Price>
<cbc:PriceAmount currencyID="GBP">12.5</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>The corrected invoice has <cbc:InvoicedQuantity unitCode="C62">2</cbc:InvoicedQuantity> on line 1 and the failing one has no quantity there. Two other rules are reported against the same line. BR-23 fails because the unit code it looks for is an attribute of the missing element. PEPPOL-EN16931-R120 fails because it counts the missing quantity as 1, and 1 x 12.5 is 12.50, not the 25.00 the line states. Restoring the quantity of 2 clears all three.
What the validator reported
- The failing invoice reports BR-22, BR-23 and PEPPOL-EN16931-R120. The corrected document passes every layer with no findings.Download the failing XMLDownload the corrected XML
Recorded on phive 12.1.0 / phive-rules-peppol 4.5.6 / Saxon-HE 12.10, the engine behind the free validator, using synthetic data. A recorded result is regression evidence for these documents; it is not a certification.
Where it applies
- In a UBL
Invoicethe element iscbc:InvoicedQuantityinsidecac:InvoiceLine; in aCreditNoteit iscbc:CreditedQuantityinsidecac:CreditNoteLine. When tried on a credit note, removing the credited quantity reported the same three rules atcac:CreditNoteLine[1]. - The quantity is optional in the UBL schema, which is why its absence gets past the XSD layer and is left to this rule.
- A quantity that is present but has no
unitCodepasses this rule and is reported byBR-23instead.
Related rules
- BR-23 requires the unit code on the quantity and is reported with this rule when the element is missing
- PEPPOL-EN16931-R120 recalculates the line from the quantity and reads a missing one as 1
- BR-CL-23 checks that the unit code on the quantity is a recognised code
- BR-26 requires the item net price, the other input to the line calculation
- Browse every rule in the reference
- Background: Understanding EN 16931 validation errors
Scope and source
Written for Peppol BIS Billing 3.0.21 (May 2026), EN 16931 1.3.16, as applied to UBL 2.1 Invoice and CreditNote documents. Other profiles, syntaxes and releases can define this identifier differently. Guidance version 2026-09-24.1: source checked 2026-09-24, explanation last updated 2026-09-24.
The official definition of BR-22 carries the normative wording and test. This page is our explanation of it, not a copy.
Guidance does not change the engine verdict. Fixing this finding does not mean the document passes every layer, and validation does not certify legal or tax compliance or transmit a document over Peppol.
