This guide is for managing directors, heads of administration and finance directors at Spanish SMEs who spend too many hours keying in, checking and filing invoices. By the end you will know which parts of the process are worth automating with AI and which with simple rules, how the project fits with mandatory e-invoicing and Verifactu, and how to set up a pilot you can measure.
Which parts of invoicing AI can automate
When people talk about "automating invoices", they tend to mix up two very different processes:
- Incoming invoices (accounts payable): they arrive from suppliers by email, portal or post, in all sorts of formats. They have to be read, checked, posted, approved and paid.
- Outgoing invoices (accounts receivable): your own invoicing software generates them from orders or contracts. Here the challenge is not reading, but issuing them correctly, sending them and getting paid.
AI adds most value on incoming invoices, because that is where there is messy information to interpret. For outgoing invoices, your invoicing software and a few well-configured rules are usually enough.
You do not need AI for every task. Many tasks are better handled with fixed rules, which are cheaper, more predictable and easier to audit:
| Task | With rules | With AI |
|---|---|---|
| Extract data from a PDF or a photo | Only if the format is always the same | Yes, with varied formats |
| Read a structured e-invoice | Yes, the format already contains the fields | Not needed |
| Assign the ledger account and cost centre | If the supplier always invoices the same thing | Yes, when the lines vary |
| Match invoice, purchase order and delivery note | Yes, if the data match exactly | Useful for partial differences or different descriptions |
| Detect duplicates | Yes, by number and supplier | Useful for "near-identical" duplicates |
| Answer supplier queries about payments | No | Yes, as a draft reviewed by a person |
| Decide whether to pay | Yes, with an approval workflow | Should not decide on its own |
The rule of thumb: use rules when the input is predictable and AI when text or documents that change need interpreting. And always leave payment approval in the hands of a person.
The timeline in Spain: mandatory e-invoicing and Verifactu
Before choosing a tool, it is worth knowing where the regulation is heading, because it changes what is worth automating.
Mandatory B2B e-invoicing
Royal Decree 238/2026, published in the BOE on 31 March 2026, implements the obligation to issue and receive electronic invoices between businesses and professionals. Its application depended on a ministerial order regulating the public invoicing solution. That order is Order HAC/1028/2026, published on 5 October 2026 and in force from the following day.
According to the Agencia Tributaria, the deadlines run from that date:
| From | Who | What |
|---|---|---|
| 6 October 2027 | Businesses and professionals with a turnover above €8 million | Issue, send and receive e-invoices and report the status of invoices and payments |
| 6 October 2028 | All other businesses and professionals | Issue, send and receive e-invoices; legal entities must also report statuses |
| 6 October 2029 | Self-employed individuals and entities under the income attribution regime | Report the status of invoices and payments |
Three details of the order directly affect automation:
- Structured format. Invoices follow the European semantic model EN 16931 in UBL syntax. In other words, they arrive as data that software reads without interpreting, not as a PDF.
- Invoice statuses. The recipient reports rejection, the date of full payment and the due date. If there is no rejection or corrective invoice, the invoice is presumed accepted. This calls for a fast review workflow: anything you do not review in time may be treated as accepted.
- Public solution and private platforms. The Agencia Tributaria will offer a free solution, which will coexist with private exchange platforms.
Verifactu
Verifactu affects systems that issue invoices, not those that only process incoming ones. The Agencia Tributaria's FAQs make clear that the rules apply to systems used to issue invoices. The system must generate an invoicing record with a digital fingerprint (hash), chained to the previous record so that gaps can be detected, and include a QR code on the invoice. In the VERI*FACTU mode, the records are also sent to the Agencia Tributaria.
Under the rules currently in force, the obligation starts on 1 January 2027 for corporate income tax payers and on 1 July 2027 for everyone else. On 5 October 2026 the Ministry of Finance announced its intention to postpone it until October 2028 to align it with e-invoicing for SMEs. As of the date of this guide, that postponement has not been published in the BOE, so the 2027 dates remain the legal ones. Keep an eye on the BOE and the Agencia Tributaria's website.
What this means for your AI project
Once e-invoicing becomes mandatory for you, most of your Spanish suppliers will send you structured data. Spending heavily on an advanced system for reading PDFs therefore has a partial expiry date. It remains useful for foreign suppliers, receipts, transport documents and the transition period, but the lasting value lies in what comes after reading: classifying, matching, detecting anomalies and handling exceptions.
For outgoing invoices, any automation has to go through Verifactu-compliant invoicing software. Do not let an AI tool generate invoices on its own outside that software.
How to automate incoming invoices step by step
This is a sensible plan for an SME receiving anywhere from a few dozen to a few thousand invoices a month. Adjust the scale to your situation.
- Measure your starting point. For two or three weeks, record how many invoices you receive, through which channel, how long each one takes and how many cause problems. Without this data you will not know whether the project has worked.
- Map the real process. From the moment the email arrives until payment: who opens it, where it is stored, who approves it, how it is posted. Duplicated steps that can be removed without any technology usually come to light.
- Classify your invoices. Separate recurring suppliers with a stable format, occasional suppliers, paper invoices and invoices that already arrive electronically. Each group calls for a different solution.
- Solve the easy part first with rules. A single inbox for invoices, standardised file names and posting rules for recurring suppliers already remove a lot of work.
- Apply AI where there is variety. Data extraction from diverse PDFs, suggested ledger account and cost centre, and matching with purchase orders and delivery notes when descriptions do not match exactly.
- Set review thresholds. Whatever the tool extracts with high confidence and matches the purchase order can go straight to approval. Doubtful cases, large amounts and new suppliers always go to a person.
- Integrate with your accounting software or ERP. The value appears when the data reach your accounting software automatically. Check that your system allows data imports or has a direct connection before choosing a vendor.
- Run a limited pilot. Start with one group of suppliers for a few weeks, compare against the figures from step 1 and decide whether to expand, adjust or stop.
What to ask of a tool
- It should show where each piece of data came from, so you can review quickly.
- It should learn from your corrections or let you adjust rules without coding.
- It should read and generate the e-invoice formats you will need.
- It should export your data and documents so you are not tied to it forever.
- It should make clear where data are processed and stored.
Retention and paper: what does not change
Automation does not free you from keeping invoices. The Agencia Tributaria points out that they must be kept for the four-year limitation period, and longer if the VAT deduction is subject to adjustment. They can be kept on paper or electronically, provided that the authenticity of origin, integrity of content, legibility and prompt access by the tax authorities are guaranteed.
Scanning a paper invoice and running it through an AI tool is not the same as replacing the original. That is what certified digitisation with software approved by the Agencia Tributaria is for. If you want to go paperless, check that your vendor is on the list of approved software and consult your adviser.
Risks and controls
Reading and interpretation errors
AI models are right most of the time, but not always, and sometimes they get things wrong with complete confidence: a tax ID (NIF) with one digit changed, a taxable base mistaken for the total, or a VAT rate assigned incorrectly. That is why automated controls are essential:
- Check that the taxable base, VAT amount and total add up.
- Validate the supplier's NIF against your supplier master file.
- Raise an alert if the payment IBAN changes compared with previous invoices, and confirm the change through another channel before paying.
- Manually review a sample of the invoices approved automatically.
Data and vendors
Invoices contain data about companies and, sometimes, about individuals: self-employed workers, employees on expense claims or private customers. Before sending documents to an external AI service, check where they are processed, whether the vendor can use them to train its models and what data protection agreement you sign with it. Your data protection officer or adviser should sign this off.
European AI regulation
According to the European Commission, the AI Act does not impose specific rules on minimal-risk systems, which make up most of those used in the EU today. A system that reads invoices normally falls into that category. Even so, AI literacy obligations have applied since 2 February 2025, so the team using the tool must understand what it does and what its limits are.
How to tell whether it pays off
Measure using the same figures you took at the start:
- Time per invoice, from receipt to posting.
- Percentage of invoices with no manual intervention, and how many of those had errors in the sample review.
- Approval time, which is key once the recipient has to report rejections and payments.
- Incidents: duplicates paid, late payments, supplier complaints.
- Total cost: licences, integration, maintenance and the review hours that are still needed.
If the time saved is small because you receive few invoices, it may be enough to tidy up the process and wait for e-invoicing. If you receive many varied invoices, AI usually has more to offer. We explain this in more detail on our AI process improvement page.
Frequently asked questions
Can AI post invoices without anyone reviewing them?
It can propose the journal entry and, for recurring invoices that match a purchase order, leave it ready for approval. The prudent approach is to keep human review for large amounts, new suppliers and doubtful cases, and to review the rest by sampling. Tax liability still rests with your company.
Is it worth automating if e-invoicing is going to be mandatory?
Yes, but with a different focus. PDF reading will matter less with Spanish suppliers from 2027 or 2028, depending on company size. Classification, matching with purchase orders, exception handling and status reporting will still need automation.
Does Verifactu affect tools that read incoming invoices?
According to the Agencia Tributaria's FAQs, the rules apply to systems used to issue invoices. A tool that only processes incoming invoices is not, in principle, an invoicing system for these purposes. If the tool also issues invoices, it must meet the requirements.
Can I throw away paper invoices after scanning them?
Scanning them is not enough. To replace paper you need certified digitisation with software approved by the Agencia Tributaria. Check with your adviser before destroying any original.
How Agilean can help
At Agilean we help SMEs review their administrative processes before choosing tools, so they can decide what to solve with rules, what with AI and what not to automate. Our team can measure your starting point, design the review workflow and develop or integrate the solution with your accounting software. You can see how we work on our AI process improvement page.