Ledgers (Chart of Accounts)
Ledgers represent accounts in the chart of accounts. Every financial transaction flows through ledger accounts via journal entries.
Account Types
| Type | Description | Normal Balance |
|---|---|---|
asset |
Cash, bank accounts, receivables, equipment | Debit |
liability |
Payables, loans, credit cards | Credit |
equity |
Owner's equity, retained earnings | Credit |
revenue |
Sales, service income | Credit |
expense |
Rent, payroll, utilities, supplies | Debit |
List Ledgers
bash
curl "https://api.ondayzero.com/api/v1/ledgers?type=expense&status=active" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID"Filter Parameters
| Parameter | Type | Description |
|---|---|---|
name |
string | Partial name match |
type |
string | asset, liability, equity, revenue, expense |
status |
string | active, inactive |
id |
string | Comma-separated ledger UUIDs |
Create a Ledger
There are two creation modes — templated (using a standard financial account type) and custom (specifying all fields):
Templated
bash
curl -X POST "https://api.ondayzero.com/api/v1/ledgers" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Expenses",
"financial_account_type": "expense"
}'Custom
bash
curl -X POST "https://api.ondayzero.com/api/v1/ledgers" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Prepaid Insurance",
"type": "asset",
"debit_credit": "debit",
"description": "Insurance premiums paid in advance",
"parent_id": "PARENT_LEDGER_UUID"
}'Update a Ledger
bash
curl -X PUT "https://api.ondayzero.com/api/v1/ledgers/{ledger_id}" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Prepaid Insurance (Current)",
"description": "Short-term insurance prepayments"
}'Merge Ledgers
Consolidate multiple accounts into one. All journal entry lines, transactions, budgets, reconciliations, and bank rules are reassigned. Source accounts are archived.
bash
curl -X POST "https://api.ondayzero.com/api/v1/ledgers/merge" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"source_ledger_ids": ["LEDGER_UUID_1", "LEDGER_UUID_2"],
"target_ledger_id": "TARGET_LEDGER_UUID",
"new_name": "Consolidated Office Expenses"
}'Delete a Ledger
bash
curl -X DELETE "https://api.ondayzero.com/api/v1/ledgers/{ledger_id}" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID"Deletion fails with
409 Conflictif the ledger has journal entries or is a system/Plaid-managed account.