# Counterfoil

> Counterfoil is a registry of quoted EU e-invoice business rules. Version 0.6.0 has 68 UBL rules. Each note quotes the official statement, context, and test, then gives a short reading and a fix. Not a validator. Not tax, legal, or accounting advice.

Canonical origin: https://einvoicegoblin.com
Read the rule index, then one rule. These notes do not check an invoice. The invoice form does not assign a VAT category code.

## Index

- [Rule index](https://einvoicegoblin.com/rules/index.md): 68 rules in version 0.6.0, grouped, each linking to its markdown note.

## XRechnung

- [BR-DE-15](https://einvoicegoblin.com/rules/BR-DE-15/index.md): fatal. The element "Buyer reference" (BT-10) must be transmitted.

## Payment account

- [BR-50](https://einvoicegoblin.com/rules/BR-50/index.md): fatal. If credit-transfer information is present for payment means 30 or 58, the payment account identifier (BT-84) must be present.
- [BR-DE-19](https://einvoicegoblin.com/rules/BR-DE-19/index.md): warning. When the payment means type code (BT-81) is 58, the payment account identifier (BT-84) should be a correct IBAN.
- [BR-DE-23-a](https://einvoicegoblin.com/rules/BR-DE-23-a/index.md): fatal. If the payment means type code (BT-81) is a credit-transfer code (30 or 58), the credit-transfer group BG-17 must be transmitted.

## Totals

- [BR-CO-10](https://einvoicegoblin.com/rules/BR-CO-10/index.md): fatal. The sum of invoice line net amounts (BT-106) must equal the sum of the line net amounts (BT-131).
- [BR-CO-13](https://einvoicegoblin.com/rules/BR-CO-13/index.md): fatal. The invoice total without VAT (BT-109) must equal the sum of line net amounts (BT-131), minus document-level allowances (BT-107), plus document-level charges (BT-108).
- [BR-CO-14](https://einvoicegoblin.com/rules/BR-CO-14/index.md): fatal. The invoice total VAT amount (BT-110) must equal the sum of the VAT category tax amounts (BT-117).
- [BR-CO-15](https://einvoicegoblin.com/rules/BR-CO-15/index.md): fatal. The invoice total with VAT (BT-112) must equal the total without VAT (BT-109) plus the VAT total (BT-110).

## Standard rated

- [BR-S-01](https://einvoicegoblin.com/rules/BR-S-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Standard rated", the VAT breakdown must contain at least one VAT category code equal with "Standard rated".
- [BR-S-02](https://einvoicegoblin.com/rules/BR-S-02/index.md): fatal. If an invoice line uses VAT category "Standard rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-S-03](https://einvoicegoblin.com/rules/BR-S-03/index.md): fatal. If a document-level allowance uses VAT category "Standard rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-S-04](https://einvoicegoblin.com/rules/BR-S-04/index.md): fatal. If a document-level charge uses VAT category "Standard rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-S-05](https://einvoicegoblin.com/rules/BR-S-05/index.md): fatal. On an invoice line whose VAT category is "Standard rated", the line VAT rate (BT-152) must be greater than zero.
- [BR-S-06](https://einvoicegoblin.com/rules/BR-S-06/index.md): fatal. On a document-level allowance whose VAT category is "Standard rated", the allowance VAT rate (BT-96) must be greater than zero.
- [BR-S-07](https://einvoicegoblin.com/rules/BR-S-07/index.md): fatal. On a document-level charge whose VAT category is "Standard rated", the charge VAT rate (BT-103) must be greater than zero.
- [BR-S-08](https://einvoicegoblin.com/rules/BR-S-08/index.md): fatal. For each standard-rated VAT category rate (BT-119), the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131) plus document-level charge amounts (BT-99) minus document-level allowance amounts (BT-92), counting only standard-rated lines, charges, and allowances at that same rate.
- [BR-S-09](https://einvoicegoblin.com/rules/BR-S-09/index.md): fatal. In a VAT breakdown whose category is "Standard rated", the VAT category tax amount (BT-117) must equal the taxable amount (BT-116) multiplied by the VAT category rate (BT-119).
- [BR-S-10](https://einvoicegoblin.com/rules/BR-S-10/index.md): fatal. A VAT breakdown whose category is standard rated must not include a VAT exemption reason code (BT-121) or a VAT exemption reason text (BT-120).

## Zero rated

- [BR-Z-01](https://einvoicegoblin.com/rules/BR-Z-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Zero rated", the VAT breakdown must contain exactly one VAT category code equal with "Zero rated".
- [BR-Z-02](https://einvoicegoblin.com/rules/BR-Z-02/index.md): fatal. If an invoice line uses VAT category "Zero rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-Z-03](https://einvoicegoblin.com/rules/BR-Z-03/index.md): fatal. If a document-level allowance uses VAT category "Zero rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-Z-04](https://einvoicegoblin.com/rules/BR-Z-04/index.md): fatal. If a document-level charge uses VAT category "Zero rated", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-Z-05](https://einvoicegoblin.com/rules/BR-Z-05/index.md): fatal. On an invoice line whose VAT category is "Zero rated", the line VAT rate (BT-152) must be 0.
- [BR-Z-06](https://einvoicegoblin.com/rules/BR-Z-06/index.md): fatal. On a document-level allowance whose VAT category is "Zero rated", the allowance VAT rate (BT-96) must be 0.
- [BR-Z-07](https://einvoicegoblin.com/rules/BR-Z-07/index.md): fatal. On a document-level charge whose VAT category is "Zero rated", the charge VAT rate (BT-103) must be 0.
- [BR-Z-08](https://einvoicegoblin.com/rules/BR-Z-08/index.md): fatal. In a VAT breakdown whose category is "Zero rated", the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131) minus document-level allowance amounts (BT-92) plus document-level charge amounts (BT-99), counting only zero-rated lines, allowances, and charges.
- [BR-Z-09](https://einvoicegoblin.com/rules/BR-Z-09/index.md): fatal. In a VAT breakdown whose category is "Zero rated", the VAT category tax amount (BT-117) must equal 0.
- [BR-Z-10](https://einvoicegoblin.com/rules/BR-Z-10/index.md): fatal. A VAT breakdown whose category is "Zero rated" must not include a VAT exemption reason code (BT-121) or a VAT exemption reason text (BT-120).

## Export outside the EU

- [BR-G-01](https://einvoicegoblin.com/rules/BR-G-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Export outside the EU", the VAT breakdown must contain exactly one VAT category code equal with "Export outside the EU".
- [BR-G-02](https://einvoicegoblin.com/rules/BR-G-02/index.md): fatal. If an invoice line uses VAT category "Export outside the EU", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63).
- [BR-G-03](https://einvoicegoblin.com/rules/BR-G-03/index.md): fatal. If a document-level allowance uses VAT category "Export outside the EU", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63).
- [BR-G-04](https://einvoicegoblin.com/rules/BR-G-04/index.md): fatal. If a document-level charge uses VAT category "Export outside the EU", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63).
- [BR-G-05](https://einvoicegoblin.com/rules/BR-G-05/index.md): fatal. On an invoice line whose VAT category is "Export outside the EU", the line VAT rate (BT-152) must be 0.
- [BR-G-06](https://einvoicegoblin.com/rules/BR-G-06/index.md): fatal. On a document-level allowance whose VAT category is "Export outside the EU", the allowance VAT rate (BT-96) must be 0.
- [BR-G-07](https://einvoicegoblin.com/rules/BR-G-07/index.md): fatal. On a document-level charge whose VAT category is "Export outside the EU", the charge VAT rate (BT-103) must be 0.
- [BR-G-08](https://einvoicegoblin.com/rules/BR-G-08/index.md): fatal. In a VAT breakdown whose category is "Export outside the EU", the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131) minus document-level allowance amounts (BT-92) plus document-level charge amounts (BT-99), counting only export lines, allowances, and charges.
- [BR-G-09](https://einvoicegoblin.com/rules/BR-G-09/index.md): fatal. In a VAT breakdown whose category is "Export outside the EU", the VAT category tax amount (BT-117) must be 0.
- [BR-G-10](https://einvoicegoblin.com/rules/BR-G-10/index.md): fatal. A VAT breakdown whose category is "Export outside the EU" must include a VAT exemption reason code (BT-121) that means "Export outside the EU", or the exemption reason text (BT-120) "Export outside the EU" (or the equivalent standard text in another language).

## Intra-community supply

- [BR-IC-01](https://einvoicegoblin.com/rules/BR-IC-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Intra-community supply", the VAT breakdown must contain exactly one VAT category code equal with "Intra-community supply".
- [BR-IC-02](https://einvoicegoblin.com/rules/BR-IC-02/index.md): fatal. If an invoice line uses VAT category "Intra-community supply", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63), and the buyer VAT identifier (BT-48).
- [BR-IC-03](https://einvoicegoblin.com/rules/BR-IC-03/index.md): fatal. If a document-level allowance uses VAT category "Intra-community supply", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63), and the buyer VAT identifier (BT-48).
- [BR-IC-04](https://einvoicegoblin.com/rules/BR-IC-04/index.md): fatal. If a document-level charge uses VAT category "Intra-community supply", the invoice must include the seller VAT identifier (BT-31) or the seller tax representative VAT identifier (BT-63), and the buyer VAT identifier (BT-48).
- [BR-IC-05](https://einvoicegoblin.com/rules/BR-IC-05/index.md): fatal. On an invoice line whose VAT category is "Intracommunity supply", the line VAT rate (BT-152) must be 0.
- [BR-IC-06](https://einvoicegoblin.com/rules/BR-IC-06/index.md): fatal. On a document-level allowance whose VAT category is "Intra-community supply", the allowance VAT rate (BT-96) must be 0.
- [BR-IC-07](https://einvoicegoblin.com/rules/BR-IC-07/index.md): fatal. On a document-level charge whose VAT category is "Intra-community supply", the charge VAT rate (BT-103) must be 0.
- [BR-IC-08](https://einvoicegoblin.com/rules/BR-IC-08/index.md): fatal. In a VAT breakdown whose category is "Intra-community supply", the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131) minus document-level allowance amounts (BT-92) plus document-level charge amounts (BT-99), counting only intra-community lines, allowances, and charges.
- [BR-IC-09](https://einvoicegoblin.com/rules/BR-IC-09/index.md): fatal. In a VAT breakdown whose category is "Intra-community supply", the VAT category tax amount (BT-117) must be 0.
- [BR-IC-10](https://einvoicegoblin.com/rules/BR-IC-10/index.md): fatal. A VAT breakdown whose category is "Intra-community supply" must include a VAT exemption reason code (BT-121) that means "Intra-community supply", or the exemption reason text (BT-120) "Intra-community supply" (or the equivalent standard text in another language).

## Reverse charge

- [BR-AE-01](https://einvoicegoblin.com/rules/BR-AE-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Reverse charge", the VAT breakdown must contain exactly one VAT category code equal to VAT reverse charge.
- [BR-AE-02](https://einvoicegoblin.com/rules/BR-AE-02/index.md): fatal. If an invoice line uses VAT category "Reverse charge", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63), and at least one of the buyer VAT identifier (BT-48) or the buyer legal registration identifier (BT-47).
- [BR-AE-03](https://einvoicegoblin.com/rules/BR-AE-03/index.md): fatal. If a document-level allowance uses VAT category "Reverse charge", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63), and at least one of the buyer VAT identifier (BT-48) or the buyer legal registration identifier (BT-47).
- [BR-AE-04](https://einvoicegoblin.com/rules/BR-AE-04/index.md): fatal. If a document-level charge uses VAT category "Reverse charge", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63), and at least one of the buyer VAT identifier (BT-48) or the buyer legal registration identifier (BT-47).
- [BR-AE-05](https://einvoicegoblin.com/rules/BR-AE-05/index.md): fatal. On an invoice line whose VAT category is "Reverse charge", the line VAT rate (BT-152) must be 0.
- [BR-AE-06](https://einvoicegoblin.com/rules/BR-AE-06/index.md): fatal. On a document-level allowance whose VAT category is "Reverse charge", the allowance VAT rate (BT-96) must be 0.
- [BR-AE-07](https://einvoicegoblin.com/rules/BR-AE-07/index.md): fatal. On a document-level charge whose VAT category is "Reverse charge", the charge VAT rate (BT-103) must be 0.
- [BR-AE-08](https://einvoicegoblin.com/rules/BR-AE-08/index.md): fatal. In a VAT breakdown whose category is "Reverse charge", the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131), minus document-level allowance amounts (BT-92), plus document-level charge amounts (BT-99), counting only lines, allowances, and charges in that same category.
- [BR-AE-09](https://einvoicegoblin.com/rules/BR-AE-09/index.md): fatal. In a VAT breakdown whose category is "Reverse charge", the VAT category tax amount (BT-117) must be 0.
- [BR-AE-10](https://einvoicegoblin.com/rules/BR-AE-10/index.md): fatal. A VAT breakdown whose category is "Reverse charge" must include a VAT exemption reason code (BT-121) that means reverse charge, or the exemption reason text (BT-120) "Reverse charge" (or the equivalent standard text in another language).

## Exemption

- [BR-E-01](https://einvoicegoblin.com/rules/BR-E-01/index.md): fatal. If a line, a document allowance, or a document charge uses the VAT category "Exempt from VAT", the invoice must contain exactly one VAT breakdown with that same category.
- [BR-E-02](https://einvoicegoblin.com/rules/BR-E-02/index.md): fatal. If an invoice line uses VAT category "Exempt from VAT", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-E-03](https://einvoicegoblin.com/rules/BR-E-03/index.md): fatal. If a document-level allowance uses VAT category "Exempt from VAT", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-E-04](https://einvoicegoblin.com/rules/BR-E-04/index.md): fatal. If a document-level charge uses VAT category "Exempt from VAT", the invoice must include at least one of the seller VAT identifier (BT-31), the seller tax registration identifier (BT-32), or the seller tax representative VAT identifier (BT-63).
- [BR-E-05](https://einvoicegoblin.com/rules/BR-E-05/index.md): fatal. On an invoice line whose VAT category is "Exempt from VAT", the line VAT rate (BT-152) must be 0.
- [BR-E-06](https://einvoicegoblin.com/rules/BR-E-06/index.md): fatal. On a document-level allowance whose VAT category is "Exempt from VAT", the allowance VAT rate (BT-96) must be 0.
- [BR-E-07](https://einvoicegoblin.com/rules/BR-E-07/index.md): fatal. On a document-level charge whose VAT category is "Exempt from VAT", the charge VAT rate (BT-103) must be 0.
- [BR-E-08](https://einvoicegoblin.com/rules/BR-E-08/index.md): fatal. In a VAT breakdown whose category is "Exempt from VAT", the taxable amount (BT-116) must equal the sum of invoice line net amounts (BT-131), minus document-level allowance amounts (BT-92), plus document-level charge amounts (BT-99), counting only lines, allowances, and charges in that same category.
- [BR-E-09](https://einvoicegoblin.com/rules/BR-E-09/index.md): fatal. In a VAT breakdown whose category is "Exempt from VAT", the VAT category tax amount (BT-117) must equal 0.
- [BR-E-10](https://einvoicegoblin.com/rules/BR-E-10/index.md): fatal. A VAT breakdown whose category is "Exempt from VAT" must include a VAT exemption reason code (BT-121) or a VAT exemption reason text (BT-120).

## Optional

- [Rule index JSON](https://einvoicegoblin.com/rules/index.json): The same 68 rules as JSON.
- [OpenAPI](https://einvoicegoblin.com/openapi.json): GET /rules/index.json, GET /rules/{id}.json, and GET /bt-map.json. No check route and no UBL route.
- [MCP server card](https://einvoicegoblin.com/.well-known/mcp/server-card.json): Names those three GETs. It lists no tool.
- [Skill](https://einvoicegoblin.com/skills/SKILL.md): How an agent reads those three URLs.
- [Field map](https://einvoicegoblin.com/bt-map.json): Which boxes on the free invoice form match one EN 16931 term. No VAT category code is assigned.
- [Invoice page](https://einvoicegoblin.com/): The free browser form. It does not emit UBL.
- [Privacy](https://einvoicegoblin.com/privacy.html): What this site stores. There is no checkout.
