In the field · November 18, 2026
How to automate invoices and delivery notes with AI, step by step
Delivery notes and invoices are already electronic, but at most companies someone still opens them, matches them against the purchase order and keys them in by hand. Here is how an AI agent does that work and leaves your team only the exceptions.
By Cristopher Clavero, Founder of Baguals

Automating delivery notes and invoices with AI means an agent receives each document, reads it, checks it against the purchase order and the goods receipt, loads it into your ERP and hands your team only the ones with discrepancies. Across much of Latin America the document is already electronic; what is still manual is everything that happens after it arrives.
Why is there still manual work if documents are already electronic?
In Chile, since January 17, 2020, delivery notes (guías de despacho) can only be issued electronically (SII), just like invoices. In Mexico, every invoice is a CFDI validated with the SAT. The document exists as XML, with a folio number, amounts and issuer.
And yet, at most companies the process looks like this:
- Documents arrive from several places: the billing inbox, a supplier portal, printed with the truck or as a photo in a WhatsApp chat.
- Someone opens each one and looks it up in the ERP to find the purchase order.
- They compare quantities and prices against what was ordered and what the warehouse says it received.
- If everything matches, they key it in; if not, they write emails to clear up the difference.
- The delivery note signed by the customer, which proves delivery, is scanned or photographed and filed by hand.
Electronic documents solved issuing. They didn’t solve receiving, matching or loading. We wrote about that cost in the hidden cost of typing documents by hand.
How does an agent that processes delivery notes and invoices work?
The agent takes the document from arrival to recorded, and leaves the decisions to your team:
| Step | What the agent does | What your team does |
|---|---|---|
| 1. Receive | Checks the billing inbox, the portal or the WhatsApp channel and picks up each document (XML, PDF or photo) | Nothing |
| 2. Read | Extracts issuer, folio, date, line items, quantities, amounts and references; if there is XML, uses it as the primary source | Nothing |
| 3. Check | Matches against the purchase order, the warehouse receipt and the supplier master; detects duplicates | Nothing, unless there are discrepancies |
| 4. Record | Loads the document into the ERP with its order and receipt attached | Nothing |
| 5. Hand off exceptions | If something doesn’t match, it doesn’t load: it opens a case with the discrepancy flagged and the document attached | Decides: approve, reject or request a credit note |
| 6. Keep a record | Logs every document, check and decision in the audit log | Reviews it when needed |
The difference from OCR is step 3 onwards: OCR turns an image into text, while the agent understands the document, compares it with your data and acts on your rules. We explain it in detail in what an enterprise AI agent is.
What does the agent check on each document?
Checks are configured for your country and your process. The most common:
In Chile (electronic tax documents, DTE):
- Document type: electronic invoice (type 33) or electronic delivery note (type 52), among others.
- Issuer tax ID (RUT) against your supplier master.
- Folio number, to detect duplicates.
- Reference to the purchase order or the related delivery note.
- Net amount, VAT and total against what was agreed.
In Mexico (CFDI):
- Issuer and recipient tax IDs (RFC).
- Fiscal folio (UUID), to detect duplicates.
- That the invoice is valid and not canceled with the SAT.
- Line items, quantities and amounts against the purchase order.
In any country:
- Invoiced quantities against quantities received at the warehouse.
- Unit prices against the purchase order or the current price list.
- Supplier active and with verified bank details before scheduling a payment.
Which exceptions should always go to a person?
A well-configured agent doesn’t try to resolve everything. These exceptions generally go to your team:
- Quantity discrepancies: 90 boxes arrived and the delivery note says 100.
- Price discrepancies: the invoice has a different price than the order.
- New suppliers or changes to their bank details.
- Documents without a related purchase order.
- Illegible or incomplete documents, typically photos of signed delivery notes.
The rule for what loads automatically and what gets handed off is set before the agent goes live, and every decision is recorded. That is how agent control works at Baguals: human approval for anything sensitive, an append-only audit log and a spending cap.
How do you measure whether the agent is working?
Before starting, agree on three or four metrics and measure where they stand today:
- Time from when a document arrives until it is loaded.
- Share of documents processed without a person’s intervention.
- Errors caught before payment: duplicates, mispriced invoices, quantities not received.
- Team hours spent typing and chasing documents.
If those numbers don’t improve after a few weeks in production, something needs adjusting: the rules, the data sources or the scope.
Where to start?
With a single workflow. Pick one document type (for example, invoices from transport suppliers) and a small group of high-volume suppliers. Measure where things stand today, put the agent to work on that group and expand when the numbers justify it. It is the same principle we describe in why every AI transformation starts with one workflow.
See how our agents handle documents in AI document processing and, for transport and warehouse operations, in logistics. If you want to see how it would look in your operation, tell us about your process.



