
How AI Reads Invoices from Email and Enters Them into ERP
AI can automatically read an invoice from an email attachment - PDF, scan, or phone photo - and enter it directly into an ERP system without any manual retyping. This is full automation of cost invoice processing: from the mailbox to posting the document in the accounting system.
AI can automatically read an invoice from an email attachment - PDF, scan, or phone photo - and enter the data directly into an ERP system without any manual retyping. Full automation of cost invoice processing: from the mailbox to accounting.
The topic is especially hot in 2026 because Poland's KSeF is now mandatory. Since 1 February 2026 every company must receive invoices through KSeF, while the obligation to issue them applies to the largest taxpayers (sales above PLN 200 million in 2024) from 1 February, to everyone else from 1 April 2026 and to the smallest businesses from 1 January 2027. Domestic cost invoices therefore increasingly arrive as structured XML, but documents outside KSeF (foreign invoices, receipts, bills, notes) still have to be read. And even a correctly read invoice still has to be coded to the right accounts - which is where AI has the most work to do today.
Definition: What Is Intelligent Invoice Processing?
Intelligent invoice processing is a workflow in which AI Vision and large language models (LLMs) recognise the content of accounting documents, understand their structure, and save the data into an ERP system in a structured format.
Unlike classic OCR, the AI system:
- Understands field context - distinguishes the seller's VAT ID from the buyer's.
- Handles different invoice layouts without template configuration.
- Detects errors and missing data.
- Can collaborate with a human at the validation stage.
/// PROCESS: FROM EMAIL TO ERP
Why It Pays Off - Numbers, Not Promises
Invoice processing is one of the best-studied processes in finance. Ardent Partners' "State of ePayables 2025" report shows the size of the gap:
- Unit cost: an average of $12.42 per invoice, versus $2.65 in the best AP teams - 79% less.
- Cycle time: the best teams process invoices 79% faster than their peers.
- AI in AP: 44% of teams already use AI, and more plan to adopt it within a year.
- Errors: automated checks eliminate typos in amounts and account numbers that cause corrections and late payments in a manual process.
The bigger the volume, the bigger the saving.
How AI Handles Skewed Scans and Phone Photos
Modern AI Vision does not "read letters" - it interprets the document as an image and a semantic structure. That is why it can:
- Straighten the perspective of a phone photo.
- Read data from shadows, folds, and low light.
- Recognise a line-item table even without separator lines.
- Understand which numbers are net, VAT, and gross - even when the layout is non-standard.
This is the key difference from OCR, which requires perfect scan quality and a fixed template per supplier.
KSeF in 2026 - What Changed and Where AI Fits
A company downloads structured (XML) invoices from KSeF via the API - AI isn't needed to read them, because the data is already structured. Penalties for KSeF compliance errors are set to apply only from 2027, so 2026 is a good moment to tidy up the workflow.
The map of cost documents after KSeF that I prepare at the start of every rollout:
| Document | How it arrives | What AI does | What to watch |
|---|---|---|---|
| Domestic VAT invoice | XML from KSeF via API | Coding: cost account, cost centre, project, VAT split | Corrective and advance invoices |
| Foreign invoice | PDF by email | Reading, currency, exchange rate, import-of-services flag | Reverse charge, EU VAT data |
| Receipt or simplified document | Phone photo | Reading, cost category, link to the employee | Legibility, amount limit |
| Bill, note, contract | PDF or scan | Reading and document type classification | No standard layout |
| Email duplicate of a KSeF invoice | PDF sent "alongside" KSeF | Matching to the KSeF number and flagging as a duplicate | Double posting |
The takeaway: after KSeF, AI less often "reads" domestic invoices and more often makes decisions - it suggests coding based on the posting history for a given supplier, detects duplicates and routes exceptions to a person. A mature workflow runs on two tracks: it pulls XML from KSeF via the API and reads everything arriving outside the system with AI Vision.
How It Works - Step by Step: From Attachment to Posting
- 1.An email with an invoice arrives at the dedicated mailbox (e.g. invoices@company.com).
- 2.AI retrieves the attachment (PDF, JPG, PNG).
- 3.AI Vision reads the document and converts it to JSON data.
- 4.The system validates: VAT ID, totals, dates, duplicates.
- 5.It matches the invoice to the purchase order and goods receipt (3-way matching, where applicable).
- 6.A human reviews and approves the invoices flagged as uncertain.
- 7.Data is sent via API to the ERP as a ready cost document.
- 8.The invoice is posted and enters the payment approval path.
Three-Way Matching
In companies with purchase orders and warehousing, extraction alone is not enough - the key is checking whether the invoice matches what was ordered and what was delivered. AI can automatically reconcile three documents:
- Purchase order (PO) - what and at what price was ordered.
- Goods receipt note - what was actually delivered.
- Invoice - what the supplier is billing for.
When all three match, the invoice is posted automatically. When there is a discrepancy (different price, quantity, missing delivery), the system routes the document to a human. This cuts off the most common source of overpayments and invoices for undelivered goods.
Duplicate and Fraud Detection
Automation is not only about speed but also control. A rules layer on top of AI-extracted data can catch:
- Duplicates - the same invoice sent twice (e.g. with an email reminder).
- Changed account numbers - the classic "invoice from a known supplier, but a different IBAN".
- Outlier amounts - line items significantly higher than historical values for that supplier.
- Formal gaps - invalid VAT ID, missing sale date, mismatched totals.
This is where automation genuinely protects the company from losing money, not just saving time.
Traditional OCR vs. AI Vision - Comparison
| Feature | Traditional OCR | AI Vision + LLM |
|---|---|---|
| Requires fixed template | Yes | No |
| Handles phone photos | Poorly | Very well |
| Understands field context | No | Yes |
| Line-item table reading | Problematic | Natural |
| Error detection | None | Yes |
| Amount of manual correction | High | Minimal |
| Cost at scale | Grows linearly | Decreases at scale |
Confidence Thresholds and Human-in-the-Loop
A good system does not post everything blindly. Every extracted field gets a confidence level, and the company sets a threshold above which a document is posted automatically and below which it goes to human approval. At the start the threshold is set high (more manual control), and as the system proves quality on real documents, it is gradually lowered, raising the automation rate.
This mechanism makes the rollout safe for accounting and audit from day one - nothing reaches the books without the ability to review it.
Real-World Example
A company receives 300 invoices per month from various suppliers. In the traditional process, the accounting team retyped data manually - dozens of hours of work per month.
After deploying AI:
- 90-95% of invoices reach the ERP automatically.
- Accounting only handles exceptions and analysis.
- Processing time drops from hours to minutes per day.
- Typos in account numbers and amounts disappear.
How Much Time Automation Gives Back - a Simple Simulator
Assume 300 invoices a month and 5 minutes of manual handling per invoice (reading, coding, checking). An exception that still goes to a person takes about 2 minutes, because the data is already pre-filled:
| Touchless share | Invoices to a person | Monthly time | Saving |
|---|---|---|---|
| 0% (manual process) | 300 × 5 min | 25 h | - |
| 60% | 120 × 2 min | 4 h | 21 h |
| 80% | 60 × 2 min | 2 h | 23 h |
| 90% | 30 × 2 min | 1 h | 24 h |
Notice something interesting: the biggest jump comes from going from 0 to 60%, and pushing automation further saves little extra time. That's why at the start it's better to set a high confidence threshold and a safe process than to chase 95% at the cost of errors in the books. Plug in your own numbers - the result multiplied by an hourly rate gives the monthly saving.
ERP Systems Ready for AI Integration
Each of the following systems has an API or document import mechanism that enables full automation:
- Comarch ERP Optima / XL
- InsERT nexo (Subiekt, Rewizor)
- Symfonia ERP
- enova365
Accounting Data Security
Invoices contain sensitive data - VAT IDs, amounts, account numbers, counterparty details. When choosing a solution, make sure the model runs via API with a no-training-on-your-data clause and that processing happens in the EU region. Documents and logs should be encrypted and access restricted by role. I cover this in more depth in data security in AI implementation.
How to Measure the Effect? Invoice Workflow KPIs
- Automation (touchless) rate - percentage of invoices posted without intervention.
- Cycle time - from document arrival to posting.
- Cost per invoice - total processing cost divided by document count.
- Correction count - errors found after posting.
- Payment timeliness - share of invoices paid on time (and early-payment discounts captured).
Turning these metrics into savings is easiest with the automation ROI calculator.
Common Mistakes When Implementing Invoice Automation
- Trying to use legacy OCR instead of AI Vision.
- Skipping the human validation stage at the start of the rollout.
- Not integrating with ERP via API - CSV export is a half-measure.
- Missing the dual track of KSeF + documents outside the system.
- Posting an emailed PDF that is a copy of an invoice already downloaded from KSeF.
- No duplicate detection or account-number control.
Who Should Use Invoice Automation
The solution pays off fastest for:
- Companies receiving more than 100 invoices per month.
- Accounting offices serving multiple clients.
- Construction, trading, and manufacturing companies with high volumes of costs.
- Organisations adapting their workflow to KSeF.
When automation may not make sense:
- When the company has only a handful of invoices per month.
- When documents are entered by an external office without ERP access.
- When the ERP has no API or import mechanism.
How Much Does Invoice Automation Cost?
Cost depends on document volume and integration scope. Rough estimates: implementation runs from a few to tens of thousands of PLN, and the cost per invoice processed ranges from a few cents to a few PLN. At higher volumes the unit cost drops quickly - this is one of the few processes where automation becomes cheaper as volume grows. I break down how to calculate the payback in what AI implementation really costs.
Frequently Asked Questions (FAQ)
Key Takeaways
AI reads invoices from email and saves them to ERP without manual retyping. It handles photos, scans, and varied document layouts. After 2026 it runs on two tracks: fetching invoices from KSeF via API and reading documents outside the system with AI Vision. It adds 3-way matching plus duplicate and fraud detection. The biggest savings appear at high document volumes - making this one of the fastest-returning automation investments a company can make.
Related Articles
/// RELATED_SERVICES
Need these concepts implemented? Explore the services related to this topic.
AI & Automation
AI agents, process automation with n8n and Make, chatbots, RAG on your own documents and custom LLMs. I build AI systems that cut manual work and run 24/7.
View serviceServiceAI App Development
Custom AI software and AI-powered web applications. MVP development, full stack engineering, and AI systems programming from scratch to production.
View service/// CASE_STUDY
See how this worked in a real project.
/// RELATED_RECORDS
Polish Embedding Models - bge-m3, multilingual-e5 or PolDense? A Test on 900 Questions
Which embedding model should you use for Polish RAG? I tested 10 models and BM25 on 900 real customer questions: results, robustness to missing diacritics and typos, the prefix that costs 30 points, the PIRB ranking, API prices, cost at two scales, licences and code.
AI Adoption in Your Team - Why Licences Sit Unused and How to Get People Using AI
According to Gartner, only 5% of companies that finished a Copilot pilot planned a larger rollout, and just 8% of employees use AI daily. Five kinds of resistance and what works, the role of managers, AI champions, measuring adoption at three levels and a 90-day plan.
How to Choose an AI Implementation Partner - 15 Questions, Warning Signs and Contract Clauses
According to MIT NANDA, 95% of AI pilots show no financial impact, yet deployments with partners succeed in 67% of cases. In-house, partner or hybrid, 15 questions to ask, warning signs, contract clauses and a pilot with success criteria.
Signal received?
Terminate
Silence
Initiate protocol. Establish connection. Let's build something loud.
