Skip to content

Create ledger

POST/api/v1/ledgers

Create a new account in the chart of accounts.

Operation ID: create_ledger·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

namestringrequired

Ledger name (e.g., 'Operating Cash', 'Sales Revenue').

currencystring

Currency for this account (USD, CAD, AUD, EUR, or GBP). Defaults to business default.

editableboolean

Whether journal entries can be manually posted to this account.

typestring

Account type: asset, liability, equity, revenue, expense. Required in Custom Mode.

descriptionstring

Optional description of the account's purpose.

account_numberstring

Optional account number/code for chart-of-accounts numbering.

statusstring

Account status: 'active' or 'inactive'. Inactive accounts hidden from dropdowns.

debit_creditstring

Normal balance: 'debit' (assets/expenses) or 'credit' (liabilities/equity/revenue). Required in Custom Mode.

sort_codeinteger

Sort code for chart ordering (e.g. 1000 for assets, 4000 for revenue). Required in Custom Mode.

sub_typestring

Sub-classification (current_assets, operating_expenses, etc.). Required in Custom Mode.

report_cash_flowboolean

Include in cash flow statement. Required in Custom Mode.

financial_account_typestring

Templated Mode: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable.

parent_idstring

UUID of parent ledger for sub-accounts (e.g., 'Operating Expenses' → 'Office Supplies').

cash_flow_sectionCashFlowSectionEnum

Cash flow statement section (a local-only field).

cfs_classCashFlowClassEnum

Indirect-method cash flow classification. Determines which row of the Statement of Cash Flows this account populates. If omitted, the system derives it from type/sub_type/financial_account_type on first save; un-derivable rows must be set explicitly to pass cash-flow validation.

depreciation_tagDepreciationTagEnum

Marks this account as holding capitalizable spend: 'depreciable' or 'amortizable'. Tagged accounts can source fixed assets from their transactions.

Responses

201Successful Response

successboolean
messagestring
codestring
dataLedgerResponse

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.