Purchase Order, GRN and Invoice Three-Way Matching
Read supplier invoices, match every line to POs and GRNs in SAP or Tally, check GST details and tolerances, propose debit notes and send only real exceptions to accounts payable.
- Capability:
- Document Intelligence
- Industry:
- Manufacturing
Who it is for
- CFO or Finance Controller
- Accounts Payable Manager
- Purchase Head
- Stores and Inward Manager
The problem
A plant receives supplier invoices as PDFs, scans and email attachments, often before or after the material is received and inspected. Accounts payable has to tie each invoice line to the PO and to the GRN quantity that quality accepted, then sort out short supply, rejections and price differences before anything is posted.
Many formats, many lines
Each supplier's invoice layout differs, and one invoice can carry dozens of lines with HSN codes, tax splits, freight and packing charges.
Partial deliveries and split GRNs
One invoice may cover several GRNs, or one GRN several invoices, which makes line-level matching slow and error-prone.
Variances found late
Price or quantity differences and QC rejections surface after posting, leading to debit notes, disputes and strained supplier relations.
GST credit at risk
Invoices with a wrong GSTIN or tax rate, a missing IRN, or no entry in GSTR-2B put input tax credit at risk if they are not caught early.
What we build
We build a matching pipeline that reads each supplier invoice, extracts header and line items, and matches them to open PO lines and accepted GRN quantities pulled from SAP or Tally. It handles partial deliveries, several GRNs per invoice and unit-of-measure conversions. Rules check price and quantity against your tolerances, compare GST details with the supplier master and e-invoice data, and flag possible duplicates. Clean invoices are prepared as parked documents or draft vouchers for AP to post. Exceptions go to a queue with a reason code, plus a proposed debit note where quantity was short or rejected.
- Extracts invoice header, line items, HSN codes, tax splits, freight and TDS-relevant fields
- Matches many-to-many across invoice lines, PO lines and GRNs, including unit conversions
- Applies price and quantity tolerances per supplier or material group
- Checks GSTIN, tax rate and place of supply, and reads the e-invoice QR code where present
- Detects duplicate invoices by supplier, number, date and amount, including re-sent scans
- Proposes debit notes for short supply, QC rejections and price differences with evidence attached
How it works
- 01Capture invoicesInvoices arrive from the AP mailbox, a supplier portal or scans at the inward gate and are grouped by supplier.
- 02Extract and validateOCR and an LLM extract header and line data, each field with a confidence score and page reference.
- 03Match to PO and GRNLines are matched to open PO lines and accepted GRN quantities from SAP or Tally.
- 04Apply tolerance and GST checksPrice, quantity, tax and duplicate rules run, and each failure gets a reason code.
- 05AP review of exceptionsAP sees the invoice, PO and GRN side by side and resolves the exception or escalates it to purchase.
- 06Prepare for postingMatched invoices are created as parked documents or draft vouchers, with debit note proposals where needed.
Architecture
- Intake
- AP mailbox and supplier portal connectors
- Scan upload from the inward gate
- Supplier identification from GSTIN
- Extraction
- OCR with table detection
- LLM extractor with invoice schema
- E-invoice QR decoder
- Matching and rules
- PO and GRN fetch from SAP or Tally
- Many-to-many line matcher
- Tolerance, GST and duplicate rules
- Review
- AP exception queue with side-by-side view
- Debit note proposal generator
- Posting and audit
- SAP BAPI or IDoc adapter, or Tally XML import
- Audit log of every match and reviewer change
Inputs and outputs
Inputs
- Supplier invoices as PDF, scan or e-invoice
- Open purchase orders and schedule lines from SAP or Tally
- GRN and QC acceptance data, including rejected quantities
- Supplier master with GSTIN and bank details
- Tolerance rules by supplier or material group
- GSTR-2B data from your GST tool
Outputs
- Line-level match result for each invoice
- Parked invoices or draft purchase vouchers ready for AP posting
- Exception queue with reason codes and evidence
- Proposed debit notes for short supply, rejections and price differences
- Audit trail of matches, overrides and approvals
Where people stay in control
AP executives resolve every exception and post every invoice; the system prepares documents and never posts or releases payment. Buyers decide price variances, and stores or quality confirm disputed quantities before a debit note is raised.
Integrations
- SAP S/4HANA or ECC (MM and FI) via BAPI, IDoc or API
- Tally Prime via XML or ODBC
- GST compliance tool or GSTN data for GSTR-2B and e-invoice details
- AP mailbox and supplier portal
- Document management system for the invoice archive
Guardrails
- No auto-posting or payment release; AP approves every document
- Uncertain fields and lines flagged, never silently passed
- Bank detail changes printed on an invoice are flagged, not accepted
- Duplicate checks across suppliers and periods
- Every value linked to its source page and every override logged
Compliance notes
- Checks support GST input tax credit conditions by comparing invoice data with GSTR-2B and e-invoice details; ITC decisions stay with your tax team.
- The audit trail helps evidence internal financial controls over purchase-to-pay for statutory audit.
A typical pilot
Duration: 3 weeks
Invoices from the top suppliers of one plant for one month, matched against SAP or Tally data and compared with how AP actually processed them.
Deliverables
- 01Extraction schema and tolerance rules agreed with AP and purchase
- 02Working pipeline on real invoices from your mailbox
- 03AP exception queue
- 04Match accuracy report against AP's actual postings
- 05Integration design and cost estimate for roll-out
What we measure
- Line-match accuracy
- Match results compared with how AP matched the same invoices.
- Share of invoices needing review
- Invoices routed to the exception queue, broken down by reason code.
- Exception reason accuracy
- AP feedback on whether each flagged reason was correct.
- AP handling time per invoice
- Timed on a sample processed with and without the pipeline.
Built on related work
Claims reconciliation platform
Packaged-food brand (anonymised)
OCR and LLM platform that matches distributor claims spreadsheets against invoices and proofs, applies policy rules, detects duplicates, recalculates amounts, routes uncertain lines to an exception queue and keeps an audit trail. Finance keeps final approval.
FAQs
01We use SAP in one plant and Tally in another. Does that matter?
No. The matching logic is the same; only the adapters differ. We read POs and GRNs from each system and write back parked documents or draft vouchers in the format that system expects.
02What about invoices with handwritten corrections or poor scans?
They are read like any other invoice, but low-confidence fields are flagged for AP to confirm. The pilot report shows how many invoices needed field confirmation and why.
03Can it handle service invoices and job-work charges without a GRN?
Yes, as two-way matches against the PO or a service entry sheet, with their own rules. We usually start with material invoices and add service invoices once the core flow is stable.
04Will our supplier and pricing data leave our environment?
It does not have to. The pipeline can run in your cloud tenancy or on-premise, and we use model endpoints that do not retain or train on your data.
Related use cases
- Manufacturing
Supplier Quality Certificate Verification
Check mill test certificates and certificates of conformance against your material specs, tie heat numbers to GRNs, and flag out-of-spec, missing or reused certificates for IQC.
- Retail, D2C & Quick Commerce
Vendor Invoice and Credit Note Reconciliation
Match vendor invoices, GRNs, RTVs and credit notes, recalculate what each vendor owes you from the agreements, and chase missing or short credit notes with evidence.
- Accounting, Audit & Consulting
GST Return Reconciliation (GSTR-2B vs Books)
Match GSTR-2B and 2A data against the purchase register invoice by invoice, find ITC at risk before GSTR-3B is filed, and draft supplier follow-ups for approval.
- Logistics & Supply Chain
Freight Invoice Audit Against Rate Contracts
Audit every carrier or transporter freight bill against your rate contracts, shipment data and PODs, recalculate each charge and flag overbilling, duplicates and unsupported surcharges.

Founded by Akhilesh Mittal. 8 years building a security platform for a New Zealand company. IIT ISM Dhanbad and IMT Ghaziabad. Builds production agentic AI.
Start with one line, one document or one region
Book a discovery call and we will pick a narrow pilot with your quality, finance or sales team, run it alongside your current process and report what we measured.