AI-Powered Accounts Payable Automation Case Study
A BPO company moves accounts payable from inbox-and-spreadsheet to an AI-assisted, audit-ready workflow
The result: AI (Claude) extracts ~100 vendor invoices a month across ~13 legal entities and suggests GL code, entity and department from posting history, so a team of about ten accountants reviews and approves instead of keying, with every change in an append-only audit trail.
What Was Built: The AI-Powered AP Platform
A multi-client AP platform that ingests invoices from email and manual upload, extracts the data with an LLM (Claude by default), and tracks every invoice from receipt through ERP posting
A review screen that puts the source document next to the extracted fields, with empty fields flagged
A two-stage human review: extraction review by junior accountants, posting review by senior accountants
AI suggestions for entity, GL code and department, derived from the client's own posting history
Automated vendor bill posting to NetSuite, with a step-by-step recorded run for every automated posting
An append-only audit trail enforced at the database level
At a glance
- Industry
- Business process outsourcing, accounts payable
- Scale
- ~13 legal entities, ~100 invoices a month
- ERP
- NetSuite (REST API plus recorded browser automation)
- Built with
- Python / FastAPI, PostgreSQL, Next.js, Celery + Redis, Claude API
- Product
- Multi-client AP automation platform
The Customer
The customer is a BPO company that runs accounts payable for several clients. Its first client on the platform is a renewable energy operator with roughly 13 entities in a holding-company hierarchy and around 100 vendor invoices a month. The BPO team of about ten accountants handles intake, data entry, approvals, posting and payment reconciliation for that client, and expects to repeat the model for more clients.
The Problem
Invoices arrived in shared inboxes and vendor portals and were handled by hand. Accountants downloaded attachments, keyed vendor, date and amount into NetSuite, chased asset managers for approval over email, and tracked status in a spreadsheet.
That process had three costs:
- Time and errors. Manual keying of every field, across many vendor layouts, caused rework and duplicate entries.
- Weak audit evidence. Approvals lived in email threads, and the spreadsheet could be edited. Year-end auditors ask whether any entry was ever changed, and the honest answer was hard to prove.
- No scalable way to onboard clients. Each new client meant another inbox, another spreadsheet and more headcount.
The Solution: AI Where It Helps, Humans Where It Matters
The team built one shared platform with a thin per-client layer for the parts that differ, such as extraction fields and ERP field mapping. A new client is a code module, not a new product.
- Received
- Extracted
- Reviewed
- Pending approval
- Approved
- Posted to the ERP
One pipeline, five steps.
Invoices are ingested, extracted, reviewed, approved by the client, then posted to the ERP. Each invoice moves through a defined lifecycle (received, extracted, reviewed, pending approval, approved, posted to the ERP) and illegal jumps are blocked by a state machine.
AI where it helps, humans where it matters.
Claude reads each document and returns structured fields, and empty fields are highlighted for the reviewer. GL code, entity and department are not printed on invoices, so a separate suggester proposes them from historical postings and explains its basis. Every correction is stored next to the original value, and corrections are turned into vendor-specific extraction instructions so later invoices from that vendor extract better.
Hard business rules in code.
The posting workflow refuses disputed invoices. Failed postings leave the invoice in its approved state with the error logged, and retries are idempotent. A reference to the asset manager's approval email is stored with the invoice. Users only see the projects they are assigned to, enforced on every query.
Audit by design.
Every change is written to an append-only event log, and identifying fields such as vendor and invoice number cannot be overwritten. Corrections add a new value next to the original, and database triggers reject updates and deletes on the audit tables. User actions in the workflow log who, what, when and from which IP.
See the AI in Action
1. Email ingestion log.
Every message from the AP inbox appears with its connector, project, attachment count and current invoice status, and the detail panel adds the project. Selecting a row shows the original email body next to a link to the extracted invoice, so reviewers can always trace a record back to its source.
2. Extraction review.
The original invoice sits on the left and the extracted fields on the right. Empty fields are flagged in red, each field can be corrected inline, and duplicate invoices are caught with a confirm step before anything moves forward. Approving moves the invoice to client approval, and the asset manager's reply is picked up from the inbox.
3. Posting review (vendor bill).
A senior accountant checks the extracted vendor and line items, plus the subsidiary and GL account suggested from history, then publishes. Required fields are marked and the bill total is calculated from the line items.
4. Automation run.
Posting to the ERP is driven step by step, and every step is recorded with a timestamp, status and screenshot. Saved flows are replayed automatically, and the reviewer can step through any single screenshot to see exactly what was entered, which makes failures easy to diagnose.
5. Published invoice with audit trail.
The final record shows the invoice, posting fields, ERP reference and line items beside a timeline of every event: received, extracted, reviewed, approval requested, approved, posted. Comments can be added at any stage.
The Challenges We Faced Building AI for AP
Fields that are not on the document.
GL code, entity and department depend on accounting judgment. The team treated these as a suggestion problem, not an extraction problem, seeded the suggester with historical postings, and sent every suggestion through a person for confirmation.
Messy, inconsistent invoices.
Layouts, currencies, date formats and multi-page documents vary widely. A review screen with the source document beside the extracted fields lets reviewers verify quickly and correct only what is wrong.
Immutability versus real life.
Accountants do make mistakes, and the audit requirement says nothing may be edited. The answer was to store the original and the correction together and write every change to an append-only event log.
Duplicates and re-sent invoices.
Vendors resend the same invoice by email. Duplicate detection surfaces matches and requires an explicit confirmation instead of silently dropping or double-posting.
A fragile ERP step.
A half-posted bill is worse than none. Failures leave the invoice in its approved state with the error logged, retries are idempotent, and each automated run is recorded step by step so problems are easy to diagnose.
Cost visibility for AI.
Every model call goes through one client that logs tokens, cost and the full request and response, scoped by customer and project, so AI spend can be reported per feature and per client.
Technology Stack
Built with Python / FastAPI, PostgreSQL, Next.js, Celery + Redis, Claude API.
| Layer | Technology |
|---|---|
| Backend | Python, FastAPI, async SQLAlchemy |
| Database | PostgreSQL with immutability triggers on audit tables |
| AI extraction | Claude API (provider configurable) |
| Field suggestion | Historical pattern matching |
| Queue | Celery and Redis |
| Storage | S3 or MinIO for documents and LLM logs |
| ERP | NetSuite (REST API and recorded browser automation) |
| Microsoft Graph (Outlook) | |
| Frontend | Next.js, React, TanStack Query, Tailwind, shadcn/ui |
Get In Touch