curl --request POST \
--url https://api.example.com/api/banking/rules \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "Income:Salary",
"assignAccountId": 1,
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}
'import requests
url = "https://api.example.com/api/banking/rules"
payload = {
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "Income:Salary",
"assignAccountId": 1,
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Monthly Salary',
order: 1,
applyIfAccountId: 1,
applyIfTransactionType: 'deposit',
conditionsType: 'and',
conditions: [{field: 'description', comparator: 'contains', value: 'Salary'}],
assignCategory: 'Income:Salary',
assignAccountId: 1,
assignPayee: 'Employer Inc.',
assignMemo: 'Monthly Salary'
})
};
fetch('https://api.example.com/api/banking/rules', 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://api.example.com/api/banking/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Monthly Salary',
'order' => 1,
'applyIfAccountId' => 1,
'applyIfTransactionType' => 'deposit',
'conditionsType' => 'and',
'conditions' => [
[
'field' => 'description',
'comparator' => 'contains',
'value' => 'Salary'
]
],
'assignCategory' => 'Income:Salary',
'assignAccountId' => 1,
'assignPayee' => 'Employer Inc.',
'assignMemo' => 'Monthly Salary'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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://api.example.com/api/banking/rules"
payload := strings.NewReader("{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.post("https://api.example.com/api/banking/rules")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/banking/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"id": 1,
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "InterestIncome",
"assignAccountId": 1,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}Create a new bank rule.
curl --request POST \
--url https://api.example.com/api/banking/rules \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "Income:Salary",
"assignAccountId": 1,
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}
'import requests
url = "https://api.example.com/api/banking/rules"
payload = {
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "Income:Salary",
"assignAccountId": 1,
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Monthly Salary',
order: 1,
applyIfAccountId: 1,
applyIfTransactionType: 'deposit',
conditionsType: 'and',
conditions: [{field: 'description', comparator: 'contains', value: 'Salary'}],
assignCategory: 'Income:Salary',
assignAccountId: 1,
assignPayee: 'Employer Inc.',
assignMemo: 'Monthly Salary'
})
};
fetch('https://api.example.com/api/banking/rules', 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://api.example.com/api/banking/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Monthly Salary',
'order' => 1,
'applyIfAccountId' => 1,
'applyIfTransactionType' => 'deposit',
'conditionsType' => 'and',
'conditions' => [
[
'field' => 'description',
'comparator' => 'contains',
'value' => 'Salary'
]
],
'assignCategory' => 'Income:Salary',
'assignAccountId' => 1,
'assignPayee' => 'Employer Inc.',
'assignMemo' => 'Monthly Salary'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$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://api.example.com/api/banking/rules"
payload := strings.NewReader("{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.post("https://api.example.com/api/banking/rules")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/banking/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Monthly Salary\",\n \"order\": 1,\n \"applyIfAccountId\": 1,\n \"applyIfTransactionType\": \"deposit\",\n \"conditionsType\": \"and\",\n \"conditions\": [\n {\n \"field\": \"description\",\n \"comparator\": \"contains\",\n \"value\": \"Salary\"\n }\n ],\n \"assignCategory\": \"Income:Salary\",\n \"assignAccountId\": 1,\n \"assignPayee\": \"Employer Inc.\",\n \"assignMemo\": \"Monthly Salary\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Monthly Salary",
"order": 1,
"applyIfAccountId": 1,
"applyIfTransactionType": "deposit",
"conditionsType": "and",
"conditions": [
{
"id": 1,
"field": "description",
"comparator": "contains",
"value": "Salary"
}
],
"assignCategory": "InterestIncome",
"assignAccountId": 1,
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z",
"assignPayee": "Employer Inc.",
"assignMemo": "Monthly Salary"
}Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Body
The name of the bank rule
"Monthly Salary"
The order of the bank rule
1
The account ID to apply the rule if
1
The transaction type to apply the rule if
"deposit"
The conditions type to apply the rule if
"and"
The conditions to apply the rule if
[
{
"field": "description",
"comparator": "contains",
"value": "Salary"
}
]
The category to assign the rule if
"Income:Salary"
The account ID to assign the rule if
1
The payee to assign the rule if
"Employer Inc."
The memo to assign the rule if
"Monthly Salary"
Response
The bank rule has been successfully created.
The unique identifier of the bank rule
1
The name of the bank rule
"Monthly Salary"
The order in which the rule should be applied
1
The account ID to apply the rule if
1
The transaction type to apply the rule if
deposit, withdrawal "deposit"
The conditions type to apply the rule if
and, or "and"
The conditions to apply the rule if
Show child attributes
Show child attributes
[
{
"id": 1,
"field": "description",
"comparator": "contains",
"value": "Salary"
}
]
The category to assign the rule if
InterestIncome, OtherIncome, Deposit, Expense, OwnerDrawings "InterestIncome"
The account ID to assign the rule if
1
The creation timestamp of the bank rule
"2024-03-20T10:00:00Z"
The last update timestamp of the bank rule
"2024-03-20T10:00:00Z"
The payee to assign the rule if
"Employer Inc."
The memo to assign the rule if
"Monthly Salary"