Skip to content

AI agents for finance: an invoice matching agent

AP spends its week matching invoices to orders by hand and chasing the ones that don't fit. This agent does the matching and flags the exceptions.

Last reviewed November 2026

App, built with Tray Helix

The short answer

AI agents for finance take over the matching, checking and chasing, and leave the decisions to people. An invoice matching agent is a working example: it reads each new supplier invoice, finds the purchase order and goods receipt it belongs to, and checks price, quantity and totals within your tolerances. Clean matches are proposed for approval to pay, and releasing an invoice is a tool marked for approval, so AP sees the exact invoice and amount first. Anything that doesn't match is flagged as an exception with the reason and the line that broke.

invoice-matching.helix-app.ai

Invoice Matching

126

Invoices this week

104

Matched

22

Exceptions

Matched, awaiting approval 9

INV-20931 · Brightline Supplies

PO-7741 · $4,210.00 · 3-way match

INV-20934 · Kestrel Freight

PO-7756 · $1,980.50 · 3-way match

Exceptions 22

INV-20927 · Orbit Packaging

Price 6% over PO, tolerance 2%

INV-20929 · Delta Office

Quantity 40 invoiced, 32 received

INV-20930 · Kestrel Freight

Possible duplicate of INV-20881

Approved to pay 95

INV-20918 · Brightline Supplies

Approved by A. Grant

A sketch of the week. Clean matches wait for approval to pay, and each exception says what broke.

What matters here

  • An invoice matching agent checks each invoice against its purchase order and receipt, and proposes clean matches for approval to pay.
  • Releasing an invoice for payment is a tool marked for approval, so nothing is paid on the agent's say-so.
  • Every exception carries a reason and the line that broke: price over tolerance, quantity short, no purchase order, or a possible duplicate.
  • Tolerances live in the app where finance can edit them, so the rules are visible and the agent applies them the same way every time.
  • The agent drafts the supplier query for an exception and never sends it, so what suppliers read stays with AP.

Who this is for

You run accounts payable or finance operations. You already have purchase orders and receipts in your ERP, and the work is the matching, the exceptions and the chasing.

How it works in practice

From an invoice arriving to it being paid or put in front of a person.

  1. 1

    An invoice arrives

    From the ERP, or from the AP inbox through a Tray workflow that reads the document and calls the app.

  2. 2

    The agent finds the order and receipt

    By PO number when the invoice has one, and by supplier, amount and lines when it doesn't.

  3. 3

    It checks the match

    Price, quantity and total, line by line, against the tolerances finance set.

  4. 4

    Clean matches wait for approval

    release_for_payment is marked for approval, so AP sees the invoice, the match and the amount before it is released.

  5. 5

    Exceptions get a reason

    Each one names the rule and the line that broke, and the agent drafts the supplier query for AP to send.

  6. 6

    Everything is on record

    Each match, approval and exception is logged, which is what an auditor asks for.

What an invoice matching agent is made of

Tolerances, lookups, one gated write and a clear exception list.

Tolerances

Price and quantity tolerances, per supplier or category if you need them, kept where finance can edit them.

Lookup tools

Find the purchase order and the goods receipt for an invoice, and check for a possible duplicate. Read only.

One write tool, gated

release_for_payment, marked for approval, so AP approves every invoice that gets paid.

An exception record

The invoice, the rule that broke, the line, the draft supplier query and the outcome.

The prompts

Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.

These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix.

1

Invoices, orders and tolerances

The records and the rules.

Claude Code, Codex or Cursor

Create a Helix app: an invoice matching agent for accounts payable.

Store invoices with supplier, invoice number, date, lines, total, the matched purchase order and receipt, and a status: new, matched awaiting approval, exception, approved to pay.

Store tolerances finance can edit: price variance as a percentage, quantity variance, and an amount under which a two-way match is enough.

Show a board with three columns: matched awaiting approval, exceptions, approved to pay.

2

The agent and its tools

Match, check, propose, flag.

Claude Code, Codex or Cursor

Add an agent to the app that matches each new invoice.

Give it these tools:

- find_purchase_order: by PO number, or by supplier, amount and lines.

- find_receipt: the goods receipt for a purchase order.

- find_possible_duplicate: invoices from the same supplier with the same

number or the same amount within 30 days.

- release_for_payment: release an invoice for payment.

- draft_supplier_query: save a draft message to the supplier. It must not

send anything.

Mark release_for_payment as needing approval every time.

Check price, quantity and total line by line against the tolerances. If everything is within tolerance, propose release_for_payment with the match. If not, mark the invoice as an exception with the rule and line that broke, and draft a short supplier query.

A possible duplicate is always an exception, however clean the match looks.
3

Run it as invoices arrive

Matching that keeps up.

Claude Code, Codex or Cursor

Run the agent whenever a new invoice is created, and once each morning over anything still new.

Post a morning summary to the AP channel in Slack: how many matches are waiting for approval and how many exceptions are open, by reason.

Show a weekly view of exceptions by reason and by supplier.

4

Connect it to real systems

Your orders, your receipts, your inbox.

Claude Code, Codex or Cursor

Now connect it to the systems we actually run.

Anything in angle brackets is a placeholder. Swap it for whatever we use.

<NetSuite>. Read purchase orders, receipts and vendor bills, and release a bill for payment when release_for_payment is approved.

<Slack>. Post the morning summary to the AP channel.

Invoices from the AP inbox come in through a Tray workflow that reads the document and calls this app's API route.

Only write through release_for_payment. Everything else is read only.

Tray holds each credential as a workspace authentication, so the app references a name and never the secret itself.
5

Ship it

A URL, and AP on it.

Claude Code, Codex or Cursor

Deploy my app.

Your assistant runs helix deploy and the app comes back as a URL. Set Access Control so only AP approvers can release invoices.

What it connects to

The agent reads orders and receipts, and writes back only after approval.

Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.

Running it for real

The build gets you a working agent. It sits in front of payments, so approval and the record are the point.

  1. 1

    Deploy the app and its agent together

    One command, or Deploy from CI on every merge, takes the app to a live URL. The agent ships with its app, so you can roll back any deployment.

  2. 2

    Approval before anything is paid

    release_for_payment waits for an AP approver every time, who sees the invoice, the match and the amount. SSO decides who can approve.

  3. 3

    Credentials held by Tray

    The ERP credential is held in Tray, not in the code, so it can be rotated without a redeploy.

  4. 4

    A named owner and every step logged

    The app and its agent have a named owner. Every match, approval and exception is logged, and Tray streams the logs to your SIEM.

  5. 5

    Know what each invoice costs

    AI usage shows per app, so the cost of matching is visible next to the invoices it handled.

Questions people ask

What can AI agents do for finance teams?

They take on work that follows a rule but needs judgment at the edges: matching, checking and chasing. This agent matches each supplier invoice to its purchase order and receipt, applies your tolerances, and flags every exception with the reason. Anything that moves money waits for a person to approve it.

Are AI agents safe to use in finance?

They are when every write waits for approval. Here the only write, release_for_payment, is marked for approval, so AP sees the invoice, the match and the amount first. The ERP credential is held in Tray, the app has a named owner, and every run is logged, with the logs streamed to your SIEM.

What does an invoice matching agent do?

It matches each supplier invoice to its purchase order and goods receipt, checks price, quantity and totals against your tolerances, proposes clean matches for approval to pay, and flags every exception with the reason.

Can the agent pay invoices on its own?

No. release_for_payment is marked for approval every time, so an AP approver sees the invoice and the match before anything is released.

What counts as an exception?

Anything outside the tolerances finance set: price over the allowed variance, quantity invoiced above quantity received, no purchase order found, or a possible duplicate invoice.

Where do invoices come from?

From your ERP, or from the AP inbox through a Tray workflow that reads the document and calls the app. Tray connects to 12,000+ apps, databases, APIs, and services.

Build it, then run it properly

Helix is the governed runtime for AI-built apps and agents. Deploy what you build, put SSO in front of it, connect it to your systems with managed credentials, and give it a named owner.