curl --request PATCH \
--url https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}"
payload = {
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_holder_name: 'Bob Jones',
account_number: '12345678',
bic: 'CHASUS33XXX',
iban: 'GB29NWBK60161331926819',
name: '<string>',
partner_metadata: {},
routing_number: '<string>',
sort_code: '123456'
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_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.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_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([
'account_holder_name' => 'Bob Jones',
'account_number' => '12345678',
'bic' => 'CHASUS33XXX',
'iban' => 'GB29NWBK60161331926819',
'name' => '<string>',
'partner_metadata' => [
],
'routing_number' => '<string>',
'sort_code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-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.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}"
payload := strings.NewReader("{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"country": "AF",
"currency": "AED",
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"is_default_for_currency": false,
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Update account
curl --request PATCH \
--url https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}
'import requests
url = "https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}"
payload = {
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_holder_name: 'Bob Jones',
account_number: '12345678',
bic: 'CHASUS33XXX',
iban: 'GB29NWBK60161331926819',
name: '<string>',
partner_metadata: {},
routing_number: '<string>',
sort_code: '123456'
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_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.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_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([
'account_holder_name' => 'Bob Jones',
'account_number' => '12345678',
'bic' => 'CHASUS33XXX',
'iban' => 'GB29NWBK60161331926819',
'name' => '<string>',
'partner_metadata' => [
],
'routing_number' => '<string>',
'sort_code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-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.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}"
payload := strings.NewReader("{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
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://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_holder_name\": \"Bob Jones\",\n \"account_number\": \"12345678\",\n \"bic\": \"CHASUS33XXX\",\n \"iban\": \"GB29NWBK60161331926819\",\n \"name\": \"<string>\",\n \"partner_metadata\": {},\n \"routing_number\": \"<string>\",\n \"sort_code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"country": "AF",
"currency": "AED",
"account_holder_name": "Bob Jones",
"account_number": "12345678",
"bic": "CHASUS33XXX",
"iban": "GB29NWBK60161331926819",
"is_default_for_currency": false,
"name": "<string>",
"partner_metadata": {},
"routing_number": "<string>",
"sort_code": "123456"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The ID of the entity that owns the requested resource.
"9d2b4c8f-2087-4738-ba91-7359683c49a4"
Body
The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
"Bob Jones"
The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
"12345678"
The BIC/SWIFT code of the bank.
11"CHASUS33XXX"
AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, IC, CV, KY, CF, EA, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, AN, NC, NZ, NI, NE, NG, NU, NF, MP, MK, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, SH, KN, LC, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SK, SI, SB, SO, ZA, SS, GS, ES, LK, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, BL, BQ, CW, MF, SX AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW The IBAN of the bank account.
34"GB29NWBK60161331926819"
200Metadata for partner needs.
The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
The bank's sort code.
"123456"
Response
Successful Response
AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, IC, CV, KY, CF, EA, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, AN, NC, NZ, NI, NE, NG, NU, NF, MP, MK, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, SH, KN, LC, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SK, SI, SB, SO, ZA, SS, GS, ES, LK, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW, BL, BQ, CW, MF, SX AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SOS, SRD, SSP, SVC, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
"Bob Jones"
The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
"12345678"
The BIC/SWIFT code of the bank.
11"CHASUS33XXX"
The IBAN of the bank account.
34"GB29NWBK60161331926819"
200Metadata for partner needs.
The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
The bank's sort code.
"123456"
Was this page helpful?