Update suggested categorization rule
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dismissed_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}"
payload = { "dismissed_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dismissed_at: '2023-11-07T05:31:56Z'})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dismissed_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}"
payload := strings.NewReader("{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "Create_Categorization_Rule_For_Counterparty",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"new_rule": {
"name": "<string>",
"category": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_1": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_2": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_3": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"apply_retroactively": false,
"external_id": "<string>",
"created_by_suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_type_filter": "<string>",
"transaction_description_filter": "<string>",
"counterparty_filter": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_min_filter": 123,
"amount_max_filter": 123
},
"suggestion_prompt": "<string>",
"transactions_that_will_be_affected": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_transaction_id": "g4DlKyjXqGH3Kp5XlaWMtwLRrE4Z9AiE8B4Ko",
"source_account_id": "Aaoy8G7VXZHVeqNoL1GvcmkPdqpLRWi9NArdG",
"external_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imported_at": "2023-11-07T05:31:56Z",
"date": "2023-11-07T05:31:56Z",
"amount": 123,
"counterparty_name": "WeWork",
"description": "WeWork monthly rent payment",
"account_name": "Plaid Checking",
"memo": "<string>",
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
],
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_name": "<string>",
"counterparty": {},
"accepted_at": "2023-11-07T05:31:56Z",
"dismissed_at": "2023-11-07T05:31:56Z"
}
}Categorization Rules
Update suggested categorization rule
Updates a suggested categorization rule.
PATCH
/
v1
/
businesses
/
{businessId}
/
categorization-rules
/
suggestions
/
{suggestionId}
Update suggested categorization rule
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dismissed_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}"
payload = { "dismissed_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dismissed_at: '2023-11-07T05:31:56Z'})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dismissed_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}"
payload := strings.NewReader("{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/categorization-rules/suggestions/{suggestionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dismissed_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "Create_Categorization_Rule_For_Counterparty",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"new_rule": {
"name": "<string>",
"category": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_1": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_2": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"suggestion_3": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"apply_retroactively": false,
"external_id": "<string>",
"created_by_suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_type_filter": "<string>",
"transaction_description_filter": "<string>",
"counterparty_filter": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount_min_filter": 123,
"amount_max_filter": 123
},
"suggestion_prompt": "<string>",
"transactions_that_will_be_affected": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_transaction_id": "g4DlKyjXqGH3Kp5XlaWMtwLRrE4Z9AiE8B4Ko",
"source_account_id": "Aaoy8G7VXZHVeqNoL1GvcmkPdqpLRWi9NArdG",
"external_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imported_at": "2023-11-07T05:31:56Z",
"date": "2023-11-07T05:31:56Z",
"amount": 123,
"counterparty_name": "WeWork",
"description": "WeWork monthly rent payment",
"account_name": "Plaid Checking",
"memo": "<string>",
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
],
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_name": "<string>",
"counterparty": {},
"accepted_at": "2023-11-07T05:31:56Z",
"dismissed_at": "2023-11-07T05:31:56Z"
}
}Use this endpoint to mark a categorization rules suggestion as not dismissed.
This allows the transaction categorization flow to show the suggestion again to the user.
Undoing a dismissed suggestion
Setdismissed_at to null to mark the suggestion as not dismissed and return it to normal suggestion flow.
Rejecting a suggestion
To reject a suggestion, see reject suggested categorization rule. Do not use this endpoint to set the dismissed_at field to some timestamp.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.
The UUID of the suggestion to update.
Body
application/json
Fields that can be patched on a suggested categorization rule.
Timestamp that marks the suggestion as dismissed. Set to null to clear dismissal.
Response
Suggested categorization rule updated successfully.
Consumer-facing rule suggestion for creating a categorization rule for a specific counterparty.
Show child attributes
Show child attributes
⌘I