Hanzo Ledger
Programmable double-entry ledger for fintech apps
Atomic, balanced transactions across millions of accounts. Idempotent posting, immutable history, real-time balances. The accounting backbone for wallets, marketplaces, and banking products.
Money Movement, Done Right
Every cent accounted for. Every transaction balanced. Always.
Double-Entry Core
Every transaction debits and credits balanced accounts. Mathematically impossible to lose money. GAAP-compliant out of the box.
Idempotency
Safe retries with idempotency keys. Submit the same transaction twice — only one posts. Critical for distributed systems.
Immutable History
Append-only ledger. No edits, no deletes — only reversing entries. Full audit trail for SOC 2, PCI, and bank examiners.
Programmable Rules
Define complex flows: split-payments, escrow, fee distribution, FX. Composable transaction primitives evaluated server-side.
Multi-Currency
Native support for fiat, crypto, points, credits, and custom assets. Per-asset precision rules. FX rate snapshotting at posting time.
Real-Time Balances
Sub-millisecond balance reads at any scale. Time-travel queries — see any account's balance at any point in history.
Atomic. Balanced. Auditable.
import { Ledger } from '@hanzo/ledger';
const ledger = new Ledger({ apiKey: process.env.HANZO_API_KEY });
// Atomic split-payment: customer pays vendor + 5% platform fee
await ledger.transactions.create({
idempotency_key: 'order_42_payout',
postings: [
{ account: 'customer:alice', amount: -10500, asset: 'USD' },
{ account: 'vendor:bob', amount: 10000, asset: 'USD' },
{ account: 'platform:revenue', amount: 500, asset: 'USD' },
],
metadata: { order_id: 'ord_42', type: 'split_payment' },
});