AI Adoption GuideLogisticsConfirm
Automated 3-Way Match Agent
Agentic system matches invoice, BoL, and rate confirmation, auto-approves clean matches, and routes exceptions with evidence, using tools like Cass AI.
Logistics processBookPlanPickLoadMoveDeliverConfirmClose
By Don, DoneThat’s AI coach · updated
What an automated 3-way match agent does
A logistics 3-way match agent compares three documents for every freight payment: the carrier invoice, the bill of lading (BoL), and the rate confirmation. When the amounts, shipment identifiers, and commercial terms align under known rules, the agent auto-approves the invoice for payment. When they do not, it withholds approval and routes an exception package with the mismatched fields, document IDs, and the match rule that failed.
The agent does not invent a new AP process. It encodes the same checks AP teams already run by hand, then applies them consistently at invoice volume. Clean matches move without a queue. Dirty matches arrive with enough evidence that a human can decide without reopening three PDFs and a TMS screen.
Outcome focus is cost: fewer overpayments, less AP labor on routine matches, and faster cash application on freight that already cleared operationally. AP still owns every exception. The agent never closes a gap by guessing missing data.
Why freight 3-way match is different from PO match
Classic PO 3-way match (PO, receipt, invoice) assumes a purchase order and a goods receipt. Freight often has a rate confirmation instead of a PO, a BoL instead of a warehouse receipt, and accessorials that only appear after the move. Line items may be weight-based, mileage-based, or flat. Fuel surcharge and detention can sit outside the base rate. Carrier invoices may use different shipment keys than the Brokers' TMS.
That mismatch is why spreadsheet AP and generic OCR stop short. An agent needs shipment-level identity resolution (PRO, BOL number, load ID), commercial rule packs (base rate, FSC formula, accessorial catalog), and a hard stop when any of the three sources is missing. Empty result if invoice, BoL, or rate confirmation cannot be retrieved: no silent 2-way "almost match," no approval on incomplete evidence.
Upstream extractors and classifiers make this practical. A freight invoice extractor normalizes carrier invoice fields. An invoice anomaly detector flags statistical outliers before match. A contract entitlement RAG check can confirm whether an accessorial is allowed under the agreement. A billing discrepancy classifier labels exception type so the right queue gets the case.
How the agent decides: rules, evidence, and empty results
Each decision cites a match rule ID and the document IDs used. Example: rule BASE_RATE_EQ compares invoice line "linehaul" to rate-confirmation contracted rate within a configured tolerance; cited docs might be inv:INV-88421, bol:BOL-22910, rc:RC-44102. Rule WEIGHT_TOLERANCE checks billed weight against BoL weight. Rule SHIPMENT_ID_RESOLVE requires at least one shared identifier across all three sources.
Decision outcomes are narrow:
- Approve — all applicable rules pass; confidence meets threshold; all three sources present.
- Exception — one or more rules fail; package includes failed rule IDs, field diffs, and deep links or file handles for the three docs.
- Empty / blocked — any required source missing, unreadable, or identity unresolved. No approve path until the gap is filled.
Tolerance is explicit, not tribal knowledge. A $5 linehaul variance might auto-approve under LINEHAUL_ABS_TOL; a detention claim without a dock-in timestamp on the BoL fails DETENTION_EVIDENCE. Fuel surcharge can be recomputed from the posted index and the FSC schedule on the rate confirmation rather than trusted from the invoice alone.
Vendors in this space already productize parts of the loop. Cass AI focuses on freight audit and payment workflows. TriumphPay supports carrier payment networks and invoice automation in broker/carrier ecosystems. Coupa and SAP provide AP, invoice, and procurement backbones where match results and exceptions must land for payment runs and audit trails. The agent pattern sits between document intake and the system of record: match logic and evidence packaging first, then write-back of approve or exception status into Coupa, SAP, or a freight-pay platform.
Auto-approve path vs exception path
On a clean match, the agent posts an approval recommendation (or approved status, depending on policy) with the rule set version, document IDs, and a hash or snapshot of the compared fields. Payment still follows existing AP controls: dual approval thresholds, vendor master checks, and period close calendars remain human or ERP-owned. The gain is that AP does not re-key three documents for the majority of invoices that already agree.
On exception, the agent opens (or updates) a case with:
- Failed rule IDs and human-readable reason codes
- Side-by-side values (invoice vs BoL vs rate confirmation)
- Links or attachments for the three source documents
- Suggested owner (AP, carrier relations, ops) based on discrepancy class
- Optional draft carrier dispute note when the invoice overstates contracted terms
AP owns disposition: approve with override (logged), short-pay, request corrected invoice, or escalate to ops for detention/accessorial disputes. The agent does not auto-short-pay unless a separate, explicitly authorized policy engine says so. Most teams keep financial mutation behind a human confirm for the first release.
Throughput design matters. Batch overnight for EDI-heavy carriers; near-real-time for portal uploads. Idempotent runs on the same invoice ID prevent double approvals. When a BoL arrives late, a previously empty result re-runs and can flip to approve without a second AP touch if all rules then pass.
Implementation with Cass AI, TriumphPay, Coupa, and SAP
Treat the agent as an orchestration layer over documents and ERPs, not a replacement for them.
Intake. Pull carrier invoices from email, EDI, portal, or Cass / TriumphPay feeds. Resolve BoL and rate confirmation from TMS or document store by load ID. Fail closed if any source is absent.
Match core. Implement rule packs per mode (TL, LTL, parcel, ocean/air if in scope). Version rules like code. Log every evaluation with rule ID, inputs, and pass/fail. Prefer deterministic comparisons for money and IDs; use models only for field extraction and identity hints, then validate against structured IDs.
System of record. Write approve/exception into Coupa or SAP invoice workflow so payment runs, accruals, and audit reports stay authoritative. If paying through TriumphPay or Cass, sync status so carriers see short-pay or dispute states consistently.
Controls. Segregation of duties: builders of rules do not approve exceptions they created. Retain evidence packages for audit (document IDs, rule version, decision timestamp). Monitor auto-approve rate, exception rate by rule, and dollars at risk on failed BASE_RATE / accessorial rules. Cap auto-approve by amount or vendor risk until the rule pack is trusted.
Rollout. Start with one carrier segment and base rate + weight only. Add FSC, then a short accessorial list. Compare agent decisions to historical AP outcomes for a shadow period before cutting over auto-approve. Keep AP exception ownership visible in SLAs so the agent does not become a black hole of "pending AI."
What success looks like (and what it does not)
Success is a rising share of invoices that clear without AP touch, stable or falling overpayment rates, shorter cycle time from invoice receipt to payment readiness, and exception queues that arrive pre-cited. Each approve or reject in the audit log should answer: which documents, which rule IDs, which values.
It does not mean zero exceptions, unsupervised short-pays, or approving when the BoL or rate confirmation is missing. Empty when sources are incomplete is a feature. Cost savings come from removing repetitive match work and catching systematic overcharges early, not from hiding ambiguity.
If you already extract freight invoices and classify anomalies, the 3-way match agent is the control step that turns those signals into payment decisions with evidence. Wire it to Coupa or SAP for authority, use Cass AI or TriumphPay where they already sit in the freight pay path, and keep AP as the final owner of every exception the rules cannot clear.
Is this worth automating for you?
Whether this pays back depends on how much time it takes your team today. Most teams estimate that from memory, and the estimate is usually wrong in one direction or the other. This one is rated high effort to implement, so the baseline matters more than usual.
DoneThat reconstructs where the time actually went, with no timers to forget, so you can measure the baseline before committing to a project and check the gain afterward.
Measure the baseline first