Automation MCP Server Blog Pricing

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.

The seven codes at a glance

These are the codes the InvoiceXML create API accepts in lines[].vatInformation.categoryCode, vatBreakdowns[].categoryCode and the vatCategoryCode of allowances and charges. Each code has its own page with business cases, a request example and the common mistakes.

Code Meaning When to use it Rate Required fields
S Standard rated Ordinary taxable sales where you charge VAT at a normal or reduced rate. Above 0, the national rate (for example 19 or 7) Seller VAT ID (BT-31) or tax registration ID (BT-32)
Z Zero rated Supplies your country taxes at a rate of 0%, with the right to deduct input VAT. 0 Seller VAT ID (BT-31) or tax registration ID (BT-32)
E Exempt from VAT Supplies the law exempts from VAT: medical, education, insurance, finance, small-business schemes. 0 Seller VAT ID (BT-31) or tax registration ID (BT-32), plus an exemption reason you supply
AE Reverse charge The buyer owes the VAT: B2B services to another EU country and domestic reverse charge. 0 Seller VAT ID (BT-31) or tax registration ID (BT-32), and buyer VAT ID (BT-48) or legal registration ID (BT-47)
K Intra-community supply Goods shipped to a VAT-registered business in another EU member state. 0 Seller VAT ID (BT-31), buyer VAT ID (BT-48), delivery date (BT-72) or invoicing period (BG-14), deliver-to country (BT-80)
G Export outside the EU Goods exported to a customer outside the European Union. 0 Seller VAT ID (BT-31)
O Not subject to VAT Transactions outside the scope of VAT, issued without any VAT ID on the invoice. None: leave the rate out No seller or buyer VAT ID; another seller identifier instead, and no other category on the invoice

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.

  1. 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.
  2. Do you ship goods to a VAT-registered business in another EU member state? Use K.
  3. Do the goods leave the EU? Use G.
  4. 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.
  5. Does a law exempt the supply from VAT? This covers medical care, education, insurance, financial services and small-business schemes. Use E.
  6. Does your country tax the supply at 0%? Use Z.
  7. 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.

Frequently Asked Questions

Is the code O the letter or the number zero?

The letter O, for "not subject to VAT". There is no category code 0. A zero rate is expressed by the code Z (zero rated) or by one of the other codes with a rate of 0, never by a code made of digits.

I ship goods to EU and non-EU customers and I am VAT registered. Which code do I use?

K for goods delivered to a VAT-registered business in another EU member state, G for goods exported outside the EU. Not O: O forbids the seller's VAT ID on the invoice, so a VAT-registered seller fails BR-O-02 with it.

What is the difference between K and AE?

Both shift the VAT to the buyer in another member state, but K is the intra-community supply of goods and requires the delivery date and the deliver-to country (BR-IC-11, BR-IC-12). Cross-border B2B services and domestic reverse charge cases are invoiced as AE.

Can one invoice use several categories?

Yes. An invoice may combine S at two rates with Z, E, AE, K or G, and the VAT breakdown gets one group per category and rate. The exception is O: an invoice with an O breakdown may not contain any other category (BR-O-11 to BR-O-14).

Do I have to send the exemption reason myself?

Only for E. For AE, K, G and O the InvoiceXML API adds the standard VATEX code and reason text when you leave them out. Exempt supplies rest on many different legal bases, so the reason for E always comes from you. S and Z must not carry a reason at all.