BR-21fatal

How to fix BR-21

Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

What this rule checks

Every line item in the invoice must have a unique line identifier (BT-126, mapped to cbc:ID within cac:InvoiceLine). This identifier allows buyers and sellers to reference specific line items in disputes, partial payments, or credit notes. Without it, there is no way to unambiguously refer to a particular line.

Referenced business terms

This rule references the following EN 16931 business terms. Click through for the full definition, the UBL XPath and the cardinality.

How to fix it

Add a cbc:ID element to each cac:InvoiceLine (or cac:CreditNoteLine) with a unique line identifier (e.g. 1, 2, 3).

Common causes

  • The cbc:ID element is missing from one or more cac:InvoiceLine elements.
  • The line ID element is present but empty.
  • A template or code generator skipped the ID assignment for some lines.
  • The cbc:ID was accidentally nested inside a child element like cac:Item.

Example: before (broken)

<cac:InvoiceLine>
  <!-- cbc:ID is missing -->
  <cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">500.00</cbc:LineExtensionAmount>
  <cac:Item>
    <cbc:Name>Widget A</cbc:Name>
  </cac:Item>
</cac:InvoiceLine>

Example: after (fixed)

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">500.00</cbc:LineExtensionAmount>
  <cac:Item>
    <cbc:Name>Widget A</cbc:Name>
  </cac:Item>
</cac:InvoiceLine>

Related rules

Validate your invoice

Upload your corrected invoice to check it passes BR-21 and all other EN 16931 and Peppol BIS 3.0 rules. Free, instant, no signup.