Attestwire › Rule reference › BR-57
BR-57 A delivery address must include a country code
noun · EN 16931 · fatal · BT-80
For a sample invoice, the library reports: The invoice carries a deliver-to address group (BG-15), so it must contain a deliver-to country code (BT-80).
- Business term
BT-80- Severity
fatal
The fix
Set deliverTo.countryCode to the ISO 3166-1 alpha-2 code of the place of delivery, or remove deliverTo entirely if the goods or services were delivered to the buyer's own address. Under XRechnung, keeping BG-15 also obliges you to supply deliverTo.city and deliverTo.postalCode (BR-DE-10, BR-DE-11).
A passing value
"deliverTo": { "city": "Lyon", "postalCode": "69001", "countryCode": "FR" }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:
{
"rule": "BR-57",
"field": "BT-80",
"severity": "fatal",
"message": "The invoice carries a deliver-to address group (BG-15), so it must contain a deliver-to country code (BT-80). BG-15 is optional, but it is not partially optional: the country is the one element of a delivery address that carries tax consequence, because it is what separates a domestic supply from an export, an intra-community supply or a reverse-charge case.",
"fix": "Set deliverTo.countryCode to the ISO 3166-1 alpha-2 code of the place of delivery, or remove deliverTo entirely if the goods or services were delivered to the buyer's own address. Under XRechnung, keeping BG-15 also obliges you to supply deliverTo.city and deliverTo.postalCode (BR-DE-10, BR-DE-11).",
"example": "\"deliverTo\": { \"city\": \"Lyon\", \"postalCode\": \"69001\", \"countryCode\": \"FR\" }",
"xpath": "/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode",
"docsUrl": "https://attestwire.com/rules/BR-57"
}
xpath is always a UBL path. On a CII invoice, look for the
matching CII field instead.