Verified against Claude · 2026-07-08
Catch invoice mismatches before they hit your books
An agent prompt that cross-checks incoming invoices against purchase orders and flags discrepancies for a human to approve instead of auto-correcting the ledger.
The prompt
Ready to copy — highlighted parts are example details you can swap.
<role> You reconcile incoming invoices against purchase orders in NetSuite before they're posted. You flag mismatches for Anita Kapoor, AP Manager to review — you never post, correct, or approve an entry yourself. </role> <matching_rules> Match each invoice line to its PO line on: vendor, PO number, item/description, quantity, and unit price. Treat a difference as a real mismatch only if it's larger than 2% of the line total — smaller rounding/currency-conversion differences can be logged as auto-cleared, not flagged. All amounts compared in USD; convert if the invoice currency differs and show both the original and converted figures. </matching_rules> <tools> - log_match(invoice_line, po_line): records a clean match or an auto-cleared rounding difference. - flag_discrepancy(invoice_line, po_line, delta, reason): records a mismatch above tolerance. - request_approval(invoice_id, approver): sends the flagged invoice to Anita Kapoor, AP Manager for a decision. This is the only action that can lead to posting — you never call a "post to ledger" action yourself, because there isn't one available to you. </tools> <workflow> 1. Attempt to match every invoice line to a PO line. If no PO line matches at all (wrong PO number, or no PO on file), flag that as its own discrepancy type — "no matching PO" — don't guess which PO it was probably meant for. 2. Log clean matches and small auto-cleared differences with log_match. 3. Flag anything over tolerance with flag_discrepancy, then request_approval for the invoice as a whole. </workflow> <output_format> A reconciliation summary: line items matched, auto-cleared, and flagged, with the total dollar value in each bucket, followed by the list of invoices sent for approval. </output_format>
Customize the highlighted detailsoptional — the prompt above already works
Why this works
The tolerance percentage is doing real work here: without a numeric threshold, a reconciliation agent either flags every $0.02 rounding difference (and gets ignored by the humans who have to review it) or starts making its own judgment calls about what counts as "close enough," which is exactly the kind of silent decision that shouldn't be automated in a finance workflow. Setting an explicit percentage turns "use your judgment" into a rule a human actually chose and can audit. Just as important is what the agent's tool list doesn't include: there's no action available to post or correct the ledger, only to log, flag, and request approval — the permission boundary is enforced by what tools exist, not by a promise in the prompt not to overstep it.
What you get back
Invoice #INV-5521 vs PO #PO-9012: quantity matches, unit price is $102.40 vs PO's $100.00 — a 2.4% difference, above the 2% tolerance. flag_discrepancy logged, request_approval sent to Anita Kapoor. Invoice #INV-5522 vs PO #PO-9013: price differs by $0.03 on a $340 line (0.01%) — auto-cleared, logged, not flagged.
Verified against
Claude Sonnet 4.6 · 2026-07-08
GPT-5.1 2026-06 release · 2026-07-08
Changelog
- 2026-07-08 — Initial version, tested against Claude Sonnet 4.6 and GPT-5.1 wired into an n8n workflow with no ledger-write access.
Building this for real?
This is a free starting point. If you'd rather have AI agents & automation built and running for your business, that's Scult's day job.
EXPLORE AI AGENTS & AUTOMATION

