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
Typical build: 3–4 week sprint · Fixed price · Zero delivery risk
Trigger
Invoice received
Avg runtime
<2 minutes
Error handling
Auto-retry ×3
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.
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.
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.
This is the actual workflow Kovil AI builds and deploys — not a diagram. Here's what runs inside every node.
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.
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.
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.
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.
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.
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.
Invoice OCR & extraction
Extracts all invoice fields from PDFs and images including tables, multi-page documents, and non-standard supplier layouts with confidence scoring.
Workflow orchestration
Manages invoice ingestion from all sources, 3-way match logic, discrepancy routing, ERP posting, and reporting — all in a single configurable pipeline.
ERP integration
PO and GRN lookup for matching; AP ledger posting for approved invoices. Supports NetSuite, SAP, Oracle, Xero, and QuickBooks Online.
Match engine & business rules
Runs the 3-way match logic, tolerance calculations, discrepancy classification, and deduplication against configurable business rules.
Invoice ingestion & alerts
Monitors supplier invoice inbox; sends discrepancy resolution requests and daily AP summary reports to responsible parties.
Processing log & audit trail
Stores every invoice processing event: extraction output, match result, ERP posting confirmation, and resolution history.
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.
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.
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.
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.
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.
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.
Typical sprint: 3–4 weeks · Fixed-price · Fully managed delivery · Post-launch support included