Create bank account
curl --request POST \
--url https://{subdomain}.truust.io/2.0/bankaccounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": 7485,
"name": "My bank account",
"type": "IBAN",
"number": "ES1300812944953951475955",
"bic": "CAIXESBBXXX"
}
'import requests
url = "https://{subdomain}.truust.io/2.0/bankaccounts"
payload = {
"customer_id": 7485,
"name": "My bank account",
"type": "IBAN",
"number": "ES1300812944953951475955",
"bic": "CAIXESBBXXX"
}
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({
customer_id: 7485,
name: 'My bank account',
type: 'IBAN',
number: 'ES1300812944953951475955',
bic: 'CAIXESBBXXX'
})
};
fetch('https://{subdomain}.truust.io/2.0/bankaccounts', 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://{subdomain}.truust.io/2.0/bankaccounts",
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([
'customer_id' => 7485,
'name' => 'My bank account',
'type' => 'IBAN',
'number' => 'ES1300812944953951475955',
'bic' => 'CAIXESBBXXX'
]),
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://{subdomain}.truust.io/2.0/bankaccounts"
payload := strings.NewReader("{\n \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\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://{subdomain}.truust.io/2.0/bankaccounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/bankaccounts")
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 \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"type": "<string>",
"name": "<string>",
"number": "<string>",
"bic": "<string>",
"tag": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}Bank Accounts
Create Bank Account
Registers a bank account for a customer (or the authenticated account).
Use GET /bankaccounts/validation first to obtain the required fields for the given currency and country.
POST
/
bankaccounts
Create bank account
curl --request POST \
--url https://{subdomain}.truust.io/2.0/bankaccounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": 7485,
"name": "My bank account",
"type": "IBAN",
"number": "ES1300812944953951475955",
"bic": "CAIXESBBXXX"
}
'import requests
url = "https://{subdomain}.truust.io/2.0/bankaccounts"
payload = {
"customer_id": 7485,
"name": "My bank account",
"type": "IBAN",
"number": "ES1300812944953951475955",
"bic": "CAIXESBBXXX"
}
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({
customer_id: 7485,
name: 'My bank account',
type: 'IBAN',
number: 'ES1300812944953951475955',
bic: 'CAIXESBBXXX'
})
};
fetch('https://{subdomain}.truust.io/2.0/bankaccounts', 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://{subdomain}.truust.io/2.0/bankaccounts",
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([
'customer_id' => 7485,
'name' => 'My bank account',
'type' => 'IBAN',
'number' => 'ES1300812944953951475955',
'bic' => 'CAIXESBBXXX'
]),
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://{subdomain}.truust.io/2.0/bankaccounts"
payload := strings.NewReader("{\n \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\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://{subdomain}.truust.io/2.0/bankaccounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/bankaccounts")
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 \"customer_id\": 7485,\n \"name\": \"My bank account\",\n \"type\": \"IBAN\",\n \"number\": \"ES1300812944953951475955\",\n \"bic\": \"CAIXESBBXXX\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"type": "<string>",
"name": "<string>",
"number": "<string>",
"bic": "<string>",
"tag": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}Body
application/json
Bank account type. IBAN for SEPA accounts, BSB_ACCOUNT for Australian accounts,
INTERNATIONAL for SWIFT/BIC accounts, CLEARJUNCTION / CURRENCYCLOUD for gateway-linked accounts,
PA_CTE / PA_AHORRO for Spanish payment accounts, and OTHER / CL_CTE / CL_VISTA /
CL_AHORRO / ZEPTO for other formats.
Available options:
IBAN, OTHER, BSB_ACCOUNT, PA_AHORRO, PA_CTE, CL_CTE, CL_VISTA, CL_AHORRO, INTERNATIONAL, ZEPTO, CLEARJUNCTION, CURRENCYCLOUD Example:
"IBAN"
Response
Bank account created
