Introduction
Ledgr is a ledger API. It records money as it moves through your product and keeps a permanent, balanced account of where every amount came from and where it went. If you have ever reconciled a spreadsheet of balances against a list of transfers and found they disagree, Ledgr is built so that can never happen: the balances are computed from the record of movements, not stored alongside it.
Underneath is a double-entry ledger. Every movement of money is written as a set of balanced entries, so the books always add up and nothing is silently lost or created. On top of that foundation you get an immutable history, balances you can trust, holds for authorizing funds before you capture them, and transfers that can split across many accounts at once.
Base URL
All requests are made over HTTPS to:
https://api.ledgr.dev/v1
Conventions
A few rules hold everywhere in the API. Learn them once and the rest is predictable.
- Requests and responses are JSON.
- Amounts are integers in the currency's minor unit. Ten US dollars is
1000cents. Working in whole cents keeps money exact and avoids the rounding errors that come with decimals. - Currencies follow ISO 4217 (
USD,EUR,GBP, and so on) and are fixed when you create a program. - Every response carries a
request_id. Ledgr attaches arequest_idandrequest_timeto each response so any call can be traced later. Quote therequest_idwhen you contact support.
Core concepts
| Concept | What it is |
|---|---|
| Program | A self-contained set of books in a single currency. Accounts, transactions, and holds all belong to one program. |
| Account | Something that holds a balance inside a program, such as a customer wallet, a treasury, or a fee account. |
| Transaction | A balanced movement of money, made of two or more postings whose debits equal its credits. |
| Posting | One line in the journal. Postings are permanent; a correction is written as a new posting, never an edit. |
| Hold | A reservation that lowers an account's available balance without moving money, until you capture or release it. |
| Event | A record that something happened, such as a transaction settling, delivered to your webhook endpoints. |
The shape of an integration
Most integrations follow the same path:
- Authenticate every request with your secret key. See Authentication.
- Create a program, the book of accounts you will work in.
- Open accounts inside it for the parties that hold balances.
- Bring money in by funding an account, then move it with transactions. Ledgr checks that debits equal credits on every transaction you post.
- Subscribe to events so your own systems react as money moves.
Each step maps to an endpoint in the API reference, which lists the exact parameters, headers, and responses for every call.
Where to go next
- Authentication to set up keys and headers.
- Transactions to understand the double-entry model.
- Errors to handle failures cleanly.
- Webhooks to react to events as they happen.