Retrieve incoming payment notifications via Modern Treasury payment.created webhooks or by polling the expected payments API; for each incoming credit, extract the available remittance data: wire message to beneficiary text, ACH addenda records (for CCD+ or CTX entries that carry structured addenda), or structured remittance information from camt.054 credit notifications
Implement a matching pipeline with a cascade of strategies ordered by confidence: exact match on your invoice number or customer reference embedded in the remittance text (highest confidence), match on amount plus counterparty name (medium confidence), amount-only match within a date window (low confidence, flag for review)
For ACH credits with addenda, parse the addenda record to extract structured payment reference data; CCD+ addenda contain a single free-text 80-character field, while CTX entries carry ANSI X12 820 or UN/EDIFACT REMADV structured remittance data requiring EDI parsing
For wire credits, parse the originator-to-beneficiary information (OBI) field returned by the bank on the inbound wire object; this field carries up to four 35-character lines of unstructured text that the payer populates with invoice references
Post matched payments as closed in your AR system and create a Modern Treasury Expected Payment resolved event by updating the expected payment object to link the incoming transaction; unmatched credits should remain as outstanding expected payments flagged for manual cash application
Generate a daily cash application efficiency report: percentage auto-matched, percentage manually matched, and percentage unmatched at end of day; use this to tune matching rules and identify payers who consistently omit remittance information
Known gotchas
Payers frequently combine multiple invoice payments into a single ACH or wire credit without itemizing them in the remittance field; amount-based matching that assumes one payment per invoice will misroute consolidated payments, crediting the wrong invoice or failing to match altogether
ACH CCD+ addenda are limited to a single 80-character free-text field which payers use inconsistently — some include invoice numbers, some include customer account numbers, and some include purchase order numbers; matching logic must handle all three reference types and their variations to achieve high auto-match rates
Wire OBI fields are sometimes reformatted or truncated by correspondent banks in the payment chain before reaching your account; a payment with a complete invoice reference in the original wire message may arrive with the reference truncated or replaced with correspondent routing text, requiring fallback to amount-based matching
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp