AI Case Study

Inside the Deal: How We Automated Invoice Processing for a Lagos Logistics Firm in 6 Weeks

person
Corespec Team
Apr 2025 · 5 min read
African tech professionals collaborating at computers

The Problem

A mid-sized Lagos-based logistics firm was processing 800 to 1,200 supplier invoices per month. Four finance staff members spent 60% of their working hours manually keying invoice data — vendor name, invoice number, line items, amounts, VAT — into their accounting system. Every invoice arrived differently: some as PDF email attachments, others as WhatsApp photos of physical documents, others as scanned images of various quality.

The error rate was running at 11% — meaning more than one in ten invoices contained at least one data entry mistake. Month-end reconciliation, where those errors had to be found and corrected, took three full working days. The company was growing at 40% year-on-year, which meant the manual bottleneck was getting worse, not better. Adding more finance staff to keep up was not a sustainable strategy.

11% Pre-automation invoice error rate — meaning more than 1 in 10 invoices contained data entry mistakes that had to be found and corrected at month-end.

Week 1–2: Audit & System Design

Corespec's AI team began with a process audit — not a technology evaluation. Before writing a single line of code, we needed to understand exactly how invoices arrived, how they were validated, where errors occurred, and what the downstream consequences of those errors were. This is a step many technology providers skip, and it is usually why their implementations underperform.

The audit revealed several critical findings:

  • 73% of invoices came from recurring vendors in predictable formats — ideal candidates for AI extraction with high confidence
  • Invoice arrival channels were: email PDF (52%), WhatsApp image (31%), scanned document (17%)
  • The highest error rates occurred on handwritten or low-resolution scanned documents from smaller vendors
  • Validation currently happened manually — each invoice was checked against a purchase order and vendor record by a staff member
  • The accounting system had a functional API that allowed programmatic posting of transactions

Armed with this data, we designed the pipeline: document ingestion from all channels → image pre-processing and OCR enhancement → LLM-powered field extraction → validation rules engine → confidence scoring → either automatic posting or human review queue → accounting system API push.

Week 3–4: Build & Integration

We used GPT-4o's vision capability as the core extraction engine. Unlike traditional OCR systems that rely on fixed template matching, GPT-4o can extract structured data from invoice images regardless of layout, font, language, or quality — understanding context the way a human reviewer would. A vendor writing "Unit Price" versus "UP" versus "Rate/Unit" is handled correctly without special configuration for each case.

The technical architecture we built:

  • An email parser and WhatsApp Business API listener that captured incoming invoices and routed them to the processing queue
  • An image pre-processing step using Python's Pillow and OpenCV to enhance low-quality scans before sending to the model
  • A Python FastAPI backend handling orchestration, state management, and the validation rules engine
  • Extracted data validated against the vendor master record (correct vendor name, registered VAT number) and open purchase orders
  • A confidence scoring system: high-confidence extractions go directly to accounting API posting; low-confidence items route to a human review interface
  • A simple web dashboard showing the processing queue, review items, and processing statistics

Week 5–6: Testing, Training & Go-Live

Before going live, we ran the system against 300 historical invoices — chosen to include the full range of document types, quality levels, and vendor formats the firm actually receives. This was a rigorous accuracy benchmark, not a cherry-picked demo.

Results on the test set: 96.4% field-level accuracy on the first automated pass — meaning for every 100 individual data fields extracted, 96.4 were correct without any human review. After the human review step handled low-confidence items, the combined accuracy reached 99.1%.

The finance team received two days of training — not on the AI system's internals, but on how to use the review dashboard efficiently, how to handle exception cases, and what to do when an invoice type the system had not seen before came through. Go-live was on week 6, on schedule and within the agreed budget.

99.1% Combined field-level accuracy after automated extraction plus human review — compared to an 89% accuracy rate under the manual process.

Results at 90 Days

At the ninety-day mark, the results were measured rigorously against the pre-automation baseline. The numbers exceeded the business case we had presented at the start of the project.

  • Manual data entry reduced by 80% — from four staff members spending 60% of their time on data entry, to less than one hour per person per day managing the review queue
  • The finance team redirected their recaptured time to supplier relationship management, cash flow analysis, and cost control — higher-value work that had previously been crowded out by data entry
  • Month-end close time reduced from 3 full working days to 4 hours — a 94% reduction driven by the elimination of data entry error correction
  • Invoice error rate dropped from 11% to 0.9% — a 12x improvement in accuracy
  • Processing capacity effectively unlimited — the system can handle 5,000 invoices per month as easily as 1,000, with no additional headcount required

The firm is now in the design phase for the next automation: AI-powered purchase order matching, where incoming invoices are automatically matched to open POs and flagged if quantities or prices deviate from agreed terms. The foundation built in the first project makes this next phase significantly faster and cheaper to implement.

This is the compound effect of AI automation done correctly: each implementation creates a platform for the next one. The businesses that start now will be running on a fundamentally more efficient operational foundation than those that wait.

Could This Work for Your Business?

If your finance or operations team is spending significant time on manual data entry, document processing, or repetitive validation tasks — there is likely an AI solution that can deliver similar results. Book a 30-minute discovery call with our AI team.

Get Started →