curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "StableName",
"stable_name": "MEALS"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "AccountId",
"id": "5b83ccb3-bdb3-42ab-8e88-c2222bfa97df"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Split",
"entries": [
{
"category": {
"type": "StableName",
"stable_name": "MEALS"
},
"amount": 4250
},
{
"category": {
"type": "StableName",
"stable_name": "BUSINESS_TRAVEL"
},
"amount": 6000
}
]
}'
{
"data":{
"id":"c63a7a21-d6d7-4d3a-b8f3-e419161a9516",
"type":"Bank_Transaction",
"transaction_type":"Book",
"business_id":"cfee5365-dcc3-425e-b403-cc9568f7121e",
"source":"API",
"source_transaction_id":"11111114",
"source_account_id":"111113",
"imported_at":"2023-06-07T00:48:25.784724Z",
"date":"2023-05-10T14:13:07Z",
"direction":"DEBIT",
"amount":5670,
"counterparty_name":"Home Depot",
"description":"HOMEDEPOT MI59",
"categorization_status":"CATEGORIZED",
"category":{
"category":"SUPPLIES",
"display_name":"Supplies"
},
"categorization_method":"LAYER_AUTO",
"categorization_flow":{
"type":"ASK_FROM_SUGGESTIONS",
"categories":[
{
"category":"SUPPLIES",
"display_name":"Supplies"
},
{
"category":"EQUIPMENT",
"display_name":"Business equipment"
},
{
"category":"MARKETING",
"display_name":"Marketing expenses"
}
]
}
},
"meta":{
}
}
{
"data": {
"type": "Bank_Transaction",
"id": "56759ace-1b5a-47ca-9271-94bf4b2c1005",
"business_id": "96d483a3-fa80-46a1-a6cb-41d8120f7874",
"source": "PLAID",
"source_transaction_id": "test-id-1",
"source_account_id": "account-1",
"imported_at": "2024-07-15T20:02:03.167163Z",
"date": "2024-07-15T20:02:02.965531Z",
"direction": "DEBIT",
"amount": 10250,
"counterparty_name": "Test counterparty",
"description": null,
"account_name": "Default Test Client Banking",
"categorization_status": "SPLIT",
"category": {
"type": "Split_Categorization",
"entries": [
{
"amount": 4250,
"category": {
"id": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"stable_name": "MEALS",
"category": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"display_name": "Meals"
}
},
{
"amount": 6000,
"category": {
"id": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"stable_name": "BUSINESS_TRAVEL",
"category": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"display_name": "Business travel"
}
}
]
},
"categorization_method": "API",
"categorization_flow": null,
"projected_income_category": "EXPENSE",
"suggested_matches": [],
"match": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
}
Categorize a Transaction
This endpoint allows you to categorize a bank transaction that has been imported into Layer.
PUT
/
v1
/
businesses
/
{business_id}
/
bank-transactions
/
{bank_transaction_id}
/
categorize
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "StableName",
"stable_name": "MEALS"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "AccountId",
"id": "5b83ccb3-bdb3-42ab-8e88-c2222bfa97df"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Split",
"entries": [
{
"category": {
"type": "StableName",
"stable_name": "MEALS"
},
"amount": 4250
},
{
"category": {
"type": "StableName",
"stable_name": "BUSINESS_TRAVEL"
},
"amount": 6000
}
]
}'
{
"data":{
"id":"c63a7a21-d6d7-4d3a-b8f3-e419161a9516",
"type":"Bank_Transaction",
"transaction_type":"Book",
"business_id":"cfee5365-dcc3-425e-b403-cc9568f7121e",
"source":"API",
"source_transaction_id":"11111114",
"source_account_id":"111113",
"imported_at":"2023-06-07T00:48:25.784724Z",
"date":"2023-05-10T14:13:07Z",
"direction":"DEBIT",
"amount":5670,
"counterparty_name":"Home Depot",
"description":"HOMEDEPOT MI59",
"categorization_status":"CATEGORIZED",
"category":{
"category":"SUPPLIES",
"display_name":"Supplies"
},
"categorization_method":"LAYER_AUTO",
"categorization_flow":{
"type":"ASK_FROM_SUGGESTIONS",
"categories":[
{
"category":"SUPPLIES",
"display_name":"Supplies"
},
{
"category":"EQUIPMENT",
"display_name":"Business equipment"
},
{
"category":"MARKETING",
"display_name":"Marketing expenses"
}
]
}
},
"meta":{
}
}
{
"data": {
"type": "Bank_Transaction",
"id": "56759ace-1b5a-47ca-9271-94bf4b2c1005",
"business_id": "96d483a3-fa80-46a1-a6cb-41d8120f7874",
"source": "PLAID",
"source_transaction_id": "test-id-1",
"source_account_id": "account-1",
"imported_at": "2024-07-15T20:02:03.167163Z",
"date": "2024-07-15T20:02:02.965531Z",
"direction": "DEBIT",
"amount": 10250,
"counterparty_name": "Test counterparty",
"description": null,
"account_name": "Default Test Client Banking",
"categorization_status": "SPLIT",
"category": {
"type": "Split_Categorization",
"entries": [
{
"amount": 4250,
"category": {
"id": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"stable_name": "MEALS",
"category": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"display_name": "Meals"
}
},
{
"amount": 6000,
"category": {
"id": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"stable_name": "BUSINESS_TRAVEL",
"category": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"display_name": "Business travel"
}
}
]
},
"categorization_method": "API",
"categorization_flow": null,
"projected_income_category": "EXPENSE",
"suggested_matches": [],
"match": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
}
Path Parameters
ID of the Business the bank transaction is associated with.
Body
Either aCategory or a Split may be provided.
Splits are 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
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 Fetch transaction categories endpoint. Category payload using a StableName
Category payload using an AccountId
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.Array of entries consisting of a category and an amount.
Show properties
Show properties
Response
Returns the categorized Bank Transaction Objectcurl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "StableName",
"stable_name": "MEALS"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Category",
"category": {
"type": "AccountId",
"id": "5b83ccb3-bdb3-42ab-8e88-c2222bfa97df"
}
}'
curl -X POST https://sandbox.layerfi.com/v1/businesses/863ed926-e30d-40f4-8e7e-b0d5387ce4fb/bank-transactions/67cee0d8-3b8e-4b4b-a857-78ce3bb1d895/categorize \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"type": "Split",
"entries": [
{
"category": {
"type": "StableName",
"stable_name": "MEALS"
},
"amount": 4250
},
{
"category": {
"type": "StableName",
"stable_name": "BUSINESS_TRAVEL"
},
"amount": 6000
}
]
}'
{
"data":{
"id":"c63a7a21-d6d7-4d3a-b8f3-e419161a9516",
"type":"Bank_Transaction",
"transaction_type":"Book",
"business_id":"cfee5365-dcc3-425e-b403-cc9568f7121e",
"source":"API",
"source_transaction_id":"11111114",
"source_account_id":"111113",
"imported_at":"2023-06-07T00:48:25.784724Z",
"date":"2023-05-10T14:13:07Z",
"direction":"DEBIT",
"amount":5670,
"counterparty_name":"Home Depot",
"description":"HOMEDEPOT MI59",
"categorization_status":"CATEGORIZED",
"category":{
"category":"SUPPLIES",
"display_name":"Supplies"
},
"categorization_method":"LAYER_AUTO",
"categorization_flow":{
"type":"ASK_FROM_SUGGESTIONS",
"categories":[
{
"category":"SUPPLIES",
"display_name":"Supplies"
},
{
"category":"EQUIPMENT",
"display_name":"Business equipment"
},
{
"category":"MARKETING",
"display_name":"Marketing expenses"
}
]
}
},
"meta":{
}
}
{
"data": {
"type": "Bank_Transaction",
"id": "56759ace-1b5a-47ca-9271-94bf4b2c1005",
"business_id": "96d483a3-fa80-46a1-a6cb-41d8120f7874",
"source": "PLAID",
"source_transaction_id": "test-id-1",
"source_account_id": "account-1",
"imported_at": "2024-07-15T20:02:03.167163Z",
"date": "2024-07-15T20:02:02.965531Z",
"direction": "DEBIT",
"amount": 10250,
"counterparty_name": "Test counterparty",
"description": null,
"account_name": "Default Test Client Banking",
"categorization_status": "SPLIT",
"category": {
"type": "Split_Categorization",
"entries": [
{
"amount": 4250,
"category": {
"id": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"stable_name": "MEALS",
"category": "fa30634d-9ebe-42bf-a99f-0fff97f8b8e9",
"display_name": "Meals"
}
},
{
"amount": 6000,
"category": {
"id": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"stable_name": "BUSINESS_TRAVEL",
"category": "4bcf9027-532e-4c9e-b030-b5cc3264fdf8",
"display_name": "Business travel"
}
}
]
},
"categorization_method": "API",
"categorization_flow": null,
"projected_income_category": "EXPENSE",
"suggested_matches": [],
"match": null,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Team",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
}