BR-33 The document level allowance at allowances[0] states neither a reason (BT-97) nor a reason code (BT-98); both are empty
The document level allowance at allowances[0] states neither a reason (BT-97) nor a reason code (BT-98); both are empty. Every BG-20 group must carry at least one of them, because an unexplained deduction from an invoice total is the single most disputed thing on a commercial document — the buyer's accounts-payable clerk has to decide whether to approve it, and "−missing" on its own gives them nothing to decide on.
This rule is implemented and its error payload below is real, but the long-form write-up — normative text, worked example, divergence note — is not written yet. Everything the library knows about this rule is on this page. Ask and we will prioritise it.
- Business term
BT-97 / BT-98- Severity
fatal
What the library returns
The exact object in result.errors when this rule fires.
Generated by running @attestwire/en16931, not transcribed:
{
"rule": "BR-33",
"field": [
"BT-97",
"BT-98"
],
"severity": "fatal",
"message": "The document level allowance at allowances[0] states neither a reason (BT-97) nor a reason code (BT-98); both are empty. Every BG-20 group must carry at least one of them, because an unexplained deduction from an invoice total is the single most disputed thing on a commercial document — the buyer's accounts-payable clerk has to decide whether to approve it, and \"−missing\" on its own gives them nothing to decide on.",
"fix": "Set allowances[0].reason to a short description in the invoice language, or allowances[0].reasonCode to a UNCL 5189 code, or both. Under XRechnung, prefer the free text: the mandated visualisation renders the code verbatim, so a buyer looking at the rendered invoice sees the bare code and not what it means.",
"example": "\"allowances\": [{ \"amount\": 25.00, \"vatCategory\": \"S\", \"vatRate\": 19, \"reason\": \"Discount\", \"reasonCode\": \"95\" }]",
"xpath": "/ubl:Invoice/cac:AllowanceCharge[1]/cbc:AllowanceChargeReason",
"docsUrl": "https://attestwire.com/rules/BR-33"
}
xpath locates the element in the generated UBL document,
which is where a KoSIT or Peppol validator will report the same problem.
A passing value
"allowances": [{ "amount": 25.00, "vatCategory": "S", "vatRate": 19, "reason": "Discount", "reasonCode": "95" }]The fix
Set allowances[0].reason to a short description in the invoice language, or allowances[0].reasonCode to a UNCL 5189 code, or both. Under XRechnung, prefer the free text: the mandated visualisation renders the code verbatim, so a buyer looking at the rendered invoice sees the bare code and not what it means.