← Back to Blog
Automation14 Jan 2025·10 min read

From 5 Days to 4 Hours: Inside a Month-End Close Automation

A walkthrough of how we automated 2,000 invoices a month — including the architecture, the edge cases, and what 99.97% accuracy actually means.

Stratum Finance's month-end close was a five-day ordeal. Their finance team of three was processing around 2,000 supplier invoices a month — a mix of PDFs, scanned documents, and email attachments — reconciling them against purchase orders, flagging discrepancies, and posting approved invoices to their ERP.

It wasn't that the team was slow. It's that the work was genuinely time-consuming when done manually. Every invoice had to be opened, read, matched to a PO, checked for discrepancies in amount, line items, and VAT treatment, and then either approved or flagged for review.

The architecture

The automation runs in four stages.

Ingestion. Invoices arrive through three channels — email attachments, a supplier portal upload form, and a shared drive that legacy suppliers still use. A watcher service monitors all three and routes new documents into a normalised queue.

Extraction. Each document goes through a document AI pipeline that extracts structured data — supplier name, invoice number, date, line items, VAT amounts, totals, and bank details. This is the step where most automation projects fail. Real-world invoices are messy: some are structured PDFs, some are scanned at odd angles, some have handwritten amendments. The extraction model was trained on three months of Stratum's historical invoices before deployment.

Matching and validation. Extracted data is cross-referenced against open POs in Stratum's ERP. The system checks five things: supplier identity, invoice number (duplicate detection), line item match, total amount within tolerance, and VAT calculation. Invoices that pass all five are auto-approved. Invoices that fail any check are flagged with the specific reason and routed to a human reviewer.

Posting. Approved invoices are posted directly to the ERP via API, with full audit trail. The finance team gets a daily summary email rather than processing each invoice individually.

What 99.97% accuracy means

In a month of 2,000 invoices, 99.97% accuracy means roughly 0.6 errors — less than one per month. In practice, over the first three months of operation, the system had two errors, both in month one. Both were caught by the ERP's own validation before posting.

The more meaningful number is the false positive rate on the flagging system. Early in deployment, the system was flagging around 8% of invoices for human review — mostly due to slight formatting variations in supplier names and edge cases in VAT treatment. After tuning, the flag rate dropped to 1.4%, which means 97 minutes of manual review per month rather than five days.

The edge cases

Edge cases are where automation projects either earn their value or fall apart. The three hardest ones we encountered:

Credit notes. Supplier credit notes look similar to invoices but need to be handled differently. Early versions of the model confused these more than acceptable. We added a specific classification step before extraction.

Multi-currency invoices. Stratum works with European suppliers, so EUR and USD invoices need currency conversion and tolerance checks against the exchange rate on the invoice date. This added a FX lookup step that runs before matching.

Partial deliveries. Sometimes a PO is partially fulfilled and the invoice only covers the delivered portion. The matching logic needed to handle open POs with partial amounts rather than requiring exact matches.

The outcome

Month-end close went from five days to four hours. The finance team now uses the time previously spent on invoice processing for actual financial analysis. Two team members who were primarily doing manual processing work were redeployed to higher-value tasks.

Want to build something like this?

We work from idea to production — stores, agents, and automation for businesses of all sizes.