Mandatory B2B e-invoicing in Spain: what your software has to do

What mandatory B2B e-invoicing in Spain requires from the program that issues and receives your invoices, the official dates and what changes for a custom ERP.

8 min read
  • e-invoicing
  • erp
  • custom software
  • verifactu
The article title being typed in an editor, with its date, reading time and tags.

B2B electronic invoicing in Spain now has a timetable. From 6 October 2028, any company or self-employed professional invoicing another business based in Spain will have to do it with a structured electronic invoice, and from 6 October 2027 if they invoice more than 8 million euros a year (AEAT, implementation calendar, 2026). A PDF sent by email will no longer do for those transactions. For the program you invoice with, that means four new jobs: generate the invoice in a European format, send it through an official channel, receive your suppliers' invoices the same way and report when you pay each one.

This is not tax advice: for your specific case, check with your accountant.

The dates the regulation sets

The obligation comes from Law 18/2022, known as "Crea y Crece" (BOE), and is developed by the regulation approved in March (Royal Decree 238/2026, BOE). That regulation gives no calendar dates: it counts the deadlines from the entry into force of a ministerial order (fourth final provision). The order was published in the official gazette on 5 October 2026 and came into force the next day (Order HAC/1028/2026, BOE). The clock has been running since then.

The tax agency (AEAT) publishes the resulting calendar. It defines large businesses as those whose volume of operations exceeded 8 million euros the previous year (AEAT, implementation calendar, 2026):

WhoIssue and receive e-invoicesReport status and payment
Large businesses and professionals6/10/20276/10/2027
Other companies and entities6/10/20286/10/2028
Other self-employed individuals and pass-through entities6/10/20286/10/2029

Large businesses must also attach, during their first year, a PDF that makes sure the invoice can be read (second transitional provision of Royal Decree 238/2026, BOE). That PDF goes to the customer, not to the AEAT.

Simplified invoices, the old receipts, are left out except for qualified ones (art. 4), and so are sales to consumers: the obligation only applies when the recipient is a business or professional (art. 3).

What changes compared with sending a PDF

A PDF is a picture of the invoice: a person reads it and somebody types the data into their own program. A structured electronic invoice is a file that another program reads. The regulation accepts four syntaxes, all on the same European data model, the EN 16931 standard: UBL, CII, EDIFACT and Facturae (art. 7.1). The AEAT's public service only accepts UBL (art. 11.2).

Nor do you need the customer's permission any more. Until now, an electronic invoice required the recipient to agree to receive it; for in-scope transactions, it no longer does (new art. 9.2 of the invoicing regulation, amended by Royal Decree 238/2026, BOE). Your customer has to be able to receive it, and you have to be able to receive your suppliers' invoices.

What the program has to do when issuing

The order specifies the file down to the last field, in its annex I (Order HAC/1028/2026, BOE). What takes the most work in a program of your own:

  • Generate UBL with the AEAT profile. Any UBL will not do: the order fixes the profile identifiers, the accepted invoice types, the tax regime codes (VAT, IGIC, IPSI), withholdings and how corrective invoices are described.
  • A unique code per invoice, built from the issuer's tax ID, the series and number and the issue date (art. 7.5 of the regulation; art. 6 of the order).
  • The VERI*FACTU QR URL inside the file. The "fiscal QR" group in annex I carries the same address that is printed as a QR code on the invoice. This is where the two regulations meet.
  • Nothing embedded. The invoice cannot carry other files inside it (art. 3.6 of the order).
  • Send it. Through the public service, using web services and an electronic certificate (arts. 5 and 11 of the order). The AEAT validates each submission and replies with what was accepted and what was rejected, with the reason.
  • Cancel without deleting. An invoice that has been sent can only be withdrawn if the transaction never existed, and a wrong communication is cancelled leaving a trace (arts. 3.5 and 8.5).

For those who issue few invoices, the AEAT will offer a free form on its website that produces one invoice at a time (art. 5.1 of the order). It gets you by. It is no use if the ERP already issues hundreds a month.

Receiving is an obligation too

This part tends to be forgotten. The recipient has to report the rejection of an invoice, if they reject it, and the date of full effective payment, plus the due date (art. 12 of Royal Decree 238/2026, BOE). If there is no rejection, the invoice is presumed accepted. The deadline for reporting payment is four calendar days from the payment, not counting Saturdays, Sundays or national holidays (art. 12.3).

That is the underlying reason for the law, which presents e-invoicing as "a key measure" against late payment: to tackle it, you first need to know how long payment really takes (Law 18/2022, preamble, BOE). For the software, it means accounts payable has to know when each invoice was paid and report it on its own.

Supplier invoice, then Import into the ERP, then Is it accepted?, then Record the payment, then Report the payment date. Is it accepted?, no: Report the rejection

A prepared ERP downloads received invoices automatically (the regulation requires the public service to allow it, art. 11.5), matches them against the order and the delivery note, and sends the status when treasury marks the payment. Without that, someone will have to go in invoice by invoice to report it.

Public service or private platform

There are two channels. The public service is run by the AEAT, is free (art. 11.10) and is the default: unless you have agreed with your suppliers to receive through another route, you are deemed to receive through it (art. 6.1). Private platforms are companies that exchange invoices between their customers. If you use one, it has to send the AEAT a faithful copy of each invoice in UBL at the moment it is issued (art. 6.2), connect with any other platform within a month at most (art. 9.3) and sign each invoice with an advanced electronic signature (art. 7.3).

For a small business with a custom ERP, the technical question is not which to choose in the abstract, but where the ERP stops:

  • Connect the ERP directly to the public service. The ERP generates the UBL, sends it by web service and downloads what it receives. Everything stays in house; that connection has to be built and maintained.
  • Hand the invoices to an existing platform. The ERP generates the file, or an intermediate format the platform converts, and the platform does the rest, including the signature and the copy to the AEAT.

Building your own private platform makes no sense for a small business. The regulation requires certified security under ISO/IEC 27001 or equivalent, AS2 or AS4 protocols, conversion between the four formats and continuous support (art. 13).

How it fits with Verifactu

They are two different obligations the same program has to meet. Verifactu is about how the program records each invoice it issues: a chained hash, with nothing that can be changed without a trace. We covered it in what the software has to do for Verifactu. E-invoicing is about how that invoice travels to the customer and what happens afterwards.

The link between them is the QR URL. Our own invoicing system, running in VERI*FACTU mode and in production since 17 October 2026, already computes that URL for every invoice and prints it as a QR on the PDF. For e-invoicing, that same URL has to go inside the UBL. What our system does not do yet is generate the UBL.

The Ministry of Finance has announced its intention to align the pending Verifactu deadlines with e-invoicing for those invoicing up to 8 million euros, in October 2028 (Ministry of Finance, 2026). On 9 November 2026 that is not in the official gazette: the legal Verifactu dates are still 1 January and 1 July 2027 (AEAT, information note, 2026).

What to ask whoever maintains your program

There is time, but less than it seems: the regulation only guarantees that the public service will be available two months before the first mandatory date (fifth additional provision). It is worth having answers to these before 2027:

  1. Does the program generate UBL compliant with EN 16931 and the AEAT profile? Not "exports to XML": UBL, with the fields in annex I of the order.
  2. Which way will it send: public service or platform? If a platform, which one and who pays for the integration.
  3. Can it receive suppliers' e-invoices and put them into the accounts without retyping them?
  4. Does it know when each received invoice is paid, and report it in time? This is usually where the gap is, because payment lives in the bank and not in the ERP.
  5. Does it fit with what it already does for Verifactu? The QR URL has to come from the same record.

If your ERP is custom, these questions are for whoever programmed it, and the answer will probably be that part of it has to be built. If you want us to look at your case, services explains what we do.

Luis Cros

Luis Cros

Developer and founder of Optimio, in Palma de Mallorca. He builds custom ERPs, automation and document reading for small businesses, and issues Optimio's invoices with his own VERI*FACTU system.

About Optimio

Keep reading

Have a process like this in your company?

In 30 minutes we go through it together and tell you whether a rule, AI or neither is the right fit. Free, by video call.

Book a 30-minute consultation

Prefer to write? info@optimio.es