Set a budget
curl --request POST \
--url https://api.finta.io/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "template",
"amount": 1,
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rolloverEnabled": true,
"targetAmount": 1,
"targetDate": "2023-12-25",
"startPeriod": "<string>",
"plan": "<string>"
}
'import requests
url = "https://api.finta.io/v2/budgets"
payload = {
"scope": "template",
"amount": 1,
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rolloverEnabled": True,
"targetAmount": 1,
"targetDate": "2023-12-25",
"startPeriod": "<string>",
"plan": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'template',
amount: 1,
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
categoryGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rolloverEnabled: true,
targetAmount: 1,
targetDate: '2023-12-25',
startPeriod: '<string>',
plan: '<string>'
})
};
fetch('https://api.finta.io/v2/budgets', 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.finta.io/v2/budgets",
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([
'scope' => 'template',
'amount' => 1,
'categoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'categoryGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rolloverEnabled' => true,
'targetAmount' => 1,
'targetDate' => '2023-12-25',
'startPeriod' => '<string>',
'plan' => '<string>'
]),
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://api.finta.io/v2/budgets"
payload := strings.NewReader("{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.finta.io/v2/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.finta.io/v2/budgets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"budget": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "category",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"rolloverEnabled": true,
"targetAmount": 123,
"targetDate": "2023-12-25",
"startPeriod": "2023-12-25",
"isActive": true
},
"periodOverride": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"plannedAmount": 123,
"note": "<string>",
"source": "user_edited"
},
"snapshot": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodsConsidered": 123,
"rowsWritten": 123,
"truncated": true
},
"created": true,
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"method": "standard",
"accountScope": "All",
"isDefault": true
}
}{
"budget": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "category",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"rolloverEnabled": true,
"targetAmount": 123,
"targetDate": "2023-12-25",
"startPeriod": "2023-12-25",
"isActive": true
},
"periodOverride": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"plannedAmount": 123,
"note": "<string>",
"source": "user_edited"
},
"snapshot": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodsConsidered": 123,
"rowsWritten": 123,
"truncated": true
},
"created": true,
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"method": "standard",
"accountScope": "All",
"isDefault": true
}
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": "Missing or invalid Authorization header"
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Per-minute rate limit exceeded (standard plan)"
}
}Budgets
Set a budget
Create or edit the budget for a category or category group, or assign to a credit card’s payment envelope, in the default plan unless plan names another. scope: "template" changes the amount from the current month forward and creates the budget if it has none. scope: "period" changes one month and needs an existing budget, except for accountId, which takes scope: "period" only and creates the envelope’s budget on the first assignment. In an envelope plan, scope: "period" is the assign action and amount is that month’s total. The first budget creates the default plan.
POST
/
budgets
Set a budget
curl --request POST \
--url https://api.finta.io/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "template",
"amount": 1,
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rolloverEnabled": true,
"targetAmount": 1,
"targetDate": "2023-12-25",
"startPeriod": "<string>",
"plan": "<string>"
}
'import requests
url = "https://api.finta.io/v2/budgets"
payload = {
"scope": "template",
"amount": 1,
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rolloverEnabled": True,
"targetAmount": 1,
"targetDate": "2023-12-25",
"startPeriod": "<string>",
"plan": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'template',
amount: 1,
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
categoryGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rolloverEnabled: true,
targetAmount: 1,
targetDate: '2023-12-25',
startPeriod: '<string>',
plan: '<string>'
})
};
fetch('https://api.finta.io/v2/budgets', 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.finta.io/v2/budgets",
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([
'scope' => 'template',
'amount' => 1,
'categoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'categoryGroupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rolloverEnabled' => true,
'targetAmount' => 1,
'targetDate' => '2023-12-25',
'startPeriod' => '<string>',
'plan' => '<string>'
]),
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://api.finta.io/v2/budgets"
payload := strings.NewReader("{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.finta.io/v2/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.finta.io/v2/budgets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"template\",\n \"amount\": 1,\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categoryGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rolloverEnabled\": true,\n \"targetAmount\": 1,\n \"targetDate\": \"2023-12-25\",\n \"startPeriod\": \"<string>\",\n \"plan\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"budget": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "category",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"rolloverEnabled": true,
"targetAmount": 123,
"targetDate": "2023-12-25",
"startPeriod": "2023-12-25",
"isActive": true
},
"periodOverride": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"plannedAmount": 123,
"note": "<string>",
"source": "user_edited"
},
"snapshot": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodsConsidered": 123,
"rowsWritten": 123,
"truncated": true
},
"created": true,
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"method": "standard",
"accountScope": "All",
"isDefault": true
}
}{
"budget": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetType": "category",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categoryGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"rolloverEnabled": true,
"targetAmount": 123,
"targetDate": "2023-12-25",
"startPeriod": "2023-12-25",
"isActive": true
},
"periodOverride": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"period": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"plannedAmount": 123,
"note": "<string>",
"source": "user_edited"
},
"snapshot": {
"budgetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodsConsidered": 123,
"rowsWritten": 123,
"truncated": true
},
"created": true,
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"method": "standard",
"accountScope": "All",
"isDefault": true
}
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": "Missing or invalid Authorization header"
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": {
"code": "STORAGE_MODE_REQUIRED",
"message": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Per-minute rate limit exceeded (standard plan)"
}
}Authorizations
Body
application/json
- Option 1
- Option 2
Send exactly one of categoryId, categoryGroupId or, with scope: "period", accountId. Fields from the other scope are rejected.
Response
Edited an existing budget