E-invoicing in Spain: A Complete Guide for Businesses

What is Spain e-invoicing?

Spain operates a real-time invoice clearance model under the VERI*FACTU regime, introduced via Royal Decree 1007/2023 (published October 2023). The regulation targets software systems that generate invoices — any application producing commercial invoices in Spain must comply with the technical requirements of the Reglamento de facturación, which mandates that invoices be registered with AEAT (Agencia Tributaria) in real time or near-real time.

The obligation does not apply to the invoice recipient; it applies to the invoicing software itself. Software vendors and ERP providers must certify their systems as VERI*FACTU-compliant by 29 July 2025 for large businesses and companies under the Immediate Supply of Information (SII) regime, and by 1 January 2026 for all other taxpayers.

Separately, the Basque Country and Navarra operate the TicketBAI system, a regional equivalent with similar technical requirements but different submission endpoints.

The VeriFactu format

VERI*FACTU invoices are structured XML documents submitted directly to AEAT's web services. Key technical characteristics:

SII taxpayers (businesses with turnover > EUR 6M) already report invoice data within 4 days; VeriFactu extends this to all invoice-generating software.

Who does it apply to?

Segment Status
Businesses under SII regime (>EUR 6M turnover) Mandatory from 29 Jul 2025
All other businesses issuing invoices Mandatory from 1 Jan 2026
Basque Country / Navarra TicketBAI (regional equivalent, already live)
Invoice recipients No obligation

The mandate is on the invoicing software, not the legal entity type. A small business using compliant software automatically satisfies the requirement.

Timeline / key dates

How Clearvo handles Spain e-invoicing

Clearvo handles the full VeriFactu submission lifecycle: generating the AEAT-compliant XML, computing the SHA-256 hash chain, signing the request with the required certificate, submitting to AEAT's RegistroFacturacion endpoint, and returning the AEAT acceptance response.

You send a single CustomerInvoiceInput JSON. Clearvo handles format generation, hash chain maintenance (we store the previous invoice hash per NIF/series), QR code generation, and retry logic for AEAT connectivity issues.

What you send: standard invoice fields plus supplierVatNumber (NIF), invoiceSeries, and buyerCountry: "ES".

What you get back: the AEAT CSV (Código Seguro de Verificación), the generated XML, and QR code data URI.

{
  "invoiceNumber": "A-2025-00089",
  "invoiceSeries": "A",
  "issueDate": "2025-07-30",
  "issueTime": "10:42:00",
  "dueDate": "2025-08-29",
  "currency": "EUR",
  "supplier": {
    "name": "Acme Software SL",
    "vatNumber": "B87654321",
    "address": {
      "street": "Calle Gran Vía 28",
      "city": "Madrid",
      "postalCode": "28013",
      "country": "ES"
    }
  },
  "customer": {
    "name": "Distribuidora Ibérica SA",
    "vatNumber": "A12345678",
    "address": {
      "street": "Avinguda Diagonal 200",
      "city": "Barcelona",
      "postalCode": "08018",
      "country": "ES"
    }
  },
  "lines": [
    {
      "description": "Consultoría tecnológica — julio 2025",
      "quantity": 10,
      "unitPrice": 850.00,
      "taxRate": 21,
      "taxCategory": "S"
    }
  ],
  "paymentMethod": "transferencia"
}

Getting started

Full VeriFactu integration documentation, including certificate setup and the AEAT test environment endpoints, is at clearvo.io/docs. The Clearvo API handles AEAT sandbox and production environments via an environment parameter — no separate integration required for testing.

Related country guides

Frequently asked questions

When did VeriFactu become mandatory? VeriFactu became mandatory from 29 July 2025 for businesses under the Immediate Supply of Information (SII) regime — those with annual turnover above EUR 6 million. All other businesses issuing invoices must comply from 1 January 2026. The obligation is on invoicing software, not on the invoice recipient.

What is the hash chain in VeriFactu? Each VeriFactu XML record contains a SHA-256 hash of the previous invoice in the same series for the same NIF. This creates a tamper-evident chain — if any earlier invoice record is altered, the chain breaks and AEAT detects the discrepancy. You cannot reorder, delete, or modify submitted invoice records without breaking the chain.

Does TicketBAI satisfy the VeriFactu requirement? No. TicketBAI is a regional scheme operated by the Basque Country (Bizkaia, Gipuzkoa, Araba) and Navarra under their own foral tax regimes. If your business is subject to common-territory Spanish tax law, TicketBAI compliance does not substitute for VeriFactu. Businesses operating in both foral and common territories must comply with both.

What certificate is needed to submit to AEAT? VeriFactu submissions must be signed with a qualified electronic certificate issued to the legal entity — typically an FNMT Certificado de Representante or equivalent eIDAS certificate. The certificate authenticates the software provider or the taxpayer submitting to AEAT's RegistroFacturacion endpoint. Clearvo uses its own certified signing infrastructure; you do not need to supply a certificate separately.

How do I test in the AEAT sandbox? AEAT provides a pre-production endpoint for VeriFactu testing. In the Clearvo API, pass "environment": "sandbox" in your request to route submissions to the AEAT test environment. Test credentials and endpoint details are documented at clearvo.io/docs.

Ready to handle e-invoicing in Spain?

One API, all 32 countries. Sign up and get your production API key instantly — no sales call required.

Get started free →