POST /v1/iso20022/camt.053/parse

POST /v1/iso20022/camt.053/parse

Parse a camt.053 (or camt.054) statement and emit candidate reconciliation keys per entry.

Parses a camt.053 or camt.054 XML body and emits one or more candidate reconciliation keys per booked entry, ordered by confidence.

The carrier-extraction logic considers all six standard carriers (EndToEndId, InstrId, StrdCdtrRef, Ustrd, AcctSvcrRef, SplmtryData) and re-ranks them under the bank-handler logic at apps/api/src/lib/bank-recon-handlers/. Customers pin a bank handler via the optional bank field.

The free-text Ustrd carrier is regex-parsed with a default invoice-id pattern (/[A-Z]{2,}[-_]?\d{4,}[-_]?\d+/). Override via ustrd_key_pattern for tenants whose invoice ids do not match the default.

The actual matching against the customer's expected-payments list is a separate route — POST /v1/reconcile — fed with the candidate list this route returns.

See apps/api/src/routes/camt053.ts and the parser at apps/api/src/lib/camt053-parser.ts.

Request

Request body

{
  "xml": "string (camt.053 or camt.054 XML body, up to 5 MiB)",
  "bank": "string (optional; bank slug for handler selection)",
  "ustrd_key_pattern": "string (optional regex)"
}

Response

Response body

{
  "account_id": "string",
  "booking_date": "YYYY-MM-DD",
  "opening_balance": "{ amount, currency }",
  "closing_balance": "{ amount, currency }",
  "entries": "Array<{ entry_ref, booking_date, amount, currency, credit_debit, candidates: Array<{ value, carrier, confidence }> }>"
}

Idempotency

Mandatory header `Idempotency-Key` (UUID or other opaque ≤64 char string). A second request with the same key and the same body returns the cached response and the header `X-Iso-Compliant-Idempotent-Replay: true`. A second request with the same key but a different body returns 409.

Rate limit

Sandbox: 60 requests / minute, 1000 / day. Production: 600 requests / minute soft cap, lifted per tenant on request.

← All docs