Fixture ID: chargeBadReasonCode · XPath: /ubl:Invoice/cac:AllowanceCharge[1]/cbc:AllowanceChargeReasonCode
The document level charge at charges[0] carries the reason code "95", which is not in UNCL 7161, the list BR-CL-20 admits for charge reason codes. It *is* in the allowance list — and that is the trap this rule exists to catch. EN 16931 uses two different code lists for the two directions: allowance reason codes come from UNCL 5189, charge reason codes from UNCL 7161. Moving an entry between the allowances and charges arrays without changing its code turns a valid document into a rejected one, because the same string means something else in the other list. The list holds 178 codes, far more than the allowance list, because a charge can be almost any service added to a supply. The ones most often wanted: "FC" freight service, "PC" packing, "IAA" insurance, "ABK" miscellaneous, "SH" handling. Note "IN" is not among them — the plain two-letter abbreviation for insurance is exactly the kind of near-miss this rule exists to catch.
BR-CL-20Either set charges[0].reasonCode to a UNCL 7161 code, or remove it and describe the charge in charges[0].reason instead — free text on its own satisfies BR-38 and BR-CO-22, and is better than a code that means the wrong thing.
"charges": [{ "amount": 15.00, "vatCategory": "S", "vatRate": 19, "reasonCode": "FC", "reason": "Freight service" }]