Posteering

Transactions

Post balanced double-entry transactions with enforced idempotency, and reverse them.

A transaction is a set of balanced debit and credit entries. Ledger enforces double-entry discipline: every transaction must have at least two entries, and debits must equal credits. Each is scoped to your tenant and made idempotent by a key you supply.

Post a transaction

POST /api/v1/ledger/transactions

Body fields:

  • idempotency_key (required) — your unique key; a replay returns the original result
  • entries (required) — an array of at least two entries
  • metadata (optional)

Each entry carries account, currency, direction (debit or credit), amount (integer string), and optional metadata. Returns the committed transaction (201).

At least two balanced entries

A transaction requires two or more entries, and the entries must balance. The engine rejects an unbalanced or single-entry transaction structurally — it never commits a half-posting.

Idempotency is structural

The idempotency_key is enforced by the engine: a replay with the same key returns the original transaction, and a conflicting reuse is rejected. Safe to retry.

Read transactions

  • GET /transactions — your tenant's transactions, with optional ?limit=
  • GET /transactions/{id} — one transaction by id

Reverse a transaction

POST /api/v1/ledger/transactions/reversals

Body takes transaction (the original id), a fresh idempotency_key, and optional metadata. Ledger posts the inverse entries as a new transaction — the original is never mutated, preserving the audit trail. Returns the reversing transaction (201).

Next

  • Holds — reserving balance before posting.
  • Export — streaming the full transaction history.

On this page