Angie kept a ruler on her desk. She used it to track lines on invoices while she retyped them, one eye on the PDF, one on the TMS. Her employer, a freight outfit with about sixty trucks, received roughly seven hundred invoices a week: by email, by scan, by fax (yes, still), and occasionally as a phone photo taken on a dashboard at a red light.
Forty hours of her week, her entire week on paper, went to moving numbers from PDFs into the transportation management system. This invoice processing automation case study covers what we built, what broke, and where those forty hours actually went. It's a composite drawn from real engagements; the names are changed, the coffee stains are real.
The short version: we put LLM extraction in front of a strict schema, wrapped it in validation rules that checked totals, vendors, and PO formats, and gave Angie a review queue sorted by confidence instead of an inbox sorted by despair. Within a month, 88% of invoices flowed straight through untouched, 9% needed a twenty-second glance, and 3% were genuinely weird. Forty hours became six, and the six were more interesting than the forty had been.
The bookkeeper drowning in PDFs
Freight invoicing is a special flavor of chaos because the documents come from everywhere. Fuel surcharges from carriers, accessorial charges, lumper fees, detention: each vendor with its own layout, its own numbering scheme, its own creative interpretation of what a "total" means. A typical week for a sixty-truck operation means seven hundred of these, arriving through at least four channels, landing on one desk.
Angie had been doing this for eleven years and was genuinely excellent at it, which was part of the problem. The company had organized itself around her excellence. Nobody had written down the rules in her head: which vendors always round fuel surcharges, which PO formats are real, which "invoice" is actually a rate confirmation in a trench coat. The bus factor was one, and the bus was a seven-hundred-invoice week.
What 40 hours actually looked like
We shadowed the manual flow for two days before writing any code, a habit borrowed from every first ninety days in logistics worth doing. The anatomy of one invoice: open the PDF, find the vendor, find the invoice number (top right, except when bottom left), squint at the line items, retype into the TMS, notice the PO number is missing, dig through email for the rate confirmation, give up, flag it, move on. Repeat seven hundred times.
The time split surprised everyone. The straightforward majority took about three minutes each; call it thirty hours a week. The other ten went to exception archaeology: chasing missing POs, resolving duplicates that had already been keyed once, untangling the vendor who sends one PDF containing four invoices like a matryoshka doll of tedium. Exceptions were 15% of the volume, a quarter of the hours, and roughly all of the misery.
The build: how invoice processing automation actually works
Our build took about three weeks and had three parts, in descending order of glamour. First, extraction: every inbound document, whatever channel it arrived through, goes to the model with a prompt and a strict JSON schema for vendor, invoice number, date, line items, totals, PO. Second, validation: boring, beautiful deterministic code. Do line items sum to the subtotal? Does subtotal plus accessorials plus tax equal the total? Does the vendor exist in the TMS? Does the PO match a format this customer actually uses? Third, the review queue: one screen, extracted fields on the left, source PDF on the right, sorted by confidence.
Validation rules were where Angie's eleven years got written down. We spent two afternoons extracting her knowledge, which vendors round, which formats are real, which documents are secretly rate confirmations, and turned it into forty-odd checks. Those rules caught more trouble than the model ever made, because they also caught the vendors' errors: invoices whose own math didn't add up, which had previously been keyed as-is and argued about at month-end.
The first month in numbers
Thirty days in, on seven hundred invoices a week: 88% straight-through, meaning extracted, validated, and posted to the TMS with no human involved. 9% quick review, where Angie or her backup glanced at a flagged field, confirmed or corrected, and moved on in about twenty seconds. 3% genuinely weird: handwritten POs, scans of faxes, the matryoshka PDFs. Field-level accuracy on clean documents sat at 97%; document-level straight-through is the number that mattered, and 88% beat our 80% target for month one.
The hours went from forty to six. Not zero, six; anyone who promises you zero is selling something. The six hours were almost entirely the 3% plus a weekly spot-check audit of the straight-through stream, because trust without audits is just optimism with a login page.
What broke and how we fixed it
Three failures, each fixed inside a day. The coffee-stain scans: one carrier's driver photographed delivery documents next to, judging by the evidence, an open beverage. Fix: an intake quality check that flagged low-contrast images and auto-replied requesting a resend, which cut the problem by two-thirds in a week because drivers adapted instantly. The handwritten POs: one vendor's dispatcher wrote POs by hand on every invoice, confidently and illegibly. Fix: a per-vendor rule routing that vendor straight to human review, because we stopped asking the model to perform palm-reading. The duplicate edge case: vendors resend an invoice with REMINDER stamped on it, which the model faithfully extracted as brand new. Fix: a duplicate check on vendor plus invoice number plus amount, with near-duplicates flagged.
Notice that none of the fixes involved a better model. That's the recurring lesson of these builds, and of every honest postmortem of a failed prototype: the model is rarely the bottleneck. The workflow around it is.
Where the time went after
Angie got her Fridays back, and then something more interesting happened. Exception handling turned into vendor management: the system produced a weekly report of which vendors sent the worst documents, and for the first time the company had data in the "please fix your invoicing" conversations. Three vendors switched to native PDFs within two months, because it turns out vendors also hate their own invoices. Month-end close shrank by two days, because the arguing-about-math moved from the end of the month to the moment of receipt.
And the spreadsheet Angie kept on the side, the shadow ledger she didn't entirely trust the TMS to replace, quietly died the way every spreadsheet empire eventually should: not by decree, but by the system earning it. Next on her list is the rate confirmations. She made the list on a Friday.