Attestwire › Rule reference › BR-37
BR-37 Every document-level charge must have a VAT category code
noun · EN 16931 · fatal · BT-102
For a sample invoice, the library reports: The document level charge at charges[0] has no VAT category code (BT-102): you supplied missing. A document level charge is not a neutral adjustment to a total — it enters the VAT breakdown on its own account, adding to the taxable amount (BT-116) of exactly one category-and-rate group.
- Business term
BT-102- Severity
fatal
The fix
Set charges[0].vatCategory to the category of the supply this charge relates to — "S" Standard rated, "Z" Zero rated, "E" Exempt from VAT, "AE" Reverse charge, "K" Intra-community supply, "G" Export outside the EU, "O" Not subject to VAT, "L" Canary Islands general indirect tax (IGIC), "M" Tax on production, services and imports in Ceuta and Melilla (IPSI) — which should normally be the category of the lines it adjusts.
A passing value
"vatCategory": "S", "vatRate": 19What 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:
{
"rule": "BR-37",
"field": "BT-102",
"severity": "fatal",
"message": "The document level charge at charges[0] has no VAT category code (BT-102): you supplied missing. A document level charge is not a neutral adjustment to a total — it enters the VAT breakdown on its own account, adding to the taxable amount (BT-116) of exactly one category-and-rate group. Without a category there is no group to put it in, and the document's VAT would silently disagree with its totals.",
"fix": "Set charges[0].vatCategory to the category of the supply this charge relates to — \"S\" Standard rated, \"Z\" Zero rated, \"E\" Exempt from VAT, \"AE\" Reverse charge, \"K\" Intra-community supply, \"G\" Export outside the EU, \"O\" Not subject to VAT, \"L\" Canary Islands general indirect tax (IGIC), \"M\" Tax on production, services and imports in Ceuta and Melilla (IPSI) — which should normally be the category of the lines it adjusts.",
"example": "\"vatCategory\": \"S\", \"vatRate\": 19",
"xpath": "/ubl:Invoice/cac:AllowanceCharge[1]/cac:TaxCategory/cbc:ID",
"docsUrl": "https://attestwire.com/rules/BR-37"
}
xpath is always a UBL path. On a CII invoice, look for the
matching CII field instead.