Ledger

Base URL: $BUSINESS_API

The object

tenant_idstring · required
idstring · required
account_numberstring · required
account_namestring · required
account_typestring · required

one of asset, liability, equity, revenue, expense

rolestring · optional
currencystring · required
is_reconciledboolean · required
activeboolean · required
created_atstring (date-time) · required
The object
{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "id": "led_2DDAMfBcGzd6gv98kDhKqFBU6lt",
  "account_number": "ACC-2026-000142",
  "account_name": "Ana Matsinhe",
  "account_type": "asset",
  "role": "role",
  "currency": "MZN",
  "is_reconciled": true,
  "active": true,
  "created_at": "2026-11-19T09:30:00Z"
}

List the tenant's chart of accounts

Logs

GET /ledger/accounts

Returns the general ledger accounts of the caller's tenant, ordered by account number, with cursor pagination (limit defaults to 20, at most 100). The optional q parameter matches account names and numbers. Requires the ledger:read permission.

Parameters

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

qstring · query · optional

Filter by name or number

activeboolean · query · optional

Filters by account state: the value true returns only active accounts, any other non-empty value returns only inactive accounts, and omitting it returns both.

Returns

200 Accounts

Show attributes
dataarray of LedgerAccount · required
Show child attributes
tenant_idstring · required
idstring · required
account_numberstring · required
account_namestring · required
account_typestring · required

one of asset, liability, equity, revenue, expense

rolestring · optional
currencystring · required
is_reconciledboolean · required
activeboolean · required
created_atstring (date-time) · required
has_moreboolean · optional
next_cursorstring · optional

Errors 403

Permissions ledger:read · Roles: admin, analyst, billing_clerk, customer_service, finance, owner, viewer

curl -X GET "$BUSINESS_API/ledger/accounts" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "data": [
    {
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "id": "led_2DDAMfBcGzd6gv98kDhKqFBU6lt",
      "account_number": "ACC-2026-000142",
      "account_name": "Ana Matsinhe",
      "account_type": "asset",
      "role": "role",
      "currency": "MZN",
      "is_reconciled": true,
      "active": true,
      "created_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Add a tenant-specific account to the chart

Logs

POST /ledger/accounts

Adds an account with the given account_number, account_name and account_type (asset, liability, equity, revenue or expense) to the tenant's chart; the account is created active and takes the currency of the existing chart. Returns 400 when a required field is missing, the type is invalid, or the tenant's chart has not been seeded yet. Requires the ledger:write permission.

Body application/json

account_numberstring · required
account_namestring · required
account_typestring · required

one of asset, liability, equity, revenue, expense

rolestring · optional

Returns

201 Account

Show attributes
tenant_idstring · required
idstring · required
account_numberstring · required
account_namestring · required
account_typestring · required

one of asset, liability, equity, revenue, expense

rolestring · optional
currencystring · required
is_reconciledboolean · required
activeboolean · required
created_atstring (date-time) · required

Errors 400 · 403 · 409

Permissions ledger:write · Roles: admin, finance, owner

curl -X POST "$BUSINESS_API/ledger/accounts" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "account_number": "ACC-2026-000142",
  "account_name": "Ana Matsinhe",
  "account_type": "asset",
  "role": "role"
}'
Response 201
{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "id": "led_2DDAMfBcGzd6gv98kDhKqFBU6lt",
  "account_number": "ACC-2026-000142",
  "account_name": "Ana Matsinhe",
  "account_type": "asset",
  "role": "role",
  "currency": "MZN",
  "is_reconciled": true,
  "active": true,
  "created_at": "2026-11-19T09:30:00Z"
}

Trial balance

Logs

GET /ledger/trial-balance

Trial balance; total debits equal total credits

Returns the debit and credit totals of every account in the tenant's chart, computed from all posted entries or, with the optional as_of RFC 3339 timestamp, only from entries up to that instant. Because every posting is validated as balanced, the debit and credit totals match. Returns 400 when as_of is not RFC 3339. Requires the ledger:read permission.

Parameters

as_ofstring (date-time) · query · optional

Entries dated at or before this RFC 3339 instant

Returns

200 Trial balance

Show attributes
currencystring · optional
total_debit_minorinteger (int64) · optional
total_credit_minorinteger (int64) · optional
balancedboolean · optional
linesarray of object · optional
Show child attributes
account_idstring · optional
account_numberstring · optional
account_namestring · optional
account_typestring · optional
currencystring · optional
debit_minorinteger (int64) · optional
credit_minorinteger (int64) · optional
balance_minorinteger (int64) · optional

Errors 400 · 403

Permissions ledger:read · Roles: admin, analyst, billing_clerk, customer_service, finance, owner, viewer

curl -X GET "$BUSINESS_API/ledger/trial-balance" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "currency": "MZN",
  "total_debit_minor": 125000,
  "total_credit_minor": 125000,
  "balanced": true,
  "lines": [
    {
      "account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP",
      "account_number": "ACC-2026-000142",
      "account_name": "Ana Matsinhe",
      "account_type": "account type",
      "currency": "MZN",
      "debit_minor": 1,
      "credit_minor": 1,
      "balance_minor": 125000
    }
  ]
}

Get ledger reconciliation

Logs

GET /ledger/reconciliation

Compare control accounts to the billing and payment sub-ledgers

Compares the balance of the receivable and unallocated cash control accounts, and of the stock control account where stock is valued, with the totals reported by the operational sub-ledgers. Each pair returns the control balance, the sub-ledger total and the difference in minor units, and balanced is true only when every difference is zero. Returns 400 when sub-ledger totals are not configured on the server. Requires the ledger:read permission.

Returns

200 Reconciliation

Show attributes
currencystring · optional
receivable_control_minorinteger (int64) · optional
receivable_sub_ledger_minorinteger (int64) · optional
receivable_difference_minorinteger (int64) · optional
unallocated_control_minorinteger (int64) · optional
unallocated_sub_ledger_minorinteger (int64) · optional
unallocated_difference_minorinteger (int64) · optional
stock_control_minorinteger (int64) · optional

Stock on hand account (RFC 0071 phase 4).

stock_sub_ledger_minorinteger (int64) · optional

Inventory balances, on hand and in transit, at moving average cost.

stock_difference_minorinteger (int64) · optional
balancedboolean · optional

Errors 403

Permissions ledger:read · Roles: admin, analyst, billing_clerk, customer_service, finance, owner, viewer

curl -X GET "$BUSINESS_API/ledger/reconciliation" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "currency": "MZN",
  "receivable_control_minor": 1,
  "receivable_sub_ledger_minor": 1,
  "receivable_difference_minor": 1,
  "unallocated_control_minor": 1,
  "unallocated_sub_ledger_minor": 1,
  "unallocated_difference_minor": 1,
  "stock_control_minor": 1,
  "stock_sub_ledger_minor": 1,
  "stock_difference_minor": 1,
  "balanced": true
}

List journal entries with their lines

Logs

GET /ledger/entries

Returns the tenant's posted journal entries, newest first, each with its debit and credit lines, using cursor pagination (limit defaults to 20, at most 100). Filters combine with AND; an invalid cursor or a from/to value that is not RFC 3339 returns 400. Requires the ledger:read permission.

Parameters

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

account_idstring · query · optional

Ledger account ID; returns only entries that have at least one line posted to this account.

party_idstring · query · optional

Customer or tenant on a sub-ledger line

source_modulestring · query · optional

Exact name of the module that posted the entry, such as ledger for manual reversals.

source_reference_idstring · query · optional

Exact source reference the posting module recorded on the entry (for example the ID of the invoice or payment it came from, or reversal:<entry id> for a reversal).

fromstring (date-time) · query · optional

RFC 3339 timestamp; returns only entries whose entry date is at or after this instant.

tostring (date-time) · query · optional

RFC 3339 timestamp; returns only entries whose entry date is at or before this instant.

Returns

200 Journal entries

Show attributes
dataarray of LedgerEntry · required
Show child attributes
tenant_idstring · required
idstring · required
entry_numberstring · required
entry_datestring (date-time) · required
source_modulestring · required
source_reference_idstring · required
descriptionstring · required
posted_by_user_idstring · required
reverses_entry_idstring · optional
created_atstring (date-time) · required
linesarray of object · optional
Show child attributes
tenant_idstring · required
idstring · required
entry_idstring · required
gl_account_idstring · required
entry_sidestring · required

one of debit, credit

amount_minorinteger (int64) · required
currencystring · required
sub_ledger_party_idstring · optional
created_atstring (date-time) · required
has_moreboolean · optional
next_cursorstring · optional

Errors 400 · 403

Permissions ledger:read · Roles: admin, analyst, billing_clerk, customer_service, finance, owner, viewer

curl -X GET "$BUSINESS_API/ledger/entries" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "data": [
    {
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
      "entry_number": "ENT-2026-000142",
      "entry_date": "2026-11-19T09:30:00Z",
      "source_module": "source module",
      "source_reference_id": "sou_2tDCiB9UgPx6UNxauznOOZjiQPv",
      "description": "Leitura confirmada no local.",
      "posted_by_user_id": "pos_2dxUMrJSyR9qQTp0wXpci5PMabh",
      "reverses_entry_id": "rev_2SCXR4GDjAQljcKJ1c6pxAMtJ2C",
      "created_at": "2026-11-19T09:30:00Z",
      "lines": [
        {
          "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
          "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
          "entry_id": "ent_26mnjWER3gyZFykxF0EdZ0wl9Au",
          "gl_account_id": "gla_2lXga9FAuTjW4rvUEhziYldiizp",
          "entry_side": "debit",
          "amount_minor": 125000,
          "currency": "MZN",
          "sub_ledger_party_id": "sub_2VLkWh3eYlTIObHccrTQ2BVcg9f",
          "created_at": "2026-11-19T09:30:00Z"
        }
      ]
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Get one journal entry and its lines

Logs

GET /ledger/entries/{id}

Returns the journal entry with its entry number, source module and reference, description, the user who posted it, the entry it reverses if any, and all of its lines. Returns 404 when the entry does not exist in the caller's tenant. Requires the ledger:read permission.

Parameters

idstring · path · required

ID of the journal entry in the caller's tenant.

Returns

200 Journal entry

Show attributes
tenant_idstring · required
idstring · required
entry_numberstring · required
entry_datestring (date-time) · required
source_modulestring · required
source_reference_idstring · required
descriptionstring · required
posted_by_user_idstring · required
reverses_entry_idstring · optional
created_atstring (date-time) · required
linesarray of object · optional
Show child attributes
tenant_idstring · required
idstring · required
entry_idstring · required
gl_account_idstring · required
entry_sidestring · required

one of debit, credit

amount_minorinteger (int64) · required
currencystring · required
sub_ledger_party_idstring · optional
created_atstring (date-time) · required

Errors 403 · 404

Permissions ledger:read · Roles: admin, analyst, billing_clerk, customer_service, finance, owner, viewer

curl -X GET "$BUSINESS_API/ledger/entries/{id}" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
  "entry_number": "ENT-2026-000142",
  "entry_date": "2026-11-19T09:30:00Z",
  "source_module": "source module",
  "source_reference_id": "sou_2tDCiB9UgPx6UNxauznOOZjiQPv",
  "description": "Leitura confirmada no local.",
  "posted_by_user_id": "pos_2dxUMrJSyR9qQTp0wXpci5PMabh",
  "reverses_entry_id": "rev_2SCXR4GDjAQljcKJ1c6pxAMtJ2C",
  "created_at": "2026-11-19T09:30:00Z",
  "lines": [
    {
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
      "entry_id": "ent_26mnjWER3gyZFykxF0EdZ0wl9Au",
      "gl_account_id": "gla_2lXga9FAuTjW4rvUEhziYldiizp",
      "entry_side": "debit",
      "amount_minor": 125000,
      "currency": "MZN",
      "sub_ledger_party_id": "sub_2VLkWh3eYlTIObHccrTQ2BVcg9f",
      "created_at": "2026-11-19T09:30:00Z"
    }
  ]
}

Correct an entry with a mirror-image reversing entry

Logs

POST /ledger/entries/{id}/reverse

Posts a new entry dated now that swaps the debit and credit side of every line of the original, which stays unchanged; the reversal is linked to the original and returned with 201. A non-empty reason is required and is added to the reversal's description. Returns 409 when the entry has already been reversed or is itself a reversing entry, and 404 when it does not exist. Requires the ledger:write permission.

Parameters

idstring · path · required

ID of the journal entry to reverse, in the caller's tenant.

Body application/json

reasonstring · required

Returns

201 Reversing entry

Show attributes
tenant_idstring · required
idstring · required
entry_numberstring · required
entry_datestring (date-time) · required
source_modulestring · required
source_reference_idstring · required
descriptionstring · required
posted_by_user_idstring · required
reverses_entry_idstring · optional
created_atstring (date-time) · required
linesarray of object · optional
Show child attributes
tenant_idstring · required
idstring · required
entry_idstring · required
gl_account_idstring · required
entry_sidestring · required

one of debit, credit

amount_minorinteger (int64) · required
currencystring · required
sub_ledger_party_idstring · optional
created_atstring (date-time) · required

Errors 400 · 403 · 404 · 409

Permissions ledger:write · Roles: admin, finance, owner

curl -X POST "$BUSINESS_API/ledger/entries/{id}/reverse" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Leitura confirmada no local."
}'
Response 201
{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
  "entry_number": "ENT-2026-000142",
  "entry_date": "2026-11-19T09:30:00Z",
  "source_module": "source module",
  "source_reference_id": "sou_2tDCiB9UgPx6UNxauznOOZjiQPv",
  "description": "Leitura confirmada no local.",
  "posted_by_user_id": "pos_2dxUMrJSyR9qQTp0wXpci5PMabh",
  "reverses_entry_id": "rev_2SCXR4GDjAQljcKJ1c6pxAMtJ2C",
  "created_at": "2026-11-19T09:30:00Z",
  "lines": [
    {
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "id": "led_2KINdcqxzWS5JyAd3kktL2eFFCW",
      "entry_id": "ent_26mnjWER3gyZFykxF0EdZ0wl9Au",
      "gl_account_id": "gla_2lXga9FAuTjW4rvUEhziYldiizp",
      "entry_side": "debit",
      "amount_minor": 125000,
      "currency": "MZN",
      "sub_ledger_party_id": "sub_2VLkWh3eYlTIObHccrTQ2BVcg9f",
      "created_at": "2026-11-19T09:30:00Z"
    }
  ]
}