---
title: "Creates a chart of accounts"
method: POST
path: "/chart-of-accounts"
tags: ["Chart of Accounts"]
---

# Creates a chart of accounts

`POST /chart-of-accounts`

## Request

- Base URL: `https://api.rillet.com`
- URL: `https://api.rillet.com/chart-of-accounts`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/rillet/apis/rillet-accounting-api/docs/chart-of-accounts/post.ts> (a function with typed inputs; its response is checked against the schema)

Initializes the entire chart of accounts for a bare organization in one atomic call.
The organization must have no existing chart of accounts; otherwise the request fails with 409.
The complete request is validated before any accounts or groups are created; validation failures return 400 without leaving a partial chart of accounts.

Structural invariants match CSV import: exactly one `Accounts Receivable`, `Accounts Payable`, `Sales Tax Liability`, and `Retained Earnings`;
at least one `Unbilled Revenue`, `Prepaid Expense`, and `Deferred Revenue`.
The same default group scaffold as CSV import is created.
Each account's optional `parent_grouping` reuses a scaffold group by name or creates a nested group under the account type root.
When the request contains exactly one `Prepaid Expense` account, expense accounts may omit `prepaid_account_code` to default to it;
when it contains multiple `Prepaid Expense` accounts, each expense account must reference one by code.
`Cash in Transit` is auto-created and must not appear in the request.

## Request body

- CreateChartOfAccountsRequest: Chart-of-accounts initialization payload for a bare organization. The accounts array must satisfy these structural subtype requirements: exactly one `Accounts Receivable`, `Accounts Payable`, `Sales Tax Liability`, and `Retained Earnings`; at least one `Unbilled Revenue`, `Prepaid Expense`, and `Deferred Revenue`.
  - `accounts` ChartOfAccountsAccountRequest[], required
    - `metadata` InlineMetadataValues: Partial metadata update keyed by definition key. Omitting this property preserves all existing metadata. When supplied, omitted keys remain unchanged; null, empty, or whitespace-only values clear only the named key.
    - `name` string, required: Display name of the account.
    - `code` string, required: Unique account code within the organization. May contain letters, numbers, periods, and dashes.
    - `type` 'ASSET' | 'LIABILITY' | 'EQUITY' | 'EXPENSE' | 'INCOME', required: Top-level accounting classification. Must be compatible with subtype. Allowed values: ASSET, LIABILITY, EQUITY, EXPENSE, INCOME.
    - `subtype` 'Revenue' | 'Cost of Goods Sold' | 'Operating Expense' | 'Equity' | 'Equity, Compensation' | 'Other Current Liability' | 'Other Long Term Liability' | 'Accounts Payable' | 'Accounts Receivable' | 'Credit Card' | 'Fixed Assets' | 'Accumulated Depreciation' | 'Other Current Asset' | 'Bank' | 'Allowance for Doubtful Accounts' | 'Unbilled Revenue' | 'Deferred Revenue' | 'Prepaid Expense' | 'Deferred Commissions' | 'Right of Use Asset' | 'Other Assets' | 'Restricted Cash' | 'Accrued Expense' | 'Sales Tax Liability' | 'Debt' | 'Lease Liability' | 'Customer Deposits' | 'Customer Credit' | 'Additional Paid In Capital' | 'Accumulated Other Comprehensive Income' | 'Retained Earnings' | 'Operating Expense - Personnel' | 'Operating Expense - Office Expenses' | 'Operating Expense - Sales & Marketing' | 'Operating Expense - Commissions' | 'Operating Expense - Research & Development' | 'Non Operating Expense' | 'Non Operating Income', required: Accounting subtype. The following exact values are accepted and must be paired with the indicated type: ASSET: `Accounts Receivable`, `Fixed Assets`, `Accumulated Depreciation`, `Other Current Asset`, `Bank`, `Allowance for Doubtful Accounts`, `Unbilled Revenue`, `Prepaid Expense`, `Deferred Commissions`, `Right of Use Asset`, `Other Assets`, `Restricted Cash`. LIABILITY: `Other Current Liability`, `Other Long Term Liability`, `Accounts Payable`, `Credit Card`, `Deferred Revenue`, `Accrued Expense`, `Sales Tax Liability`, `Debt`, `Lease Liability`, `Customer Deposits`, `Customer Credit`. EQUITY: `Equity`, `Equity, Compensation`, `Additional Paid In Capital`, `Accumulated Other Comprehensive Income`, `Retained Earnings`. EXPENSE: `Cost of Goods Sold`, `Operating Expense`, `Operating Expense - Personnel`, `Operating Expense - Office Expenses`, `Operating Expense - Sales & Marketing`, `Operating Expense - Commissions`, `Operating Expense - Research & Development`, `Non Operating Expense`, `Non Operating Income`. INCOME: `Revenue`.
    - `intercompany` boolean, required: Whether the account is used for intercompany accounting.
    - `parent_grouping` string: Custom group name for the account. Reuses a default scaffold group by name or creates a nested group under the account type root.
    - `prepaid_account_code` string: Code of a `Prepaid Expense` account in the same request. Required on expense accounts when the request contains multiple `Prepaid Expense` accounts; when the request contains exactly one, expense accounts may omit this field to default to it.

## Response `200`

OK

- object
  - `accounts` Account[], required
    - `metadata` object, nullable: Values keyed by metadata definition key, including stored values of archived definitions. Unset keys are omitted. Returns an empty object when no values exist.
    - `id` string, uuid, required
    - `code` string, required: The account code found in the Chart of Accounts
    - `name` string, required
    - `type` 'ASSET' | 'LIABILITY' | 'EQUITY' | 'EXPENSE' | 'INCOME', required
    - `subtype` string, required
    - `status` 'ACTIVE' | 'INACTIVE', required
    - `intercompany` boolean, required
    - `parent_grouping` string, required: Name of the account group this account belongs to.
    - `prepaid_account_code` string, nullable: Code of the linked prepaid expense account. Applies to EXPENSE accounts; null for other account types.
    - `updated_at` string, date-time, required: ISO 8601 timestamp in UTC timezone (must end with 'Z')

## Other responses

- `default`: Error

## Changes

- **2026-11-03** `c393d0102005`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rillet/apis/rillet-accounting-api/changes/chart-of-accounts/post.md)

---

[API](https://skmtc.dev/rillet/apis/rillet-accounting-api.md) - [All operations](https://skmtc.dev/rillet/apis/rillet-accounting-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rillet/apis/rillet-accounting-api/revisions/c393d0102005?raw)
