Skip to main content

Bank8:Ledger — the core ledger

The system of record for money positions: accounts, products, double-entry postings, balances, schedules, and the full configuration library (parameters, flags, restrictions, calendars, plans, contracts) that drive them. 91 endpoints, 44 tables, one schema the service owns exclusively.

Use cases​

Retail & business banking​

  • Account opening — products compose validation modules (limits, overdraft rules, sweeps, tiered rates); parameters resolve through the hierarchy (global → product → account) so a product change never needs data migration.
  • Transfers — a transfer is one POST /v1/postings call with a batch and a single instruction; retries with the same idempotency_key are safe by construction.
  • Scheduled postings — due schedules generate posting batches in one transaction per batch (recurring fees, sweeps, interest).

Finance operations​

  • Balance truth — live and end-of-day balances per denomination; every posting batch is balance-validated before any row is written (422 on imbalance, never compensating entries after the fact).
  • Statement generation — scheduled generation writes documents to platform storage; regeneration is a per-account-period workflow.
  • Config library — flags, restrictions, plans, contract modules: the whole product rule set is data, unit-testable without a DB.

API surface (91 endpoints, selected families)​

FamilyEndpointsScope
AccountsGET/POST /v1/accounts, …/{id}, …/balances, …/transactions, …/statementsbank8:ledger:accounts:read/write
ProductsGET/POST /v1/products, …/{id}/activate, versionsbank8:ledger:products:*
PostingsPOST /v1/postings, POST /v1/postings/async, GET …/{id}, republishbank8:ledger:postings:read/write
Balances v2GET /v2/balances/{live,end,series}bank8:ledger:balances:read
SchedulesGET/POST /v1/schedules, tags, associationsbank8:ledger:schedules:*
CustomersGET/POST /v1/customers, link-authbank8:ledger:customers:write
Parameters/v1/parameters, viewEffective, derived valuesbank8:ledger:parameters:*

Invariants​

  • Money is rust_decimal end-to-end; the JSON wire format is a string.
  • Postings are idempotent per (env_id, idempotency_key) — partial unique index + ON CONFLICT.
  • Audit + outbox inserts propagate errors inside the posting transaction: a posting whose audit/event write fails never commits.

Full documentation​

The complete detail lives in this product's sub-pages:

  • Architecture (DDD) — the full document, harvested from the unit's repository at build time.
  • Business rules (BRD) — the full document, harvested from the unit's repository at build time.
  • Security — the full document, harvested from the unit's repository at build time.
  • Overview (repo README) — the maintainer's README in the consolidated reference section.