Plaidly Docs

Ledger and Settlement View

Operational ledger entries for expected, received, swept, spent, refunded, and settled state

Ledger and Settlement View

Use this page for BDT-318 on the M6 Observability + Settlement Ops milestone.

The goal is to give operators and merchants a single traceable record of money movement from expected payment through settlement.

Ledger states

The ledger must represent the following states:

  • expected
  • received
  • swept
  • spent
  • refunded
  • settled

Each state transition should be idempotent. Replaying the same transition must not create duplicate rows or drift the balances.

Ledger entry contract

Each entry should be queryable by session or spend event and carry enough context for support review.

FieldMeaning
ledger_entry_idStable id for the record
merchant_idMerchant scope
session_idPayment session correlation
spend_idOutbound spend correlation when relevant
wallet_idWallet that moved funds
entry_typeOne of the ledger states above
statusOperational status such as pending, confirmed, failed, or cancelled
chain / networkChain context
tokenToken symbol
amountAmount moved
fee_amountFee attributed to the entry
tx_hashOn-chain transaction hash when available
proofSettlement or verification proof when available
balance_beforeBalance before the transition
balance_afterBalance after the transition
created_atEntry creation time
settled_atSettlement time when the row reaches a final state

Operator views

Support should be able to inspect the ledger in three ways:

  1. By session id, to understand a payment from initiation through confirmation.
  2. By spend event, to understand outbound movement and any fee impact.
  3. By merchant and date range, to reconcile a slice of activity.

Keep the view merchant-scoped. A merchant should never see another merchant's entries, even when the same chain or token is involved.

Export behavior

The ledger view can be exported for support review.

  • Use a stable column order.
  • Preserve the same field names in CSV and JSON exports.
  • Filter exports by merchant and date range before pagination.
  • Include the tx_hash or proof value when it exists, but do not invent a placeholder.
  • Mask secrets and internal support notes.

Transition rules

  • expected -> received when Plaidly detects the payment.
  • received -> swept when funds are moved to the settlement path.
  • swept -> settled when the final accounting state is confirmed.
  • settled -> refunded only if the business flow actually reverses value.
  • Expired sessions are not separate ledger entry types; record expiration in the session view unless value actually moved.

On this page