API Reference
Release candidate v1.0.0 OpenAPI 3.0.3

Zepto Ledger API

A double-entry financial ledger for multi-asset balances (fiat, crypto, and points), built for sub-millisecond reads and 1000+ transactions per second per account.

Core concepts

Every balance you can query traces back through four resources. Money never sits loose: it always belongs to an account, inside a ledger, moved there by a transaction.

TenantYour business
LedgerMain book
AccountRent Expense
AccountCash (AUD)
TransactionRent payment
DrRent Expense$2,500.00
CrCash$2,500.00
BalanceRent Expense$2,500.00
BalanceCash$0.00

Ledgers group accounts

A ledger is a book of accounts such as Cash, Accounts Receivable, Accounts Payable, and Retained Earnings. Every account belongs to exactly one ledger.

Accounts hold one asset

An account is scoped to a single asset (AUD, BTC, loyalty points), type (asset, liability, equity, revenue, expense), and a normal balance (debit normal, credit normal).

Transactions are atomic

A transaction is a set of up to 10 entries that must net to zero per asset. It either posts completely or not at all. There's no "pending" state.

Balances are live

Reading a balance never touches history. It's a direct lookup, kept in step with every posted transaction in real time.

Conventions

A handful of rules apply across every endpoint. Knowing these up front makes the resource reference below mostly self-explanatory.

ConventionWhat it means for you
IdempotencyYou generate the id for every asset, ledger, account, and transaction (a UUIDv7). Retry a POST with the same id and you get the original resource back rather than a duplicate.
Reads vs. writesWrites (POST/PATCH) take a flat JSON body. Reads (GET) return JSON:API: data, attributes, relationships, plus included where you asked for sideloaded data.
PaginationList endpoints take cursor + limit and return meta.next_cursor when more pages exist. Cursors are opaque; don't parse them.
Sideloading?include=balance on accounts, or ?include=transaction on entries, adds the related resource to the response's included array instead of a second round trip.
MoneyAmounts are integers in the asset's smallest unit (cents for AUD, satoshis for BTC), scaled for display by decimal_places.
TenancyEvery request needs X-Tenant-ID.

Errors

Every error follows JSON:API's error object: an array, so validation can report more than one problem at once.

422 Unprocessable Entity

          
200Idempotent replay of an existing POST
201Resource created
404No such resource for this tenant
409ID or code already exists
422Validation failed (see source.pointer)