> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tight.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chart of Accounts

## 1. How it works

As explained in the [Accounting API docs](/v5.0/products/accounting), Tight's "Invisible" Double-Entry Accounting is enabled in the background for all users. That is built on-top of Tight's best practice Chart of Accounts, vetted by thousands of CPAs and accountants, and custom-fitted to your users' needs.

When you [create a user](/v5.0/getting-started/quickstart/user-creation) via the Tight API, and you specify their business type, Tight automatically generates a chart of accounts for that user. Should that user's situation change, e.g. they convert from a sole-proprietorship to an S-corporation, Tight's API will take care of the necessary modifications to the Chart of Accounts accordingly. As you may know, the Equity section will look different for sole proprietorships vs. S-corps, and the Tight API takes care of this for you, ensuring your products will serve your users as they continue to evolve.

> 📘 Custom chart of accounts
>
> Many of Tight's API Partners opt to design their own custom Chart of Accounts based on their users' specific use case. The Tight API supports any number of custom Chart of Accounts templates, and the Chart of Accounts can be manipulated at a user or partner level at any point in the time, via UI or API.

## 2. What it enables

Having a Chart of Accounts behind the scenes means that your users always have a Balance Sheet available with data updated in real-time. Most businesses have to wait for their accountant to compile their Balance Sheet at the beginning of the following month. With the Tight API, this is available in *real-time*!

## 3. Getting the user's chart of accounts

At any time, you can [display the chart of accounts](/v5.0/embeddable-ui/accounting/chart-of-accounts-component) or programmatically [retrieve the user's chart of accounts](/v5.0/products/accounting/chart-of-accounts):

```curl theme={null}
curl \
  --request GET \
  --url https://sandbox.hurdlr.com/rest/v5/accounting/chartOfAccounts \
  --header 'Authorization: Bearer ${access_token}' \
  --header 'Content-Type: application/json' \
```

The response from GET /chartOfAccounts contains an array of `accounts`, with nested `childAccounts`:

```json theme={null}
[
  {
    "accountNo": "10000",
    "name": "Assets",
    "balance": 250917.65,
    "parentAccountNo": null,
    "childAccounts": [
      {
        "accountNo": "11000",
        "name": "Current Assets",
        "balance": 250917.65,
        "parentAccountNo": "10000",
        "childAccounts": [
          {
            "accountNo": "11001",
            "name": "Citi - Checking *0000",
            "balance": 5475.11,
            "parentAccountNo": "11000",
            "childAccounts": []
          },
          {
            "accountNo": "11002",
            "name": "Citi - Savings *1111",
            "balance": 21.10,
            "parentAccountNo": "11000",
            "childAccounts": []
          },
          ...
        ]
      },
      ...    
    ]
  },
  ...
]
```

## 4. Displaying a real-time balance sheet

The [above response](/v5.0/products/accounting/chart-of-accounts#3-getting-the-users-chart-of-accounts) contains a hierarchical list of accounts, making it easy to display a drill-down list of accounts. On each account record, you may find the following attributes to be of particular interest:

| Field         | Description                                                               | Format                         |
| :------------ | :------------------------------------------------------------------------ | :----------------------------- |
| accountNo     | Account number, often used by bookkeepers to reference a specific account | String (of numbers)            |
| name          | Name of the account                                                       | String                         |
| balance       | Total balance of the account, including all children accounts             | Numeric, with 2 decimal places |
| childAccounts | Accounts that are hierarchically beneath the given account                | Array of accounts              |

To display a real-time balance sheet, you can simply show a list of the top-level accounts, i.e. the `accountNo`, `name`, and `balance` of each of the accounts residing in the top-level objects of the /chartOfAccounts response. For example, `response[0].name` would show "Assets" and `response[1].name` would show "Liabilities.

If your users clicks on Assets, you could then render the `childAccounts` within that item. For example, `response[0].childAccounts[0].name` would show "Current Assets".

The Tight API team recognizes that developers are not usually accountants. Don't hesitate to email us at [api@tight.com](mailto:api@tight.com), and we would be glad to help you with your real-time balance sheet implementation.
