# Invoice Processing Automation

> Read supplier invoices, validate them and post for approval

| | |
|---|---|
| **Category** | Finance |
| **Type** | API Pipeline |
| **Difficulty** | Intermediate |
| **Automation** | Mostly automated |
| **Runtime** | ~6 min |
| **Est. cost** | $0.22 |
| **Version** | 1.0.0 |

## Purpose

Accounts payable is manual keying plus exception handling. This pipeline does the keying — supplier, dates, totals, line items, tax — validates it against the PO and supplier master, and posts the result.

The economics come from confidence routing: high-confidence fields post automatically, uncertain ones queue for a human. That is what makes it work at volume without becoming a rubber stamp.

## Problems solved

- Manual keying is slow and error-prone at volume
- Every supplier uses a different invoice layout
- Mismatches against the PO are found late, after approval
- No audit trail linking a posted figure to the document it came from

## Benefits

- Handles layout variation that template matching cannot
- Validates against the PO before anything reaches approval
- Per-field confidence targets human effort where it matters
- Every figure traceable back to its position in the document

## Limitations

- Unusual layouts still need examples to reach good accuracy
- Multi-page line-item tables that span breaks are the common failure
- Handwritten annotations are unreliable
- Regulated environments need an audit trail of every correction

## Success metrics

- Straight-through processing rate
- Field-level accuracy on a sampled audit
- Average time from receipt to approval-ready
- Cost per invoice processed

## Prerequisites

- **Account** — Document AI provider
- **Api key** — LLM API key
- **Account** — Accounting system with API
- **Permission** — Data residency review

## AI tools used

- **ChatGPT**

## Steps

### 1. Watch the AP inbox

Trigger on new mail with a PDF or image attachment; deduplicate against already-processed documents.

- _Time:_ 1 min

### 2. Classify the document

Confirm this is an invoice rather than a statement, credit note or remittance — each needs different handling.

- _Model:_ GPT-4o
- _Time:_ 1 min

> ⚠️ Statements misclassified as invoices cause duplicate payments — this step is not optional

### 3. Extract the fields

Pull supplier, invoice number, dates, currency, subtotal, tax, total and every line item, each with a confidence score.

- _Tool:_ Nanonets
- _Time:_ 1 min

### 4. Validate against PO and supplier

Check arithmetic, match the PO, verify supplier and bank details, and flag duplicates.

- _Model:_ GPT-4o
- _Time:_ 1 min

```text
Validate this extracted invoice against the purchase order and supplier record.

Invoice: {{invoice_json}}
Purchase order: {{po_json}}
Supplier record: {{supplier_json}}

Check and report on:
1. Does line total + tax equal the stated total?
2. Do line items match the PO in description, quantity and price?
3. Do the supplier name and bank details match the master record exactly?
4. Is this invoice number already recorded for this supplier?

Return JSON with a pass/fail per check and a short reason for each failure. Flag ANY bank detail mismatch as critical.
```

> ⚠️ A changed bank detail is the classic invoice-fraud signal — always route it to a human, never auto-approve

### 5. Route by confidence

Fully validated, high-confidence invoices post straight through; anything uncertain or failing a check goes to the exception queue.

- _Time:_ 1 min

### 6. Human exception review

A finance user reviews only the flagged fields, side by side with the source document.

- _Time:_ 1 min

## FAQ

**What straight-through rate is realistic?**

With a stable supplier base and clean scans, a high proportion posts without touch. New suppliers and unusual layouts drop it until they have been seen a few times.

**How does this prevent invoice fraud?**

Step 4 explicitly checks bank details against the supplier master and flags any change as critical. That single check catches the most common payment-diversion attack — but only if the flag routes to a human.

**Do we need a dedicated document AI service?**

For volume, yes. General vision models read invoices well but do not give reliable per-field confidence scores, and confidence routing is what makes the economics work.

---

_Exported from AIToolsay — https://invitationbuddy.com/workflows/invoice-processing-automation_
