---
title: "Three Way Invoice Match"
method: POST
path: "/v1/tools/match_invoice_three_way"
tags: ["compliance_mandate", "accounts-payable", "three-way-match", "invoice", "purchase-order", "goods-receipt", "duplicate-detection", "integer-minor-units", "mcp:match_invoice_three_way"]
---

# Three Way Invoice Match

`POST /v1/tools/match_invoice_three_way`

## Request

- Base URL: `https://ainumbers.co`
- URL: `https://ainumbers.co/v1/tools/match_invoice_three_way`
- Auth: none declared

Matches one invoice against its purchase order and its goods receipt and decides whether the invoice can be paid: explicit line pairing (declared po_line, then exact sku, then a free same-number PO line; no fuzzy text matching), a fixed first-apply line-verdict order (quantity over received, receipt missing as a two-way flag, quantity over ordered, price outside the declared basis-point tolerance with the boundary passing), integer minor-unit totals with half-up tax from one declared rate, and duplicate-invoice screening against same-vendor priors on the normalized invoice number, same total inside the declared day window, or the same PO. Fractional quantities and sub-minor-unit prices are refused with a named reason, never rounded; one currency per invoice; no tax-jurisdiction logic; day differences come from integer days-from-civil arithmetic with no clock.

**Tool URL:** https://ainumbers.co/chaingraph/art-701-three-way-invoice-match.html
**AP2/Policy Mandate export:** yes

## Request body

- object
  - `currency` string, required
  - `invoice` object, required
  - `purchase_order` object
  - `goods_receipt` object
  - `vendor_terms` object, required
  - `prior_invoices` unknown[]
    - unknown
  - `duplicate_window_days` integer, required

## Response `200`

Successful tool execution result

- object
  - `outcome` 'match' | 'mismatch' | 'no_po' | 'refused'
  - `refusal_reason` string
  - `po_number` string, nullable
  - `receipt_id` string, nullable
  - `lines` object[]
  - `totals` object, nullable
  - `mismatches` object[]
  - `duplicates` object[]
  - `domain_errors` object[]
  - `hold_recommended` boolean
  - `scope_note` string

---

[API](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite.md) · [All operations](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/llms.txt) · [OpenAPI document](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/revisions/b462e4f5bb28?raw)
