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

FieldTypeDescription
iduuidAccount UUID
objectaccountAlways 'account'
namestringAccount name
fully_qualified_namestringName with its parents, e.g. 'Revenue : Clinic A'
account_numberstring | nullAccount number, if the company numbers its accounts
account_typeasset | liability | equity | revenue | cost_of_goods_sold | expenseasset, liability, equity, revenue, cost_of_goods_sold or expense
detail_typestringDetail type (e.g. checking, accounts_receivable, service_revenue)
descriptionstring | nullDescription
activebooleanWhether the account is active
parent_iduuid | nullParent account UUID, for a sub-account
currencystringISO currency the account is kept in
merged_into_iduuid | nullFor an account merged into another: the account it now posts to

Endpoints

GET/api/v1/accounts

List 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

ParameterTypeDescription
account_typeasset | liability | equity | revenue | cost_of_goods_sold | expenseOnly this type: asset, liability, equity, revenue, cost_of_goods_sold or expense
activestring'true' for active accounts only, 'false' for inactive only
qstringMatch name, account number or description (case-insensitive)
pageintegerPage number (default 1)
per_pageintegerResults per page (default 50, max 200)
Example
curl https://imprest.ai/api/v1/accounts \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response · 200
{
  "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
ParameterTypeDescription
accountsrequiredobject[]Array of account objects
idrequireduuidAccount UUID
objectrequiredaccountAlways 'account'
namerequiredstringAccount name
fully_qualified_namerequiredstringName with its parents, e.g. 'Revenue : Clinic A'
account_numberrequiredstring | nullAccount number, if the company numbers its accounts
account_typerequiredasset | liability | equity | revenue | cost_of_goods_sold | expenseasset, liability, equity, revenue, cost_of_goods_sold or expense
detail_typerequiredstringDetail type (e.g. checking, accounts_receivable, service_revenue)
descriptionrequiredstring | nullDescription
activerequiredbooleanWhether the account is active
parent_idrequireduuid | nullParent account UUID, for a sub-account
currencyrequiredstringISO currency the account is kept in
merged_into_idrequireduuid | nullFor an account merged into another: the account it now posts to
paginationrequiredobjectWhere this page sits in the whole list
pagerequiredintegerThis page's number, from 1
per_pagerequiredintegerResults per page (1-200, default 50)
total_countrequiredintegerResults across every page
total_pagesrequiredintegerPages 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.

GET/api/v1/accounts/:id

Show 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

ParameterTypeDescription
idrequireduuidAccount UUID
Example
curl https://imprest.ai/api/v1/accounts/4c114635-ce0f-4b80-992f-5de81ada35a0 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response · 200
{
  "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
ParameterTypeDescription
accountrequiredobjectThe account
idrequireduuidAccount UUID
objectrequiredaccountAlways 'account'
namerequiredstringAccount name
fully_qualified_namerequiredstringName with its parents, e.g. 'Revenue : Clinic A'
account_numberrequiredstring | nullAccount number, if the company numbers its accounts
account_typerequiredasset | liability | equity | revenue | cost_of_goods_sold | expenseasset, liability, equity, revenue, cost_of_goods_sold or expense
detail_typerequiredstringDetail type (e.g. checking, accounts_receivable, service_revenue)
descriptionrequiredstring | nullDescription
activerequiredbooleanWhether the account is active
parent_idrequireduuid | nullParent account UUID, for a sub-account
currencyrequiredstringISO currency the account is kept in
merged_into_idrequireduuid | nullFor 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.