Categorize bank transaction
Categorize a bank transaction to an account defined in the chart of accounts.
Request Body: Single Category or Split
All categorizations are either a singleCategory or a Split.
- Category is used to categorize the transaction as a single (non-split) category. This will be the case the vast majority of the time.
- Split is used when the transaction’s value should be allocated across multiple categories. This is most commonly the case when multiple items are purchased and those items should be categorized separately.
Category and Exclusion are both single-category request bodies: they assign the entire transaction to one account identifier. Split is a separate request body type that allocates the transaction’s value across multiple categories.
Category
Category payloads should have a type field and a category field. This category field can be any Account Identifier. The available categories can be fetched using the Get Chart of Accounts endpoint.Option 1: Payload using a StableName
Category when categorizing the transaction as a single (non-split) category.Option 2: Payload using an AccountId
Category when categorizing the transaction as a single (non-split) category.Option 3: Payload using an Exclusion
Category when categorizing the transaction as a single (non-split) category, and the category is an exclusion.Split Categorizations
Splits are specified with an array of categorizations, as above, with an amount tied to each category. The total amount must exactly equal the amount of the transaction. Amounts are always specified in positive cents.Split Payload
Split when categorizing the transaction as a single (non-split) category.Tax Code
tax_code is an optional field, available on both the Category and Split entry payloads, that assigns a Canada Revenue Agency tax code (e.g. GST, PST, HST, QST) to a categorization.
code values returned in tax_options on the Bank Transaction object for the codes valid on that transaction’s date. Cannot be used together with an Exclusion category.Rules Suggestion
Responses may includeupdate_categorization_rules_suggestion when Layer recommends creating a reusable categorization rule.
For more details, see Categorization Rule Suggestions.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business that the transaction to categorize belongs to.
The UUID of the bank transaction to categorize.
Body
Provide either a Category payload (single categorization) or a Split payload (array of entries with category + amount).
- Category
- Split
Categorization payload for a bank transaction. Use Category for one category, or Split for multiple category entries that sum to the transaction amount.
Discriminator for a single-category payload.
Category A single-category classification to apply to the full transaction amount.
- Account ID
- Account Stable Name
- Exclusion
Tax code to apply to the categorization. Currently only supported for businesses incorporated in Canada (country is CA) and cannot be used with an Exclusion category. Use a code from tax_options on the Bank Transaction object that is valid for the transaction's date.
"GST_PST_BC"