Accounts

Create a portfolio account

Creates one Chart of Accounts row. Requires Advanced Ledger; when it is unavailable, returns HTTP 403 with the flat response fields statusCode: 403, code: "FeatureNotEnabledError", and message containing the complete actionable reason: "Advanced Ledger is required to create accounts. Ask a workspace owner or billing manager to enable it." Omit subType and normalBalanceType to derive them from the account type and currency. A requested parent must have the same account type as the new account and must not carry journal activity. Returning the canonical account response also requires ledger-account view permission.

post/v1/portfolios/{portfolioSlug}/accounts

Request

  • Base URL: https://api.tokenbooks.io (the document declares no server; this is the origin it was published from)
  • URL: https://api.tokenbooks.io/v1/portfolios/{portfolioSlug}/accounts
  • Auth: API key in header x-api-key

Path parameters

portfolioSlugstring required

Workspace-scoped portfolio slug

Request body

accountNumberstring required

Portfolio-unique ledger account number.

namestring required

Ledger account name.

accountType'ASSET' | 'LIABILITY' | 'EQUITY' | 'INCOME' | 'EXPENSE' required

Top-level account type.

currencyAssetIdstring required

Currency asset identifier for the account.

subTypestring

Account subtype. Derived from the account type when omitted.

normalBalanceType'DR' | 'CR'

Normal-balance side. Derived from the account type when omitted.

parentAccountNumberstring nullable

Parent ledger account number. Omit or send null for a root account.

paymentLabelstring nullable

Optional label shown in payment account selection.

isActiveboolean

Whether the account starts active. Defaults to true.

Response

The created account in the shared account row shape.

accountNumberstring required

Ledger account number.

namestring required

Ledger account name.

paymentLabelstring nullable required

Optional label shown in payment account selection.

accountType'ASSET' | 'LIABILITY' | 'EQUITY' | 'INCOME' | 'EXPENSE' required

Top-level account type.

subTypestring required

Persisted account subtype.

normalBalanceType'DR' | 'CR' required

Debit or credit normal-balance side.

isActiveboolean required

Whether the account is currently marked active.

origin'SYSTEM_MANAGED' | 'SYSTEM_DEFAULT' | 'USER_MANAGED' required

Which code path created this account: engine-managed, engine fallback, or user-created. A user-created value may also mean the one-time backfill migration could not disambiguate an older row.

Changes

No recorded changes to this operation across all 1 revision of this API.