Skip to main content
GET
/
v1
/
businesses
/
{businessId}
/
categories
Fetch transaction categories
curl --request GET \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/categories \
  --header 'Authorization: Bearer <token>'
{
  "type": "Category_List",
  "categories": [
    {
      "type": "AccountNested",
      "id": "e95c8640-f87b-43bf-a9c6-cabc7ebfdec6",
      "stable_name": "EXPENSES",
      "display_name": "Expenses",
      "subCategories": "<array>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.layerfi.com/llms.txt

Use this file to discover all available pages before exploring further.

Retrieves the list of usable transaction categories based on the business’ chart of accounts. This endpoint returns a list of transaction categories that should be used when building your own user interface to display options in a transaction categorization user interface.
If you are primarily using Layer’s embedded components, you likely won’t need to use this API endpoint directly.

Types

There are three types of categories you’ll find in the category list: AccountNested, OptionalAccountNested, and ExclusionNested.

AccountNested

AccountNested represents a required template account in the business’s chart of accounts.

OptionalAccountNested

OptionalAccountNested represents an optional template account in the business’s chart of accounts.

ExclusionNested

ExclusionNested represents an exclusion type that can be used to exclude a transaction from the business’s accounting.

Interpreting the category list

In all cases, use display_name to present the category to the user. Use the columns below to choose a stable identifier.
Category typeAccountIdStableNameIdentify withNotes
Optional template accountAfter instantiationYesStableName (always); AccountId once instantiatedOptional accounts only have an AccountId after first use. Use StableName to reference them before instantiation.
User-defined custom accountYesNoAccountId onlyA new AccountId is created when the account is added; no stable name is assigned.
Required template accountYesYesAccountId or StableNameThe stable name is the same as the account name.
ExclusionNoYesStableNameThe exclusion type acts as the stable name; exclusions have no AccountId.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json.

Path Parameters

businessId
string
required

The UUID of the business to fetch the tree of available categories for.

Response

200 - application/json

List of the categories available for a business.

type
string

Resource type. Value will be 'Category_List'.

Example:

"Category_List"

categories
(AccountNested · object | OptionalAccountNested · object | ExclusionNested · object)[]

Array of categories in a business, where each category is a polymorphic type that can be an Account, OptionalAccount, or an Exclusion. For more details, see Account Identifiers and Categorization.

A category that represents a required template account in the business's chart of accounts.