Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2, which covers this as Core Concepts.Go to v3.2
Ledger

Overview

Understand the Ledger accounting model and choose your next task.

Formance Ledger is a programmable product ledger. Applications use it to record financial movements, keep balances consistent under concurrent activity, and retain the history needed to investigate and reconcile those movements.

The four accounting primitives#

PrimitiveWhat it representsExample
LedgerAn isolated accounting namespace.The balances and transactions for one product or tenant.
AccountA named holder of one or more asset balances.wallets:alice or platform:fees.
TransactionA group of postings that succeeds or fails as one operation.A customer payment split between a merchant and a fee account.
PostingOne integer amount and asset moving from a source to a destination.USD/2 1250 from wallets:alice to merchants:coffee-shop.

Accounts do not need to be created before their first transaction. Ledger creates an account when a posting first refers to its address.

A financial movement in Ledger#

The special world account represents value entering or leaving the boundary modeled by your ledger. This example brings USD 100.00 into Alice's wallet, then records a USD 12.50 purchase.

USD/2 identifies the asset and its two-decimal display precision. Ledger records 10000 and 1250 as integers; your application formats them as USD 100.00 and USD 12.50 for display.

Guarantees you can build on#

  • Balanced movement: every posting records the same asset and amount leaving one source and entering one destination.
  • Atomic transactions: Ledger records every posting in a transaction or records none of them.
  • Funds validation: Ledger rejects a debit that exceeds the available balance by default.
  • Integer amounts: Ledger never depends on floating-point arithmetic for financial values.
  • Traceable corrections: recorded transactions remain in history; a correction creates an additional transaction instead of editing the original.
  • Logical isolation: accounts and transactions belong to one ledger and do not leak into another ledger's namespace.

These guarantees cover the accounting record. Your application still owns authorization decisions, the meaning of each account, and the business event that authorizes a transaction.

Connect from an application or an operator tool#

Applications commonly use the HTTP API. Operational tooling can use the public gRPC API directly, and ledgerctl provides a command-line client for that gRPC surface. A feature can exist on one surface before an equivalent workflow exists on another, so follow the guide for the interface you use.

Choose your next task#

I want to...Continue with...
Record and verify a first transactionQuick Start
Design account names, assets, and metadataModel Your Ledger
Record postings or execute NumscriptWrite Transactions
Read balances, history, and query resultsRead and Query Data
Send ledger changes to downstream systemsIntegrate with Events
Secure, monitor, back up, and restore LedgerOperate Ledger