es-tbai-v1
Module: github.com/invopop/gobl
Correction Definitions
Auto-generation of corrective invoices or credit and debit notes is supported.Extension Keys
One or all of the following extensions may be required as part of the correction options. See the Extensions section for possible values.es-tbai-correction
Extensions
TicketBAI Region Code
Region codes are used by TicketBAI to differentiate between the different subdivisions of the Basque Country. This is used to determine the correct API endpoint to use when submitting documents.es-tbai-region
es-tbai-region
| Code | Name |
|---|---|
VI | Araba |
BI | Bizkaia |
SS | Gipuzkoa |
TicketBAI Product Key
Product keys are used by TicketBAI to differentiate between -exported- goods and services. It may be useful to classify all products regardless of wether they are exported or not. There is an additional exception case for goods that are resold without modification when the supplier is in the simplified tax regime. For must purposes this special case can be ignored. If no product key is provided, the default is “services”.es-tbai-product
es-tbai-product
| Code | Name |
|---|---|
goods | Delivery of goods |
services | Provision of services |
resale | Resale of goods without modification by vendor in the simplified regime |
TicketBAI Exemption code
Codes used by TicketBAI for both “exempt”, “not-subject”, and reverse charge transactions. In the TicketBAI format these are separated, but in order to simplify GOBL and be more closely aligned with other countries we’ve combined them into one. The follow mappings will be made automatically by GOBL during normalization.| Tax Key | Exemption Codes |
|---|---|
exempt | E1 (default), E6 |
export | E2 (default), E3, E4 |
intra-community | E5 |
reverse-charge | S2 |
outside-scope | OT, RL, VT, IE |
es-tbai-exemption
es-tbai-exemption
| Code | Name |
|---|---|
E1 | Exempt: pursuant to Article 20 of the Foral VAT Law |
E2 | Exempt: pursuant to Article 21 of the Foral VAT Law |
E3 | Exempt: pursuant to Article 22 of the Foral VAT Law |
E4 | Exempt: pursuant to Articles 23 and 24 of the Foral VAT Law |
E5 | Exempt: pursuant to Article 25 of the Foral VAT law |
E6 | Exempt: pursuant to other reasons |
OT | Not subject: pursuant to Article 7 of the VAT Law - other cases of non-subject |
RL | Not subject: pursuant to localization rules |
VT | Not subject: sales made on behalf of third parties (amount not computable for VAT or IRPF purposes) |
IE | Not subject in the TAI due to localization rules, but foreign tax, IPS/IGIC or VAT from another EU member state is passed on |
S2 | Subject and not exempt: with reverse charge |
TicketBAI Rectification Type Code
Corrected or rectified invoices that need to be sent in the TicketBAI format require a specific type code to be defined alongside the preceding invoice data.es-tbai-correction
es-tbai-correction
| Code | Name |
|---|---|
R1 | Rectified invoice: error based on law and Article 80 One, Two and Six of the Provincial Tax Law of VAT |
R2 | Rectified invoice: error based on law and Article 80 Three of the Provincial Tax Law of VAT |
R3 | Rectified invoice: error based on law and Article 80 Four of the Provincial Tax Law of VAT |
R4 | Rectified invoice: Other |
R5 | Rectified invoice: simplified invoices |
TicketBAI VAT Regime Key
Identifies the VAT regime or operation classification applied to the transaction. Maps to theClaveRegimenIvaOpTrascendencia field, with
values taken from the TicketBAI XSD.
The regime code is normally assigned per tax combo. If no regime code
is provided, GOBL will try to assign a code from the following contexts:
| Combo Context | Regime Code |
|---|---|
Category IGIC | 08 |
Key export | 02 |
| Has surcharge | 51 |
| Otherwise | 01 |
es-tbai-regime
es-tbai-regime
| Code | Name |
|---|---|
01 | General regime operation |
02 | Export |
03 | Special regime for used goods, art objects, antiques and collectibles |
04 | Special regime for investment gold |
05 | Special regime for travel agencies |
06 | Special regime for VAT groups (Advanced Level) |
07 | Special cash accounting regime |
08 | Operations subject to IPSI/IGIC |
09 | Billing of travel agency services acting as mediators in name and on behalf of others |
10 | Collection of professional fees or industrial property rights on behalf of third parties |
11 | Business premises rental operations subject to withholding |
12 | Business premises rental operations not subject to withholding |
13 | Business premises rental operations, both subject and not subject to withholding |
14 | Invoice with pending VAT accrual in work certifications for Public Administration |
15 | Invoice with pending VAT accrual in successive tract operations |
17 | Operation under OSS or IOSS regimes |
51 | Operations under the equivalence surcharge regime |
52 | Operations under the simplified VAT regime |
53 | Operations carried out by or for entities without a permanent establishment |
Activity Code (Bizkaia)
Economic activity code (epígrafe) for individual issuers submitting through Bizkaia’s LROE Modelo 140 register. Not required for organisations, who file through Modelo 240.es-tbai-bi-activity
es-tbai-bi-activity
Pattern:
^\d{1,7}$Identity Type Code
Identity code used to identify the type of identity document used by the customer when there is no tax identifier available. Maps to theIDType value under
IDOtro in the TicketBAI XML.
The regular Party Tax Identity is preferred over using a specific identity type
code, and will be mapped automatically as follows:
- Spanish Tax IDs will be mapped to the
NIFfield. - EU Tax IDs will be mapped to the
IDOtrofield with code02. - Non-EU Tax IDs will be mapped to the
IDOtrofield with code04.
key values will be mapped automatically to an extension
by the addon:
| Identity Key | Extension Code |
|---|---|
passport | 03 |
foreign | 04 |
resident | 05 |
other | 06 |
es-tbai-identity-type
es-tbai-identity-type
| Code | Name |
|---|---|
02 | NIF-VAT Identity (VIES) |
03 | Passport |
04 | Foreign Identity Document |
05 | Residential Certificate |
06 | Other Identity Document |
TicketBAI Simplified Invoice Flag
Flag that maps to theFacturaSimplificada field in TicketBAI
documents. Set automatically to S by GOBL during normalization
when the simplified tag is present. When absent, the invoice is
treated as N (not simplified).
es-tbai-simplified
es-tbai-simplified
| Code | Name |
|---|---|
S | Yes |
N | No |
Validation Rules
bill.Invoice
bill.Invoice
| Field | Test | Validation Code / Message |
|---|---|---|
| Invoice |
| GOBL-ES-TBAI-BILL-INVOICE-09Invoice must be in EUR or provide exchange rate for conversion |
tax |
| GOBL-ES-TBAI-BILL-INVOICE-01Invoice tax is required |
tax.ext |
| GOBL-ES-TBAI-BILL-INVOICE-02Invoice tax extension ‘es-tbai-region’ is required |
customer |
| GOBL-ES-TBAI-BILL-INVOICE-03Invoice customer is required for non-simplified invoices |
customer |
| GOBL-ES-TBAI-BILL-INVOICE-08Invoice customer must have a tax_id or an identity with ext ‘es-tbai-identity-type’ |
preceding |
| GOBL-ES-TBAI-BILL-INVOICE-04Invoice preceding documents are required for credit-note, corrective, debit-note invoices |
preceding[*].issue_date |
| GOBL-ES-TBAI-BILL-INVOICE-05Invoice preceding issue date is required |
preceding[*].ext |
| GOBL-ES-TBAI-BILL-INVOICE-06Invoice preceding ext ‘es-tbai-correction’ is required |
notes |
| GOBL-ES-TBAI-BILL-INVOICE-07Invoice must have a note with key ‘general’ |
supplier.ext |
| GOBL-ES-TBAI-BILL-INVOICE-10Invoice supplier extension ‘es-tbai-bi-activity’ is required for Bizkaia individuals |
supplier.ext |
| GOBL-ES-TBAI-BILL-INVOICE-11Invoice supplier extension ‘es-tbai-bi-activity’ must be a valid Bizkaia activity code (epígrafe) |
tax.Combo
tax.Combo
| Field | Test | Validation Code / Message |
|---|---|---|
ext |
| GOBL-ES-TBAI-TAX-COMBO-01Extension ‘es-tbai-exemption’ is required for exempt tax combos |