# How to do a three-way match in accounts payable with AI

> A three-way match compares three documents before an invoice is paid: the purchase order (what you agreed to buy, and at what rate), the goods receipt note (what actually arrived) and the vendor's invoice (what you are asked to pay). Pay only the quantity you received, at the rate you agreed. Anything above that is held, and you raise a debit note for the difference.

Source: https://www.zerogrunt.ai/guides/what-is-three-way-match · By ZeroGrunt team, ZeroGrunt · Updated 2026-11-02

## The three documents

| Document | Who makes it | What it tells you |
|---|---|---|
| Purchase order (PO) | You, before buying | The item, the quantity and the rate you agreed |
| Goods receipt note (GRN) | Your stores or warehouse | What actually arrived, and when |
| Vendor invoice | The vendor | What the vendor asks you to pay |

An invoice passes the match when the quantity billed is no more than the quantity received, and the rate billed is no more than the rate on the PO. Taxes and totals must follow from those two.

## What to compare, line by line

1. **Vendor.** The invoice is from the vendor on the PO, with the same GSTIN.
2. **Item.** Each billed line maps to a PO line and a GRN line.
3. **Quantity.** Billed quantity is not more than received quantity, and not more than what is still open on the PO.
4. **Rate.** Billed rate is not more than the PO rate.
5. **Tax.** The tax type fits the two states on the invoice: IGST between states, CGST and SGST within one.
6. **Total.** The invoice total equals quantity times rate plus tax, line by line.

Most teams allow a small tolerance for rounding, set by policy. Anything above it is held.

## A worked example

A footwear vendor invoices 1,200 pairs of canvas shoes. The total is ₹19,88,000.

| | PO | GRN | Invoice |
|---|---|---|---|
| Pairs | 1,200 | 1,160 | 1,200 |
| Rate on 40 of the pairs | ₹1,650 | | ₹1,850 |

Two things fail:

- **40 pairs never arrived.** 1,200 billed, 1,160 received. At the PO rate that is 40 × ₹1,650 = ₹66,000.
- **40 pairs are billed above the PO rate.** ₹200 a pair over, 40 × ₹200 = ₹8,000.

You pay ₹19,14,000, the 1,160 pairs you received at ₹1,650. You raise a debit note for ₹74,000 and ask the vendor for a credit note.

## What to do when an invoice fails

- **Short receipt.** Pay for what arrived. Raise a debit note for the rest, or wait for the balance if it is still coming.
- **Rate above the PO.** Pay the PO rate. Raise a debit note for the difference, or get the PO amended if the new rate was agreed.
- **No GRN yet.** Hold the invoice and ask stores. Paying before receipt is how advances get lost.
- **Invoice for another business unit.** Send it back before it posts, not after.

## Why it breaks at month end

Most invoices arrive between the 25th and the 5th. The match is done by hand, line by line, under time pressure, and an invoice that looks fine on screen gets passed. The gap shows up months later as a vendor dispute, when the vendor's ledger and yours no longer agree.

The fix is to match every invoice the day it lands, and to raise the debit note the same day. A vendor who hears about a short receipt the same week sends a credit note. A vendor who hears about it three months later disputes it.

## How to do it with AI

1. Vendors keep emailing invoices to your AP inbox, as they do today.
2. The AI reads every line and matches it to the PO and the GRN.
3. Anything that does not tally is held, with the debit note drafted.
4. When it is unsure, it emails you one question. Approve, and your reply becomes a rule.
5. Matched invoices post to your ERP. You get one email a day.

This is how Agent Zero works.

## Questions people ask next

### What is a three-way match in accounts payable?

A three-way match compares three documents before an invoice is paid: the purchase order (what you agreed to buy, and at what rate), the goods receipt note (what actually arrived) and the vendor's invoice (what you are asked to pay). Pay only the quantity you received, at the rate you agreed. Anything above that is held, and you raise a debit note for the difference.

### Is a three-way match required by law in India?

No. It is an internal control, not a legal rule. Auditors expect it for purchases made against a PO, because it is the main check that you paid only for goods you received at the agreed rate.

### What is the difference between a two-way and a three-way match?

A two-way match compares the invoice with the PO only: rate and quantity ordered. A three-way match adds the goods receipt, so you also check that the goods actually arrived. Services with no receipt are often two-way matched.

### What is a four-way match?

A three-way match plus an inspection or quality report, so you pay only for goods that passed inspection, not just goods that arrived.

### Who raises the debit note when an invoice fails the match?

The buyer raises a debit note to tell the vendor what it will not pay. Under GST, the tax on the invoice comes down only when the vendor issues a matching credit note, so ask for one.
