FinTech

Invoice Reconciliation
AI

When an invoice arrives — by email, API, or ERP — this GPT-4o + n8n pipeline extracts every field, runs a 3-way match against the PO and goods receipt, flags discrepancies to the right team, and auto-posts matched invoices to the AP ledger in minutes.

90%

auto-matched invoices

zero manual review

<2 min

per invoice cycle

vs. 20 min manual

100%

discrepancy visibility

real-time flagging

0

duplicate payments

dedup logic enforced

GPT-4o Visionn8nNetSuiteXeroPython
← Browse all workflows

Typical build: 3–4 week sprint · Fixed price · Zero delivery risk

Live workflow — triggers on invoice receipt
Invoice IngestEmail / API / ERPOCR ExtractGPT-4o VisionMatch Engine3-way matchFlag / EscalateDiscrepancy logicAuto-PostERP / Xero / NetSuite12345

Trigger

Invoice received

Avg runtime

<2 minutes

Error handling

Auto-retry ×3

The problem

Why AP teams spend days on invoices that should take minutes

Manual matching is slow and error-prone

AP teams manually compare invoice fields against PO data line by line. At volume, this takes days. Human error rates on manual matching run at 1–3% — each error risks duplicate payment, missed discounts, or late payment penalties.

Discrepancies get buried in email threads

When an invoice doesn't match a PO, the resolution process becomes an email chain between AP, procurement, and the supplier. Without structured routing, discrepancies age in inboxes for weeks — causing late fees and strained supplier relationships.

No structured AP performance data

Finance teams can't easily report on match rates, average processing time, discrepancy volumes, or early payment discount capture. This makes it impossible to identify supplier or process problems before they become material.

How it works

Every step, explained

This is the actual workflow Kovil AI builds and deploys — not a diagram. Here's what runs inside every node.

1
Invoice Ingestion (Email / API / ERP)

Invoices captured from every source automatically

n8n monitors a dedicated invoice email inbox, ERP webhooks (SAP, Oracle, NetSuite), and supplier portal APIs simultaneously. All incoming invoices — PDF attachments, XML EDI files, or structured API payloads — are normalised and queued for processing. Duplicate invoice detection runs at this stage using invoice number + supplier ID as a composite key, rejecting any duplicate before it enters the pipeline.

Email parserERP webhookDedup logicn8n
2
GPT-4o Vision OCR

All invoice fields extracted into structured JSON

GPT-4o Vision processes each invoice image or PDF and extracts all required fields into a structured JSON: invoice_number, supplier_name, supplier_id, invoice_date, due_date, line_items (array with description, qty, unit_price, total), subtotal, tax_amount, total_amount, currency, and payment_terms. The extraction handles multi-page invoices, tables, and non-standard layouts. Confidence scores below 85% trigger a manual review flag.

GPT-4o VisionStructured JSONMulti-page PDFConfidence scoring
3
3-Way Match Engine

Invoice matched against PO and goods receipt record

The match engine queries the ERP for the corresponding Purchase Order and Goods Receipt Note (GRN) using the supplier ID and PO number extracted from the invoice. It performs a 3-way match: invoice amount vs. PO amount, invoice line items vs. PO line items, and received quantities vs. invoiced quantities. Tolerances are configurable per supplier and invoice type (e.g. ±2% for freight invoices). Perfect matches are immediately routed for auto-payment posting.

3-way matchConfigurable tolerancesERP PO lookupGRN matching
4
Discrepancy Engine

Discrepancies categorised, flagged, and routed for resolution

Invoices that fail the 3-way match are categorised by discrepancy type: price variance (invoice price ≠ PO price), quantity variance (invoiced qty ≠ received qty), duplicate invoice, missing PO, or unknown supplier. Each category has a configured resolution owner — price variances go to procurement, quantity variances go to warehouse, duplicates go to AP. An automated email is sent to the responsible party with the exact discrepancy details and a link to the resolution portal.

Discrepancy classificationResolution routingAutomated emailSLA tracking
5
ERP Auto-Post

Matched invoices automatically posted to the AP ledger

Invoices that pass the 3-way match are automatically posted to the accounts payable ledger in the ERP (NetSuite, SAP, Xero, QuickBooks Online). n8n makes the ERP API call with all extracted and validated invoice data, receives the posting confirmation and journal entry number, and stores these back in the invoice processing log. Payment is scheduled according to the invoice payment terms with early payment discount logic if configured.

NetSuite APIXero APISAP connectorPayment scheduling
6
Reporting & Audit Log

Full reconciliation report generated and audit trail maintained

n8n generates a daily reconciliation summary: total invoices processed, match rate, total discrepancies by type, total value auto-posted, and outstanding resolution items with age. The report is emailed to the AP manager and CFO. Every invoice — whether auto-posted or escalated — is logged with extraction data, match result, ERP posting confirmation, and all system actor actions for audit and regulatory purposes.

Daily AP summaryImmutable audit logCFO reportingCompliance trail
Tech stack

Every tool in the workflow

GPT-4o Vision

Invoice OCR & extraction

Extracts all invoice fields from PDFs and images including tables, multi-page documents, and non-standard supplier layouts with confidence scoring.

n8n

Workflow orchestration

Manages invoice ingestion from all sources, 3-way match logic, discrepancy routing, ERP posting, and reporting — all in a single configurable pipeline.

NetSuite / SAP / Xero

ERP integration

PO and GRN lookup for matching; AP ledger posting for approved invoices. Supports NetSuite, SAP, Oracle, Xero, and QuickBooks Online.

Python

Match engine & business rules

Runs the 3-way match logic, tolerance calculations, discrepancy classification, and deduplication against configurable business rules.

Gmail / Outlook

Invoice ingestion & alerts

Monitors supplier invoice inbox; sends discrepancy resolution requests and daily AP summary reports to responsible parties.

Airtable / PostgreSQL

Processing log & audit trail

Stores every invoice processing event: extraction output, match result, ERP posting confirmation, and resolution history.

What we build

A 3–4 week sprint. Production ready.

Kovil AI scopes, builds, tests and deploys this workflow end-to-end. You don't touch n8n until it's live and processing real invoices.

  • Invoice ingestion from email inbox, ERP webhooks, and supplier APIs
  • GPT-4o Vision prompt engineered for your invoice formats
  • Duplicate detection logic configured for your supplier base
  • 3-way match engine with your PO tolerance rules
  • Discrepancy routing to procurement, warehouse, and AP teams
  • ERP auto-posting integration (NetSuite, SAP, Xero, QBO)
  • Daily AP summary report and CFO dashboard
  • Immutable audit log for all processing decisions
  • 2-week handover: runbook, credentials, support access
Sprint timeline3–4 weeks
Week 1Scoping & ERP access
  • ERP API credentials & PO access
  • Invoice format mapping
  • Email inbox setup
Week 2OCR & match engine build
  • GPT-4o extraction prompt tuning
  • 3-way match logic implementation
  • Discrepancy routing rules
Weeks 3–4ERP integration & deploy
  • AP ledger auto-posting integration
  • Reporting & audit log setup
  • Production deployment & runbook
FAQ

Common Questions

Which ERP systems does this integrate with?

The standard build supports NetSuite, Xero, and QuickBooks Online via native APIs. SAP and Oracle are supported via their REST API layers. For ERPs without direct API access, we can integrate via SFTP file exchange or a middleware connector. All ERP integrations are scoped and tested during the build sprint.

What tolerance levels can be configured for the 3-way match?

Tolerances are fully configurable per supplier, invoice category, and currency. Common configurations include ±2% for goods invoices, ±5% for service invoices, and absolute amount thresholds for high-value transactions. Tolerance rules are stored as admin-configurable parameters — no code changes needed to update them.

How does the system handle invoices with no PO?

Non-PO invoices (e.g. utilities, subscriptions, professional services) are flagged as a separate category and routed to the appropriate budget owner for manual approval. Once approved, they are automatically posted to the correct cost centre in the ERP. A configurable whitelist of approved non-PO suppliers can bypass the manual step.

Can this handle multi-currency invoices?

Yes. Currency is extracted from the invoice and the match engine applies the appropriate exchange rate from the ERP at the time of matching. Variance calculations account for exchange rate differences within a configurable tolerance. All amounts are stored in both original currency and functional currency in the audit log.

Ready to automate your AP process?

Book a 30-minute discovery call. We'll scope the reconciliation workflow for your ERP, supplier base, and invoice formats — fixed price, zero delivery risk.

Browse other workflows

Typical sprint: 3–4 weeks · Fixed-price · Fully managed delivery · Post-launch support included