VAT category codes
Every invoice line, discount, charge and VAT breakdown in an EN 16931 e-invoice carries a VAT category code from the UNCL5305 list. The code decides which rate is allowed, which identifiers must be present and whether the invoice needs an exemption reason. Picking the wrong one is the most common cause of VAT findings in cross-border invoicing.
Two more codes exist for territories with their own indirect tax: L for the Canary Islands general indirect tax (IGIC) and M for the tax on production, services and imports in Ceuta and Melilla (IPSI). Each carries the rate of that local tax, and both only apply to sellers in those territories.
How to pick the right code
Answer these questions in order. The first yes gives you the code.
- Is the whole transaction outside the VAT system, with no VAT ID on either side? Use O. If you have a VAT ID, the answer is no.
- Do you ship goods to a VAT-registered business in another EU member state? Use K.
- Do the goods leave the EU? Use G.
- Does the buyer owe the VAT instead of you? This covers B2B services to another EU country and domestic reverse charge (construction work, scrap metal and similar). Use AE.
- Does a law exempt the supply from VAT? This covers medical care, education, insurance, financial services and small-business schemes. Use E.
- Does your country tax the supply at 0%? Use Z.
- Otherwise you charge VAT: use S with your rate.
O is a letter, not a zero
The code for "not subject to VAT" is the capital letter O. In many fonts it looks like the digit 0, and it is easy to read it as "zero VAT". It means something very different: the transaction is outside the scope of VAT, and the rules for O forbid the VAT IDs of both parties. A zero rate is never written as a category. It is the code Z, or a rate of 0 next to E, AE, K or G.
Where the code goes in a create request
Every line states its category in vatInformation. Document level allowances and charges carry their own category and rate. The API builds the VAT breakdown from these, one group per category and rate, and adds the standard exemption reason for AE, K, G and O:
"lines": [
{
"item": { "name": "Consulting, March" },
"quantity": 10,
"unitCode": "HUR",
"priceDetails": { "netPrice": 120.00 },
"vatInformation": { "categoryCode": "AE", "rate": 0 }
}
],
"charges": [
{ "amount": 15.00, "reason": "Travel costs", "vatCategoryCode": "AE", "vatRate": 0 }
]
To word the reason yourself, send a vatBreakdowns entry with only the category and the reason. The amounts are still calculated from the lines:
"vatBreakdowns": [
{ "categoryCode": "AE", "exemptionReasonText": "Reverse charge, Article 196 of Directive 2006/112/EC" }
]
Rules every category shares
Each code has a family of ten or more business rules with the same numbering: -01 demands a matching VAT breakdown group, -02 to -04 set the identifiers, -05 to -07 pin the rates of lines, allowances and charges, -08 ties the taxable amount to the lines, -09 fixes the tax amount and -10 covers the exemption reason. On top of that, the totals rules apply to every invoice:
- BR-CO-14, the invoice VAT total equals the sum of the breakdown tax amounts
- BR-CO-17, each breakdown's tax amount equals taxable amount times rate
- BR-CO-15, the total with VAT equals the total without VAT plus the VAT total
Invoices created with POST /v1/create/ubl, POST /v1/create/facturx and the other create endpoints compute these amounts for you and are validated against the full rule set before they are returned.