Skip to main content

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.

Authorization

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 — a role → account code map. 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_orders both on 4000).
  • warehouse_inventory_accounts (optional) — a warehouse id → account code map 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

OK

Response Headers
    Content-Type