TicketBAI — Basque Country (Bizkaia, Gipuzkoa, Araba)
The three Basque foral territories pre-empted Spain on invoice anti-fraud traceability: TicketBAI (TBAI) has imposed since 2022-2024, depending on territory, an SHA-256 hash chain signed with XAdES and a public-verification QR code on every invoice, transmitted in real time to the Hacienda Foral.
Origin: 3 foral territories, 1 converging system
Under the Concierto Economico of 1981, the Basque Country holds its own fiscal autonomy: the Diputaciones of Bizkaia, Gipuzkoa and Araba collect every direct and indirect tax in their territory and remit a partial "cupo" to the Spanish State. This autonomy let each territory pre-empt national legislation on tax digitalisation.
# Three foral territories of the Basque Country
# Each diputacion runs its own service but the TBAI XML format is shared
Bizkaia (Biscay, BFA / Bizkaiko Foru Aldundia)
- Application: BATUZ (TicketBAI + LROE Libro Registro de Operaciones Economicas)
- Service URL: www.batuz.eus
- Universal go-live: 1 January 2024 (after gradual rollout since 2022)
- Specific feature: integrated LROE, two-way tracking (emission AND reception)
Gipuzkoa (Guipuzcoa, GFA / Gipuzkoako Foru Aldundia)
- Application: TicketBAI Gipuzkoa
- Service URL: www.gipuzkoa.eus/tbai
- Universal go-live: 1 January 2024
- Specific feature: two modes — direct send or nightly batch
Araba (Alava, AFA / Arabako Foru Aldundia)
- Application: TicketBAI Araba
- Service URL: web.araba.eus/es/tbai
- Universal go-live: 1 January 2024
- Specific feature: consolidated portal with cross-links to Bizkaia/Gipuzkoa
for taxpayers active in multiple territories The three territories rolled out TicketBAI at slightly different paces (Bizkaia leading the way in 2022 as BATUZ), but with a common XML format and identical cryptographic rules. This convergence was sealed by the joint Orden Foral of the three diputaciones in 2020.
The TBAI chain: SHA-256 and XAdES
The TicketBAI XML follows its own XSD schema — distinct from the Spanish Facturae and EN 16931 — designed for technical traceability of the invoice rather than its commercial content. Each XML carries:
- Issuer taxpayer identification (NIF, legal name).
- Invoice data (series, number, date, total amount — without line-level detail, which is carried by the accompanying commercial format).
- Encadenamiento (chaining) with the previous invoice: series, number, date and SignatureValue of the previous invoice.
- Software identification (TBAI licence number issued by the Hacienda Foral, developer NIF, name, version).
- A XAdES-EPES signature (XML Advanced Electronic Signature - Explicit Policy Electronic Signature) backed by a qualified eIDAS certificate of the taxpayer with qualified timestamp.
<?xml version="1.0" encoding="UTF-8"?>
<T:TicketBai xmlns:T="urn:ticketbai:emision"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<Cabecera>
<IDVersionTBAI>1.2</IDVersionTBAI>
</Cabecera>
<Sujetos>
<Emisor>
<NIF>B12345678</NIF>
<ApellidosNombreRazonSocial>Atelier Donostia SL</ApellidosNombreRazonSocial>
</Emisor>
<Destinatarios>
<IDDestinatario>
<NIF>B87654321</NIF>
<ApellidosNombreRazonSocial>Cooperativa Vitoria SCoop</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>
</Sujetos>
<Factura>
<CabeceraFactura>
<SerieFactura>T-2026</SerieFactura>
<NumFactura>00042</NumFactura>
<FechaExpedicionFactura>20-04-2026</FechaExpedicionFactura>
</CabeceraFactura>
<DatosFactura>
<ImporteTotalFactura>1210.00</ImporteTotalFactura>
</DatosFactura>
</Factura>
<HuellaTBAI>
<EncadenamientoFacturaAnterior>
<SerieFacturaAnterior>T-2026</SerieFacturaAnterior>
<NumFacturaAnterior>00041</NumFacturaAnterior>
<FechaExpedicionFacturaAnterior>19-04-2026</FechaExpedicionFacturaAnterior>
<SignatureValueFirmaFacturaAnterior>9C1185...</SignatureValueFirmaFacturaAnterior>
</EncadenamientoFacturaAnterior>
<Software>
<LicenciaTBAI>BI-X-99999-2025</LicenciaTBAI>
<EntidadDesarrolladora>
<NIF>A99999999</NIF>
</EntidadDesarrolladora>
<Nombre>Atelier ERP</Nombre>
<Version>4.7.2</Version>
</Software>
</HuellaTBAI>
<ds:Signature>
<!-- XAdES-EPES signature with timestamp -->
</ds:Signature>
</T:TicketBai> The TicketBAI QR: public verification
Every TicketBAI-compliant invoice must carry a visible QR code encoding the public verification URL of the competent diputacion. The specification is highly prescriptive: minimum size, error correction, "TBAI" caption visible beneath the QR.
# TicketBAI QR specification (Hacienda Foral)
# Encoded URL format depending on the territory:
# Bizkaia
https://batuz.eus/QRTBAI?id=TBAI-B12345678-200426-000042-9C1185&cr=07
# Gipuzkoa
https://tbai.prep.gipuzkoa.eus/qr/?id=TBAI-B12345678-200426-000042-9C1185&cr=07
# Araba (Alava)
https://ticketbai.araba.eus/tbai/qrcode/?id=TBAI-B12345678-200426-000042-9C1185&cr=07
# TBAI ID format:
# TBAI-<issuer-NIF>-<DDMMYY>-<invoice-number>-<5-char-prefix-of-XAdES-hash>
# cr (control redundancy) format:
# 2 Luhn modulo 16 digits, validated server-side
The QR points to three distinct URLs depending on the territory —
each diputacion runs its own verification service — but the format
of the TBAI identifier is common:
TBAI-NIF-date-number-hash5. For cross-territory
taxpayers, scanning the QR redirects to the competent diputacion.
Reception by the Hacienda Foral
Two transmission modes are available depending on taxpayer size:
- Online mode (real-time) — the signed XML is transmitted to the diputacion within minutes of invoice emission, through a SOAP web service authenticated by qualified certificate. Mandatory above a turnover threshold.
- Offline mode (daily batch) — XMLs are accumulated locally and transmitted as a batch within 24 hours of emission. Reserved for activities without permanent connectivity (taxis, market stalls, certain itinerant activities).
The SOAP API returns immediately an acknowledgement
(AcuseRecibo) containing:
- The definitive TBAI identifier
- The reception timestamp on the Hacienda side
- The status:
Correcto,Anulado, or rejection with an error code
BATUZ and LROE integration in Bizkaia
The Diputacion of Bizkaia went further than its neighbours by creating the BATUZ regime: the combination of TicketBAI (emission) and the Libro Registro de Operaciones Economicas (LROE) — the quarterly detailed bookkeeping register of economic operations.
BATUZ therefore adds:
- LROE Modelo 140 — for autonomos (self-employed): quarterly declaration of own-account operations.
- LROE Modelo 240 — for companies: more detailed quarterly declaration, including sales, purchases, intracommunity operations and operations with tax havens.
The combination TicketBAI + LROE lets the Hacienda Foral of Bizkaia fully pre-fill quarterly VAT returns (modelo 303 and 390) for BATUZ-enrolled taxable persons. This regime does not (yet) exist in Gipuzkoa and Araba, which stick to TicketBAI alone.
Basque-specific penalties
The TicketBAI penalty regime is carried by each territory's Normas Forales (Bizkaia: NF 5/2020, Gipuzkoa: NF 1/2020, Araba: NF 11/2020). It is stricter than the national regime:
- Software without TBAI licence: 2% of the vendor's annual turnover in the Basque Country, capped at EUR 20,000 per product, repeated each year.
- Issuance without QR or with broken chain: 1% of the taxpayer's annual turnover, with a floor of EUR 3,000 and a cap of EUR 20,000 per fiscal year.
- Cryptographic chain tampering: 150% of the altered invoice amounts, plus criminal action (forgery, tax fraud) under article 305 of the Spanish Penal Code.
Cross-links
- Spain hub — full e-invoicing mandate overview
- Verifactu — national equivalent outside the Basque Country
- SII — AEAT near-real-time VAT books
- Facturae — commercial format alongside TBAI
- BATUZ — Bizkaia Hacienda Foral portal
- Hacienda Foral de Gipuzkoa — TicketBAI
- Hacienda Foral de Araba
- TicketBAI.eus — shared portal