Tax classification per line
Set exemption_reason on each line correctly. Includes the full mapping from BeeL API values to AEAT codes (S1/S2/N1/N2/E1–E6).
Every line carries an optional exemption_reason that tells AEAT how the operation is classified for IVA purposes. The BeeL API uses descriptive enum values (EXENTA_ART_25, NO_SUJETA_LOCALIZACION, ISP_ART_84_2_A, etc.); BeeL translates those to the AEAT codes (E5, N2, S2) before submission.
If you leave exemption_reason unset, BeeL classifies the line as sujeta y no exenta (S1) with the IVA rate you set in main_tax.percentage.
Allowed main_tax.percentage values
The VatPercentage enum accepts five values:
| Value | Rate name | Notes |
|---|---|---|
0 | Exempt | Use together with an exemption_reason (see below) |
4 | Super-reduced | Basic food, books, medicines |
5 | RD-ley 11/2022 temporary reduced | Olive and seed oils, pasta |
10 | Reduced | Hospitality, transport, most foods |
21 | Standard | Default for goods and services |
The 5 % rate was added by RD-ley 11/2022 and is currently extended; it pairs with a 0.625 % recargo de equivalencia (see Equivalence surcharge). For IGIC/IPSI lines, use main_tax.type: "IGIC" or "IPSI" — those carry their own rate enum.
The four families
Operation is …
│
┌─────────────────────┼─────────────────────┐
subject to IVA not subject to IVA exempt from IVA
(sujeta) (no sujeta) (exenta)
│ │ │
┌────┴────┐ │ │
S1 S2 N1 or N2 E1, E2, E3, E4, E5, E6
normal ISP (location / (legal exemption)
general rules)Mapping table: BeeL API value ↔ AEAT code
| AEAT code | BeeL exemption_reason value | When to use |
|---|---|---|
| S1 (default) | omit the field | Default — subject to IVA, normal seller-collects |
| S2 | ISP_ART_84_2_A / ISP_ART_84_2_E / ISP_ART_84_2_F | ISP — buyer self-assesses the IVA (3 LIVA articles depending on cause) |
| N1 | NO_SUJETA_ART_7_9 | Not subject by general rules (internal transfers, etc.) |
| N2 | NO_SUJETA_LOCALIZACION | Operation localised outside Spain (intra-EU services, services to non-EU) |
| E1 | EXENTA_ART_20 | Educational, medical, social, insurance, residential rental |
| E2 | EXENTA_ART_21 | Exports of goods to non-EU territories |
| E3 | EXENTA_ART_22 | International transport, customs zone operations |
| E4 | EXENTA_ART_24 | Bonded warehouse operations |
| E5 | EXENTA_ART_25 | Intra-EU sales of goods to a business with valid VIES VAT-ID |
| E6 | EXENTA_ART_26 | Other LIVA exemptions (Art. 26) |
| (special) | EXENTA_ART_140 | Specific cases under Art. 140 LIVA |
| (special regimes) | REGIMEN_ART_129 / REGIMEN_ART_135 / REGIMEN_ART_141 / REGIMEN_ART_154 / REGIMEN_ART_163_DECIES | Special LIVA regimes — should set the matching regime_key, not be reported as exempt |
| (other) | OTRO | Any other case not covered above |
When in doubt between NO_SUJETA_LOCALIZACION (N2) and EXENTA_ART_25 (E5) for intra-EU operations, the rule is simple: bienes → E5, servicios → N2. See International customers.
How you set it in the API
The exemption_reason lives directly on each line. There's also an optional exemption_reason_text to add free-text context.
B2B intra-EU services (N2)
{
"lines": [
{
"description": "Consulting services to EU business",
"quantity": 1,
"unit": "service",
"unit_price": 1000,
"discount_percentage": 0,
"main_tax": { "type": "IVA", "percentage": 0, "regime_key": "01" },
"exemption_reason": "NO_SUJETA_LOCALIZACION",
"exemption_reason_text": "Operation not subject to Spanish VAT under Art. 69 LIVA"
}
]
}B2B intra-EU goods (E5)
{
"lines": [
{
"description": "Hardware supply to EU customer",
"quantity": 1,
"unit": "unit",
"unit_price": 1000,
"discount_percentage": 0,
"main_tax": { "type": "IVA", "percentage": 0, "regime_key": "01" },
"exemption_reason": "EXENTA_ART_25"
}
]
}Inversión del sujeto pasivo (S2)
{
"lines": [
{
"description": "Construction services subject to reverse charge",
"quantity": 1,
"unit": "project",
"unit_price": 1000,
"discount_percentage": 0,
"main_tax": { "type": "IVA", "percentage": 0, "regime_key": "01" },
"exemption_reason": "ISP_ART_84_2_F"
}
]
}Pick the right ISP article — _A, _E, or _F — based on the specific scenario in Art. 84.2 LIVA.
Exempt educational service (E1)
{
"lines": [
{
"description": "Training course",
"quantity": 1,
"unit": "course",
"unit_price": 500,
"discount_percentage": 0,
"main_tax": { "type": "IVA", "percentage": 0, "regime_key": "01" },
"exemption_reason": "EXENTA_ART_20"
}
]
}Rules BeeL enforces
| Rule | What happens if you break it |
|---|---|
If exemption_reason is set, main_tax.percentage must be 0 and equivalence_surcharge_rate must not be set | Rejected at issuance |
EXENTA_ART_25 (E5) requires the customer to have an alternative_id of type NIF_IVA | Rejected — E5 is reserved for intra-EU B2B with VAT-ID |
EXENTA_ART_21 (E2) typically pairs with regime_key: 02 (exportación) — BeeL doesn't auto-set it | Warning only |
ISP_* cannot pair with equivalence_surcharge_rate | Rejected — ISP forbids surcharge |
Default (no exemption_reason) requires main_tax.percentage > 0 | Otherwise BeeL doesn't know how to classify a 0 % subject line |
Decision tree
Where is the customer?
├─ In Spain
│ ├─ Operation is subject to IVA?
│ │ ├─ Yes, normal seller-collects-IVA → omit exemption_reason (S1)
│ │ ├─ Yes, ISP applies → ISP_ART_84_2_A / _E / _F (S2)
│ │ └─ Yes, but exempted by law → EXENTA_ART_20 ... 26 (E1–E6)
│ └─ Not subject (out-of-scope op) → NO_SUJETA_ART_7_9 (N1)
│
├─ EU country (intra-community)
│ ├─ Customer is B2B with VIES VAT-ID
│ │ ├─ Selling goods → EXENTA_ART_25 (E5)
│ │ └─ Selling services → NO_SUJETA_LOCALIZACION (N2)
│ └─ Customer is B2C (no VIES)
│ ├─ Under 10 000 € OSS threshold → omit (S1) — apply Spanish IVA
│ └─ Over OSS threshold → NO_SUJETA_LOCALIZACION + main_tax.regime_key="17"
│
└─ Non-EU
├─ Selling goods (export) → EXENTA_ART_21 + main_tax.regime_key="02"
└─ Selling services → NO_SUJETA_LOCALIZACIONThe full payload examples for each path live in International customers.
Related
- International customers — every B2B/B2C scenario in full
- Regime keys — when
main_tax.regime_keyis required alongside the classification - Equivalence surcharge — incompatible with ISP and exempt lines
- createInvoice API reference — full line schema