AttestwireRule referencePEPPOL-EN16931-R121

PEPPOL-EN16931-R121 The item price base quantity must be greater than zero

noun · Peppol BIS · fatal · BT-149

For a sample invoice, the library reports: Line 1 has an item price base quantity (BT-149) of 0, and Peppol requires it to be a positive number above zero. BT-149 is the denominator of the price: it says "the unit price is for this many units", which is how you quote 12.50 per 100 sheets instead of 0.125 per sheet.

Business term
BT-149
Severity
fatal

The fix

Set lines[0].baseQuantity to the number of units the unit price covers — 1 in the ordinary case, in which case you can simply omit it. If you meant the invoiced quantity, that is lines[0].quantity, a different term.

A passing value

the shape this field expects
"unitPrice": 12.5, "baseQuantity": 100, "quantity": 250

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "PEPPOL-EN16931-R121",
  "field": "BT-149",
  "severity": "fatal",
  "message": "Line 1 has an item price base quantity (BT-149) of 0, and Peppol requires it to be a positive number above zero. BT-149 is the denominator of the price: it says \"the unit price is for this many units\", which is how you quote 12.50 per 100 sheets instead of 0.125 per sheet. Zero would make the line net amount a division by zero, and a negative base would silently invert the sign of the line. Core EN 16931 has no rule on this at all, which is precisely why documents with a zero base reach validators that then fail on the arithmetic instead, reporting BR-CO-10 and sending the reader to the wrong place. This is a Peppol BIS Billing 3.0 profile rule: it applies because profile is \"peppol-bis-3\". It does not apply to the en16931, xrechnung-ubl or xrechnung-cii profiles, whose validators will accept the same document.",
  "fix": "Set lines[0].baseQuantity to the number of units the unit price covers — 1 in the ordinary case, in which case you can simply omit it. If you meant the invoiced quantity, that is lines[0].quantity, a different term.",
  "example": "\"unitPrice\": 12.5, \"baseQuantity\": 100, \"quantity\": 250",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Price/cbc:BaseQuantity",
  "docsUrl": "https://attestwire.com/rules/PEPPOL-EN16931-R121"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.