Automating invoice processing
Incoming invoices recognised, registered and forwarded automatically, with payment reminders updating the original invoice instead of being booked twice.
Starting point
Supplier invoices arrived in separate folders and were processed by hand.
An organisation with several administrations received a steady stream of supplier invoices as PDFs every month. Someone downloaded them from different folders, retyped the details into the central payment list, forwarded the PDF to the processing software, and repeated it for the next administration. Precise, repetitive and error-prone work: ideal to automate, but only if the exceptions don’t disappear.
The problem
Payment reminders were booked as new invoices.
The biggest risk wasn’t typos but the wrong kind of document. As a PDF, a payment reminder looks exactly like an invoice. In busy weeks reminders were regularly processed as new invoices. The result:
- duplicate rows cluttered the administration;
- there was a real risk of paying twice;
- nobody noticed the original invoice was already overdue.
The process also had to make failures visible. A failed upload must not mean an invoice quietly disappears and only resurfaces when the supplier sends a final notice.
The approach
One script that recognises each document and picks the right route.
A script watches the intake folders. Which folder belongs to which administration and processing address lives in a configuration sheet, so adding an administration doesn’t require code changes. Based on the filename, the script decides what kind of document it is and sends it down one of three routes.
- Intake foldersone per administration
- Script picks up new documentssettings live in a configuration sheet
- What kind of document is it?Invoice or receipt
- Forward to processing softwarevia the software's intake address
- Row in the payment listwith a link to the file
Payment reminder- Find the original invoiceby sender and invoice number
- Update status on that row
- Archive the reminder
Something fails- Document to review mailboxwith an error report attached
- Handled today, not at the final notice
Invoices and receipts go to the processing software and the payment list in the same step, with a link to the file. A reminder is deliberately not forwarded: the script finds the original invoice, updates its status and notes, and archives the reminder. If anything fails, the document goes to a review mailbox with an error report.
Key decisions
Four choices that made the difference.
- Reminders as a document type of their own. The costliest errors were category errors, not typos. Recognising reminders separately and sending them to an “update the original” route removed the main cause of double bookings.
- Classify by filename, not content. Suppliers and the upstream scanning step produced fairly consistent filenames: a reliable, low-cost signal. Text recognition can do more but adds cost, latency and its own failure modes. At this volume it wasn’t needed.
- Fail loudly, then route. On an error the script doesn’t just write a log line; it moves the document to a person, with an explanation. From “invoice missing, found at the final notice” to “invoice in your inbox with an error note, found today”.
- Two records at once. The payment list is filled in the same run as the processing software, so finance always has its own overview, even when the external system is briefly unavailable.
What made it hard
Matching a reminder to the right invoice.
A reminder refers to its invoice only loosely: the sender’s name varies slightly and the invoice number sits in a different place or format. The matching had to normalise both sides enough to match reliably. At the same time, a wrong match is worse than no match, because it marks the wrong invoice as “reminder received”. So the matching was tuned for certainty, and doubtful cases go to the review mailbox instead of guessing.
The result
Less manual work, and no document that quietly disappears.
- Reminders update their original invoice instead of creating a new row, which considerably reduces the risk of paying twice.
- Invoices land in the processing software and the payment list in one step, with the right link and no retyping.
- Failed steps reach a person with an error report instead of sitting unnoticed.
- Every action is logged with a timestamp, so “where did that invoice go?” is quick to answer.
Built at organisations in finance, operations and business services. Client names and confidential details are left out.