Accounts
The company's chart of accounts, read-only. Use it to find the account ids your writes name: the account on each journal entry line, a sales receipt's income line, an expense's category. Accounts are created and changed in the app. Requires accounts:read (or the broad reports scope).
The list is ordered by fully qualified name (“Revenue : Clinic A”) and paginates. An account merged into another is left out of the list; fetching it by id still works and returns merged_into_id, the account it now posts to, so an id you stored before the merge can be followed. Balances are not part of this resource.
The Account Object
| Field | Type | Description |
|---|---|---|
| id | uuid | Account UUID |
| object | account | Always 'account' |
| name | string | Account name |
| fully_qualified_name | string | Name with its parents, e.g. 'Revenue : Clinic A' |
| account_number | string | null | Account number, if the company numbers its accounts |
| account_type | asset | liability | equity | revenue | cost_of_goods_sold | expense | asset, liability, equity, revenue, cost_of_goods_sold or expense |
| detail_type | string | Detail type (e.g. checking, accounts_receivable, service_revenue) |
| description | string | null | Description |
| active | boolean | Whether the account is active |
| parent_id | uuid | null | Parent account UUID, for a sub-account |
| currency | string | ISO currency the account is kept in |
| merged_into_id | uuid | null | For an account merged into another: the account it now posts to |
Endpoints
/api/v1/accountsList accounts
Returns the chart of accounts, ordered by fully qualified name. Accounts merged into another are left out.
Scopes: accounts:read or reports·operationId: listAccounts
Path & Query Parameters
| Parameter | Type | Description |
|---|---|---|
| account_type | asset | liability | equity | revenue | cost_of_goods_sold | expense | Only this type: asset, liability, equity, revenue, cost_of_goods_sold or expense |
| active | string | 'true' for active accounts only, 'false' for inactive only |
| q | string | Match name, account number or description (case-insensitive) |
| page | integer | Page number (default 1) |
| per_page | integer | Results per page (default 50, max 200) |
curl https://imprest.ai/api/v1/accounts \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"accounts": [
{
"id": "d494c790-2fb2-59f2-9a8f-5054e82f1792",
"object": "account",
"name": "Foreign Currency Gain/Loss",
"fully_qualified_name": "Foreign Currency Gain/Loss",
"account_number": null,
"account_type": "revenue",
"detail_type": "foreign_currency_gain_loss",
"description": null,
"active": true,
"parent_id": null,
"currency": "USD",
"merged_into_id": null
},
{
"id": "9f2d8dc1-b9c7-56ad-9c70-aa4c28040c74",
"object": "account",
"name": "Gain/Loss on Disposal of Assets",
"fully_qualified_name": "Gain/Loss on Disposal of Assets",
"account_number": null,
"account_type": "revenue",
"detail_type": "gain_loss_on_disposal",
"description": null,
"active": true,
"parent_id": null,
"currency": "USD",
"merged_into_id": null
}
],
"pagination": {
"page": 1,
"per_page": 200,
"total_count": 4,
"total_pages": 1
}
}Response fields
| Parameter | Type | Description |
|---|---|---|
| accountsrequired | object[] | Array of account objects |
| idrequired | uuid | Account UUID |
| objectrequired | account | Always 'account' |
| namerequired | string | Account name |
| fully_qualified_namerequired | string | Name with its parents, e.g. 'Revenue : Clinic A' |
| account_numberrequired | string | null | Account number, if the company numbers its accounts |
| account_typerequired | asset | liability | equity | revenue | cost_of_goods_sold | expense | asset, liability, equity, revenue, cost_of_goods_sold or expense |
| detail_typerequired | string | Detail type (e.g. checking, accounts_receivable, service_revenue) |
| descriptionrequired | string | null | Description |
| activerequired | boolean | Whether the account is active |
| parent_idrequired | uuid | null | Parent account UUID, for a sub-account |
| currencyrequired | string | ISO currency the account is kept in |
| merged_into_idrequired | uuid | null | For an account merged into another: the account it now posts to |
| paginationrequired | object | Where this page sits in the whole list |
| pagerequired | integer | This page's number, from 1 |
| per_pagerequired | integer | Results per page (1-200, default 50) |
| total_countrequired | integer | Results across every page |
| total_pagesrequired | integer | Pages in the whole list (at least 1) |
Errors
401No valid access token (invalid_token).403The token or the person behind it can't do this: insufficient_scope names the scope the token lacks; forbidden means the person's role doesn't allow it.422An unknown account_type or a malformed active filter (invalid_filter)
Every error uses the same envelope: error, message and error_code.
/api/v1/accounts/:idShow an account
Returns one account. An account merged into another still answers, with merged_into_id.
Scopes: accounts:read or reports·operationId: getAccount
Path & Query Parameters
| Parameter | Type | Description |
|---|---|---|
| idrequired | uuid | Account UUID |
curl https://imprest.ai/api/v1/accounts/4c114635-ce0f-4b80-992f-5de81ada35a0 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"account": {
"id": "4c114635-ce0f-4b80-992f-5de81ada35a0",
"object": "account",
"name": "Sales (dup)",
"fully_qualified_name": "Sales (dup)",
"account_number": null,
"account_type": "revenue",
"detail_type": "sales_of_product_income",
"description": null,
"active": false,
"parent_id": null,
"currency": "USD",
"merged_into_id": "6c738cd1-e888-5afe-b0c0-628ac6316713"
}
}Response fields
| Parameter | Type | Description |
|---|---|---|
| accountrequired | object | The account |
| idrequired | uuid | Account UUID |
| objectrequired | account | Always 'account' |
| namerequired | string | Account name |
| fully_qualified_namerequired | string | Name with its parents, e.g. 'Revenue : Clinic A' |
| account_numberrequired | string | null | Account number, if the company numbers its accounts |
| account_typerequired | asset | liability | equity | revenue | cost_of_goods_sold | expense | asset, liability, equity, revenue, cost_of_goods_sold or expense |
| detail_typerequired | string | Detail type (e.g. checking, accounts_receivable, service_revenue) |
| descriptionrequired | string | null | Description |
| activerequired | boolean | Whether the account is active |
| parent_idrequired | uuid | null | Parent account UUID, for a sub-account |
| currencyrequired | string | ISO currency the account is kept in |
| merged_into_idrequired | uuid | null | For an account merged into another: the account it now posts to |
Errors
401No valid access token (invalid_token).403The token or the person behind it can't do this: insufficient_scope names the scope the token lacks; forbidden means the person's role doesn't allow it.404Account not found (not_found)
Every error uses the same envelope: error, message and error_code.