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.Go to v3.2
Ledger

Ledger

Record and model financial transactions with Formance Ledger and Numscript.

Formance Ledger records financial movements as balanced transactions. It gives applications a programmable accounting core for holding balances, enforcing funds availability, and preserving a complete history of every change.

Choose your next task#

Product ledger and general ledger#

Ledger typePrimary responsibility
Product ledgerControls balances and financial movements inside an application, where concurrency, scarcity, and an exact history matter at transaction time.
General ledgerClassifies financial events to report the financial position of a business, commonly in an ERP or accounting system.

Formance Ledger is a product ledger. You define the account structure and business rules your application needs, then map the resulting financial events into your general ledger where required.

Ledger enforces the double-entry transaction model by design: every transaction involves two or more accounts in compensating directions, and balances are derived from an immutable log. It stays flexible on accounting business rules — account classification, debit/credit conventions — so you choose how much accounting logic to handle in real time versus delegating to a GL.

Start with account names that describe the business boundary they represent. A deliberate chart of accounts makes later reconciliation and reporting work easier.

Core model#

ResourceMeaning
LedgerAn isolated accounting namespace for accounts and transactions.
AccountAn address that holds balances for one or more assets.
TransactionAn atomic group of postings recorded together.
PostingOne movement of an integer amount and asset from a source account to a destination account.

Every posting has one source and one destination. Ledger applies all postings in a transaction together or rejects the transaction without a partial result. It derives balances from the recorded movements instead of accepting balance updates directly.

History and corrections#

Ledger keeps an append-only history of financial operations. You do not edit a recorded transaction in place. When a business event needs correction, record a new operation that preserves both the original event and the correction.

One ledger or several#

Use one ledger when all accounts share the same business and operational boundary. Use several ledgers when tenants or domains require separate accounting namespaces.

Accounts and transactions never cross ledger boundaries by accident. If workloads require independent availability, capacity, security, or recovery policies, place them in separate Ledger deployments rather than relying only on logical ledger separation.