Load the camt.053 XML and validate it against the official ISO 20022 camt.053.001.08 (or .06/.02 depending on the bank's version) XSD schema before processing
Parse the statement at three levels: BkToCstmrStmt (envelope), Stmt (per-account statement with opening/closing balance), and Ntry (individual entries); each Ntry can contain multiple NtryDtls > TxDtls sub-entries
For each entry, extract: ValDt (value date for interest calculations), BookgDt (booking date for GL posting), Amt + CdtDbtInd (credit/debit), and the BkTxCd (bank transaction code) for categorization
Drill into TxDtls to find the EndToEndId, InstrId, or Refs/TxId that matches your internal payment reference; use these to match against your payment ledger
For unmatched entries, apply secondary matching rules: match on Amt + ValDt + counterparty name (RltdPties/Cdtr or Dbtr) + last-4 of account number
Reconcile closing balance: sum your matched and unmatched entries against the statement's closing balance (ClosgBal); any discrepancy indicates missing entries or a parsing error
Known gotchas
camt.053 versions differ significantly across banks (v2 through v8 are all in active use); parse the namespace URI from the root element to determine the version and load the correct XSD — do not assume a single schema will work for all bank feeds
A single Ntry with multiple NtryDtls sub-entries (batch booking) is common for ACH files; if you only parse at the Ntry level you will see one lumped entry instead of individual transactions — always recurse into NtryDtls
ValDt and BookgDt can differ, sometimes by days (e.g., weekend value dating); use ValDt for interest accrual and BookgDt for GL posting date — conflating them causes incorrect interest calculations
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