How to automate supplier invoices with AI, and what Verifactu and B2B e-invoicing mean for companies in Spain
By Laszlo Brusa · BL Diseno · Updated · 5 min read
Automating supplier invoices means chaining five steps: receiving the invoice (usually by email), extracting its data with OCR or AI, validating it against purchase orders and supplier records, posting it to the accounting software or ERP, and preparing payment. In most SMEs and professional firms nearly the whole journey can be automated, leaving a person to review only the exceptions. In Spain, the workflow should also account for Verifactu, postponed to 2027, and mandatory B2B e-invoicing, whose final timetable still depends on a ministerial order.
How the workflow runs, step by step
1. Intake
Invoices arrive through scattered channels: the accounts inbox, individual employees' email, supplier portals and, increasingly, as structured electronic files. The first step is to bring them all to one place.
The usual approach is a dedicated inbox (for example, invoices@yourcompany.com) that the automation checks regularly. Each attachment is filed in an organised folder and its arrival is logged.
2. Extraction
This is where AI adds the most value. There are two approaches:
- Template-based OCR: works well when a handful of suppliers always send the same layout.
- Large language models (LLMs): read invoices in very different layouts and return the fields in a fixed structure (supplier tax ID, invoice number, date, taxable base, VAT rate and amount, withholding, total, line items).
If the invoice already arrives as a structured electronic file (Facturae, UBL or another standard format), nothing needs interpreting: the data is read directly.
3. Validation
Extraction alone is not enough. The workflow should check:
- That the tax ID matches a registered supplier.
- That bases, taxes and withholdings add up to the total.
- That the invoice is not a duplicate.
- That it matches a purchase order or contract, where one exists.
- That the bank account (IBAN) has not changed from the one on file, a key safeguard against fraud.
Invoices that pass every check go straight through. The rest land in a human review queue.
4. Posting to the accounting software or ERP
Validated data is sent to the accounting software or ERP through its API, with a suggested ledger account and cost centre. If your software has no API, there are alternatives (file imports, for instance), though they are less robust.
5. Payment
Finally, the automation can prepare payment batches by due date and leave them ready for someone to authorise at the bank. Final payment approval should always stay with a person.
Types of tools
| Category | Examples | Best fit |
|---|---|---|
| Visual automation | Zapier, Make | Simple flows, low volume, non-technical team |
| Self-hostable automation | n8n | More control over where data is processed, complex flows |
| OCR extraction | Template-based OCR engines | Few suppliers with stable layouts |
| LLM extraction | Language models via API | Many suppliers and varied layouts |
| Built-in modules | Capture features in your ERP or accounting tool | If you already pay for it and it covers your cases |
There is no single best option. The choice depends on volume, the software you already use and where the data must be processed. Invoices contain personal data (for example, from self-employed suppliers), so the GDPR applies to any technology providers involved.
Checklist before you automate
- All invoices arrive in a single inbox or channel.
- There is an up-to-date supplier master file (tax ID, IBAN, ledger account).
- I know how many invoices we receive each month and how long each takes.
- It is clear which cases need human review.
- The accounting software accepts data via API or file import.
- Tool accounts will be in the company's name.
- I have checked with my tax adviser how Verifactu and B2B e-invoicing affect us.
The Spanish context: Verifactu and B2B e-invoicing
These are two separate obligations that are often confused.
Verifactu
The regulation on invoicing software (Royal Decree 1007/2023), known as Verifactu, sets requirements for the software that companies and self-employed professionals use to issue invoices, to guarantee their integrity and traceability. Those already keeping their VAT books through Spain's Immediate Supply of Information system (SII) are among those excluded.
Royal Decree-law 15/2025, published in the Official State Gazette (BOE) on 3 December 2025, postponed mandatory application to:
- 1 January 2027 for corporate income tax payers.
- 1 July 2027 for everyone else, including the self-employed.
Parliament ratified the decree-law. The Spanish Tax Agency (AEAT) keeps the technical information up to date.
What it means for automating received invoices: little directly, because Verifactu covers issuing. But your suppliers will send invoices that meet the new requirements (a QR code, for example), and your company will need compliant software for the invoices it issues.
Mandatory B2B e-invoicing
Law 18/2022 on business creation and growth (known as "Crea y Crece") introduced the obligation to issue and receive electronic invoices in transactions between businesses and professionals. Its implementing rules came with Royal Decree 238/2026, published in the BOE on 31 March 2026 and in force since 20 April 2026.
The obligation does not apply yet, however. According to the decree itself and an AEAT notice, it only takes effect once a ministerial order regulating the AEAT's public e-invoicing platform comes into force. From that point:
- 12 months later for companies with turnover above 8 million euros.
- 24 months later for all other businesses and professionals.
At the time of writing (September 2026), that order is a draft put out for public consultation in April 2026, and we have found no record of its final publication in the BOE. There is therefore no fixed compliance date yet. Check the current status with your tax adviser before making decisions.
Points in Royal Decree 238/2026 that matter for your workflow:
- Private platforms may use the UBL, CII, EDIFACT and Facturae formats.
- The AEAT will provide a free public platform.
- The recipient must report whether the invoice is accepted or rejected and when it has been paid in full, with dates, within four days excluding Saturdays, Sundays and national holidays. Reporting payment to the public platform will be mandatory.
That last point matters: receiving invoices will no longer be a passive process. A well-designed automated workflow can generate these notifications from the validation and payment records it already holds.
Common mistakes
Automating without a supplier master file. Without reliable tax IDs and IBANs, validation has nothing to compare against.
Removing all human review. Doubtful or high-value invoices should go past a person.
Ignoring IBAN changes. A classic fraud route; the workflow should detect and block them.
Designing for PDFs only. With B2B e-invoicing on the way, the workflow should accept structured formats too.
How we work at BL Diseno
At BL Diseno, a technical studio in Barcelona, we first look at how your invoices arrive today and which accounting software you use, then propose a workflow with human review at the sensitive points. The price is agreed in writing before we start, everything stays in your company's name, and you have a single point of contact.
Sources (9)
- https://www.boe.es/buscar/act.php?id=BOE-A-2023-24840
- https://www.boe.es/eli/es/rdl/2025/12/02/15
- https://www.iberley.es/noticias/el-congreso-convalida-real-decreto-ley-que-retrasa-veri-factu-2027-35783
- https://sede.agenciatributaria.gob.es/Sede/iva/sistemas-informaticos-facturacion-verifactu.html
- https://www.boe.es/buscar/act.php?id=BOE-A-2022-15818
- https://www.boe.es/diario_boe/txt.php?id=BOE-A-2026-7295
- https://sede.agenciatributaria.gob.es/Sede/todas-noticias/2026/marzo/31/facturacion-electronica-obligatoria.html
- https://www.hacienda.gob.es/sgt/normativadoctrina/proyectos/16042026-proyecto-pom-factura-electronica.pdf
- https://eur-lex.europa.eu/eli/reg/2016/679/oj