Apply Suggested Chart
POST/api/ledger/setup/apply-suggested-chart
Manual accounting setup in two parts: create the chart of accounts, then wire each NominalCodeMappingSettings role to one of those accounts. Gated by the accounting.manage_settings permission.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Body (both optional, sent together — omit both to apply SKU's default chart + assignments):
accounts— the chart of accounts. Each:code(string),name(string),type(one of: Revenue, Expense, Asset, Liability, Equity, Bank, Current, Inventory, Fixed, Directcosts, Currliab, Termliab, Sales). Codes must be unique.assignments— arole→ accountcodemap. Keys are NominalCodeMappingSettings roles (e.g.sales_orders,cogs,inventory_control,accounts_payable); each value is one of the account codes above. Several roles may share a code (e.g.sales_orders+shipping_sales_ordersboth on4000).warehouse_inventory_accounts(optional) — a warehouse id → accountcodemap giving a warehouse its own inventory account (posting resolves the inventory account per warehouse). Each code must be one of the accounts above; unknown warehouses are skipped.
Only allowed when the tenant has NO chart yet — otherwise 422 on accounts. Every assignment must reference an account in accounts, else 422 on assignments; a warehouse mapped to a missing code is 422 on warehouse_inventory_accounts.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.