# Chart of accounts

> List the accounts in an organization's chart of accounts through the AccountFUN public API.

Source: https://www.accountfun.com/docs/api/chart-of-accounts/

The chart of accounts endpoint returns the ledger accounts an organization uses to code transactions. Use it to populate account selectors in your integration, or to find the `accountId` you need when creating invoice line items.

Requires the `chart_of_accounts:read` scope. See [Authentication](https://www.accountfun.com/docs/api/authentication/).

## Endpoint

| Method | Path                        | Scope                    | Description        |
| ------ | --------------------------- | ------------------------ | ------------------ |
| `GET`  | `/api/v1/chart-of-accounts` | `chart_of_accounts:read` | List all accounts. |

***

## List accounts

Returns every account in the token’s organization, sorted by account code.

### Request

```bash
curl https://app.accountfun.com/api/v1/chart-of-accounts \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Response — `200 OK`

```json
{
  "accounts": [
    {
      "id": "00000000-0000-0000-0000-00000000000a",
      "code": "400",
      "name": "Sales Revenue",
      "type": "Revenue",
      "isActive": true,
      "isSystem": false,
      "systemRole": null,
      "defaultTaxRateId": "00000000-0000-0000-0000-0000000000aa",
      "description": "General sales income",
      "longDescription": "Revenue from the sale of goods and services"
    },
    {
      "id": "00000000-0000-0000-0000-000000000010",
      "code": "610",
      "name": "Accounts Receivable",
      "type": "CurrentAsset",
      "isActive": true,
      "isSystem": true,
      "systemRole": "ACCOUNTS_RECEIVABLE",
      "defaultTaxRateId": null,
      "description": "System account for tracking amounts owed by customers"
    }
  ]
}
```

### Fields

| Field              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`               | The account UUID. Pass this as `accountId` on invoice line items and other transactions.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `code`             | The account code (e.g. `400`). Numeric or alphanumeric; sorted ascending.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `name`             | Human-readable account name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `type`             | The account class. Income accounts use `Revenue`, `Sales`, or `OtherIncome`; assets use `Bank`, `CurrentAsset`, `FixedAsset`, etc. See the [account types](#account-types) table below.                                                                                                                                                                                                                                                                                                                              |
| `isActive`         | Whether the account can be selected for new transactions. Inactive accounts are kept for historical reporting.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `isSystem`         | `true` for seeded control/system accounts that have special behavior.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `systemRole`       | For system accounts, the role they play: `ACCOUNTS_RECEIVABLE`, `ACCOUNTS_PAYABLE`, `TAX_PAYABLE`, `REALIZED_FX`, `UNREALIZED_FX`, `UNREALIZED_FX_BANK`, `RETAINED_EARNINGS`, `CUSTOM_ADJUSTMENTS`, `DEPRECIATION_EXPENSE`, `ACCUMULATED_DEPRECIATION`, `AMORTIZATION_EXPENSE`, `ACCUMULATED_AMORTIZATION`, `INVENTORY_ASSET`, `COGS`, `ROUNDING`, `PREPAYMENT` or `CUSTOMER_DEPOSIT`. `null` for other accounts, including bank accounts. Use it rather than `code` to find a system account — codes can be edited. |
| `defaultTaxRateId` | The default tax rate applied to this account. `null` if none.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `description`      | Free-text description. May be `null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `longDescription`  | Longer free-text description. May be `null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

Finding the right account

When creating an invoice, you need the `accountId` of an **income** account (type `Revenue`, `Sales`, or `OtherIncome`). Filter the response by `type` to present the right options to your users. Avoid system accounts (where `isSystem` is `true`) for line items unless you have a specific reason — they have reserved roles.

## Account types

AccountFUN uses granular account types that map to the five standard double-entry classes:

| Type                  | Class     | Normal balance |
| --------------------- | --------- | -------------- |
| `Bank`                | Asset     | Debit          |
| `CurrentAsset`        | Asset     | Debit          |
| `FixedAsset`          | Asset     | Debit          |
| `IntangibleAsset`     | Asset     | Debit          |
| `Inventory`           | Asset     | Debit          |
| `NonCurrentAsset`     | Asset     | Debit          |
| `Prepayment`          | Asset     | Debit          |
| `CurrentLiability`    | Liability | Credit         |
| `Liability`           | Liability | Credit         |
| `NonCurrentLiability` | Liability | Credit         |
| `LongTermLiability`   | Liability | Credit         |
| `Equity`              | Equity    | Credit         |
| `Revenue`             | Income    | Credit         |
| `Sales`               | Income    | Credit         |
| `OtherIncome`         | Income    | Credit         |
| `Expense`             | Expense   | Debit          |
| `DirectCosts`         | Expense   | Debit          |
| `Overhead`            | Expense   | Debit          |
| `Depreciation`        | Expense   | Debit          |

Read the [Chart of accounts guide](https://www.accountfun.com/docs/guides/chart-of-accounts/) for the in-product explanation of how accounts are organized and used.
