Invoice Processing

Processing an invoice: whether it can be paid, and what must happen first.

An invoice was received. Should it be paid?

Input
The invoiceline items, totals, tax and bank details
The purchase orderwhat was ordered, in what quantity, at what price
The contractrates, caps, retainage and payment terms
The vendor recordbank details on file, tier, and how long they have billed us
Prior invoiceswhat this vendor has already billed and been paid
Correspondenceemails about this invoice, from either side
Delivery evidencereceiving notes, timesheets and shipment records
Approvalswho signed off, and anything they said while doing it
Output any that apply
PAYSCHEDULESHORT PAYROUTE FOR APPROVALHOLD FOR DOCUMENTSREQUEST CORRECTED INVOICEDISPUTE LINESFRAUD REVIEWDUPLICATE
Lens
Invoice Processing: accuracy against cost and time
TypeSafeOpenAIAnthropicFireworksworkflowprompt
frontier: nothing is both cheaper and more accurate
0%20%40%60%80%$0.001$0.01$0.1$1cost per case, USD (log)accuracyhaiku 4.5 · workflow · 42.9% · $0.0558 · 30.8 shaiku 4.5haiku 4.5 · prompt · 6.0% · $0.0763 · 63.4 shaiku 4.5opus 5 · workflow · 78.4% · $0.4856 · 92.1 sopus 5opus 5 · prompt · 66.9% · $0.7699 · 188.7 sopus 5sonnet 5 · workflow · 72.9% · $0.3616 · 241.3 ssonnet 5sonnet 5 · prompt · 62.4% · $0.5548 · 409.4 ssonnet 5DS v4 flash · workflow · 69.8% · $0.0133 · 84.1 sDS v4 flash · prompt · 58.2% · $0.0288 · 281.7 sDS v4 flashDS v4 pro · workflow · 72.7% · $0.0830 · 137.4 sDS v4 proDS v4 pro · prompt · 63.8% · $0.2039 · 474.4 sDS v4 proluna · workflow · 67.8% · $0.0081 · 21.4 sluna · prompt · 55.1% · $0.0160 · 61.5 slunasol · workflow · 79.1% · $0.2152 · 34.3 ssol · prompt · 65.1% · $0.4338 · 118.4 ssolterra · workflow · 74.7% · $0.0778 · 17.3 sterra · prompt · 64.0% · $0.1618 · 62.0 sterraJev · workflow · 61.8% · $0.0011 · 0.5 sDS v4 flashlunasolterraJev

The workflow

1
Read the documents

Seven rounds of questions, one subject at a time. Sums, dates, account numbers and statuses are computed in code rather than asked.

2
Reasons to stop

Four conditions end the review immediately: a fraud pattern, an invoice already paid, the wrong vendor or company, or a document that is not an invoice.

3
Holds, disputes and corrections

Three rule lists run side by side. Every rule that applies adds its actions: hold the invoice, dispute particular lines, or request a corrected copy.

4
Releasing the payment

A sequence of yes-or-no checks decides how the payment leaves: sent for approval, held for a signature, paid in the undisputed part, scheduled, or paid.

One invoice packetthe invoice · its purchaseorder and contract · thevendor master and bank-changelog · prior invoices ·correspondence · deliveryevidence · approvalsread by the model; amounts, dates, account details and statuses are checked in codeThe document:a statement, quotation or reminder, not an invoicethe early-payment discount window, in daysMoney and senders:the correspondence claims new payment detailseach unknown sender: plausible, a story, or an impostorthe pressure pattern: a short deadline, plus a threatPrior invoices:each prior invoice: same obligation, earlier period, orunrelatedOrder and contract:the invoice belongs to another project or entitywhat the contract prices: a fee, unit rates, or a capthe invoice bills above that basisa price difference is explained by how lines split the orderthe retainage the contract withholdsApprovals:each comment: approves, carves out lines, still reviewing, orwithholdsEach line:what it is: work, tax, a charge on top, a credit, an expenseits place against the order: priced, a component, an extra,not ourswhat our records show was donealready billed by a prior invoicedeclined by the owner by namean add-on fee tracing to nothingbilled above its own stated ratewhich purchase-order line it bills againstwhich delivery figure counts itCharges and totals:too vague to say what was boughtan adjustment is unexplainedan adjustment repeats a linetax charged at two ratesfraud patternFRAUD REVIEWalready paidDUPLICATEwrong vendor or entityREJECTREQUEST CORRECTED INVOICEnot an invoiceREQUEST CORRECTED INVOICEno reason to stopHolds and referralsbank details changed or claimed, unverifiedHOLD BANKfirst payment · doubtful sender · pressureVERIFY VENDOR BY PHONEa prior invoice at another amount, or unsureDUPLICATE REVIEWno PO, PO closed, or another projectPROCUREMENT REVIEWa line nobody can place against the orderPROCUREMENT REVIEWapprover objects or is unclear · stale · predates its POOWNER REVIEWour records show less was done than billedOWNER REVIEWtoo vague, or nothing of ours confirms the workHOLD FOR DOCUMENTSaccepted work past the purchase-order capESCALATE FOR APPROVALLine outcomes: bad lines are carved out of the paymenta duplicate charge, or work not performedDISPUTE LINESREQUEST CORRECTED INVOICEdeclined by the owner by nameDISPUTE LINESout of scope, within the short-pay allowanceDISPUTE LINESout of scope, above the allowancePROCUREMENT REVIEWan unexplained fee, or more than the evidenceREQUEST CORRECTED INVOICEInvoice correctionsamounts do not sum, or tax is charged twiceREQUEST CORRECTED INVOICEan adjustment unexplained or duplicatedREQUEST CORRECTED INVOICEpriced above the PO or the contractREQUEST CORRECTED INVOICEwrong currency, or more than was receivedREQUEST CORRECTED INVOICEbilling past the contract's total feeDISPUTE LINESREQUEST CORRECTED INVOICEAnything heldor under review?yesrelease nothing; the actions standnoLines carved out?yesyesSHORT PAYowner approved, within theallowance, signed at the tier?nowait for the corrected invoicenoSigned at theright tier?noROUTE FOR APPROVALyesApproval stillpending?yesSCHEDULEnoDue now, or adiscount to catch?yesPAYnoSCHEDULE1READ THE DOCUMENTS2REASONS TO STOP3HOLDS, DISPUTES AND CORRECTIONS4RELEASING THE PAYMENT
ActionStopReviewBack to the vendorPay
QuestionsNoulScoreChoice