Update an account
curl --request PATCH \
--url https://api.fintoc.com/v2/accounts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated description"
}
'import requests
url = "https://api.fintoc.com/v2/accounts/{id}"
payload = { "description": "Updated description" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated description'})
};
fetch('https://api.fintoc.com/v2/accounts/{id}', 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.fintoc.com/v2/accounts/{id}",
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([
'description' => 'Updated description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.fintoc.com/v2/accounts/{id}"
payload := strings.NewReader("{\n \"description\": \"Updated description\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.fintoc.com/v2/accounts/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated description\"\n}"
response = http.request(request)
puts response.read_body{
"id": "acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN",
"object": "account",
"available_balance": 1050000,
"currency": "MXN",
"description": "Updated description",
"entity": {
"id": "ent_2eGhTp1rLqWnXkZbYc4JsKmAvD9",
"holder_id": "000000000",
"holder_name": "Test Customer 1",
"is_root": true
},
"is_root": true,
"mode": "test",
"root_account_number": "646180111800000004",
"root_account_number_id": "acno_2fJkRm7tBvQxNzYpLc5WsHaDfT3",
"status": "active"
}{
"error": {
"code": "invalid_description_size",
"message": "Description length must be less than 40 characters"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"code": "invalid_account",
"message": "Unable to update account acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN. Action not available in your region"
}
}{
"error": {
"code": "missing_resource",
"message": "Account not found: acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN"
}
}Accounts
Update an account
Updates the editable fields of an account of your organization. Currently, only the description is editable.
PATCH
/
v2
/
accounts
/
{id}
Update an account
curl --request PATCH \
--url https://api.fintoc.com/v2/accounts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated description"
}
'import requests
url = "https://api.fintoc.com/v2/accounts/{id}"
payload = { "description": "Updated description" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated description'})
};
fetch('https://api.fintoc.com/v2/accounts/{id}', 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.fintoc.com/v2/accounts/{id}",
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([
'description' => 'Updated description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.fintoc.com/v2/accounts/{id}"
payload := strings.NewReader("{\n \"description\": \"Updated description\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.fintoc.com/v2/accounts/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated description\"\n}"
response = http.request(request)
puts response.read_body{
"id": "acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN",
"object": "account",
"available_balance": 1050000,
"currency": "MXN",
"description": "Updated description",
"entity": {
"id": "ent_2eGhTp1rLqWnXkZbYc4JsKmAvD9",
"holder_id": "000000000",
"holder_name": "Test Customer 1",
"is_root": true
},
"is_root": true,
"mode": "test",
"root_account_number": "646180111800000004",
"root_account_number_id": "acno_2fJkRm7tBvQxNzYpLc5WsHaDfT3",
"status": "active"
}{
"error": {
"code": "invalid_description_size",
"message": "Description length must be less than 40 characters"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"code": "invalid_account",
"message": "Unable to update account acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN. Action not available in your region"
}
}{
"error": {
"code": "missing_resource",
"message": "Account not found: acc_2daFu0zqqDtZGJaSi2TGI2Mm1nN"
}
}You can update only the
description attribute of an Account.Body
application/json
Response
The updated account.
Was this page helpful?