A double-entry ledger: accounts, posting templates, corrections, holds, periods and reports.
The public API of the Mezgeb ledger (ADR-0009). Status: v1-draft, frozen for implementation in step 2.07.
Conventions (docs/api/README.md):
- Amounts are decimal strings with a currency,
{"amount": "39.20", "currency": "ETB"}, never JSON numbers.
- Every write that posts an entry or places a hold takes an
Idempotency-Key header.
- Errors are RFC 9457 Problem Details (
application/problem+json) with a stable code; the catalogue is docs/api/errors.md.
- Lists are cursor-paginated:
limit and cursor, answered with next_cursor.
- Times are RFC 3339 with microseconds, in UTC.
- Clients post only through posting templates, one endpoint each. The only endpoint that takes arbitrary lines is the operator-only, maker-checker adjustment.
The token endpoint only: a credential’s ID and secret (RFC 6749 §2.3.1).
Security scheme type: http
OAuth 2.0 client credentials (ADR-0017). Each client is a platform integrating with the ledger, and each of its credentials holds roles; a token carries the scopes its roles grant. Operator scopes go only to the operator’s staff.
Security scheme type: oauth2
Flow type: clientCredentials
Token URL: /oauth/token
Scopes:
- accounts:read - Read the accounts the client owns
- accounts:read_all - Read every account (operator)
- accounts:write - Open accounts
- accounts:admin - Freeze, unfreeze and close accounts (operator)
- operations:write - Post through the posting templates
- entries:read - Read entries the client posted or that touch its accounts
- corrections:write - Reverse entries (operator)
- adjustments:request - Request adjustments (operator, maker)
- adjustments:approve - Approve or reject adjustments (operator, checker)
- holds:read - Read holds
- holds:write - Place, capture and release holds
- periods:read - Read accounting periods
- periods:close - Close accounting periods (operator)
- reports:read - Read trial balances and ageing (operator)
- audit:read - Read the audit events of every client (auditor)
- offline:write - Offline devices, vouchers and receipts
- offline:resolve - Resolve offline disputes (operators)
- reconciliation:write - Compare the client's cached balances with the ledger
- reconciliation:read - Read reconciliation runs and breaks (operators, auditors)
- reconciliation:resolve - Resolve and explain reconciliation breaks (operators)