What is a transaction in a ledger?

Transaction

A transaction is a movement of value from a source balance to a destination balance. It has an amount, a currency, a reference, and a status. Nothing else changes a balance. If the money moved in the product, the ledger has a transaction for it.

How does a transaction work?

You send source, destination, amount, and a unique reference. The ledger queues it, then applies, holds, or rejects it. Applied posts change settled balances. Inflight posts change inflight balances. Rejected posts change nothing.

Transaction vs payment

A payment is what the customer thinks happened on a rail. A transaction is what the ledger recorded. One payment can be several transactions: the customer debit, the fee, the clearing credit. If you store only the payment, you lose the path.

What makes a transaction complete?

A unique reference, two balances, and a precision that matches the currency. Skip the reference and retries double-post. Skip a side and you no longer have double-entry. Skip precision and the integer in the database is a different amount than the one you showed.

In Blnk a transaction always has a source and a destination. Status follows the lifecycle. Look it up by reference or by id. See transactions.