curl --request POST \
--url https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstAmount": 123,
"secondAmount": 123
}
'import requests
url = "https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate"
payload = {
"firstAmount": 123,
"secondAmount": 123
}
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({firstAmount: 123, secondAmount: 123})
};
fetch('https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate', 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/embedded-banking/v1/external-bank-accounts/{id}/validate",
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([
'firstAmount' => 123,
'secondAmount' => 123
]),
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.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate"
payload := strings.NewReader("{\n \"firstAmount\": 123,\n \"secondAmount\": 123\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.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstAmount\": 123,\n \"secondAmount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate")
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 \"firstAmount\": 123,\n \"secondAmount\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountNumber": "<string>",
"accountStatus": "ACTIVE",
"nameOnAccount": "<string>",
"nickname": "<string>",
"routingNumber": "<string>",
"type": "CHECKING",
"verificationStatus": "UNVERIFIED",
"accountHolderType": "INDIVIDUAL",
"microDepositVerification": {
"attemptsAllowed": 123,
"attemptsRemaining": 123,
"canAttemptAgain": true,
"isTerminal": true,
"outcome": "AMOUNTS_MATCHED"
},
"suspension": {
"suspendedAt": "2023-11-07T05:31:56Z",
"reason": "PAYMENT_RETURNED",
"returnCategory": "ACCOUNT_CLOSED"
},
"verificationFailure": {
"incorrectDetails": [
"ROUTING_NUMBER"
],
"reason": "AMOUNTS_DID_NOT_MATCH",
"returnCategory": "ACCOUNT_CLOSED"
}
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Verify micro-deposits
Validates an external bank account using micro-deposit amounts. Incorrect amounts answer 200 with the resulting verification status.
Token types: APP, USER | Required scopes: external_bank_account:write:org
curl --request POST \
--url https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstAmount": 123,
"secondAmount": 123
}
'import requests
url = "https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate"
payload = {
"firstAmount": 123,
"secondAmount": 123
}
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({firstAmount: 123, secondAmount: 123})
};
fetch('https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate', 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/embedded-banking/v1/external-bank-accounts/{id}/validate",
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([
'firstAmount' => 123,
'secondAmount' => 123
]),
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.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate"
payload := strings.NewReader("{\n \"firstAmount\": 123,\n \"secondAmount\": 123\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.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstAmount\": 123,\n \"secondAmount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/embedded-banking/v1/external-bank-accounts/{id}/validate")
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 \"firstAmount\": 123,\n \"secondAmount\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountNumber": "<string>",
"accountStatus": "ACTIVE",
"nameOnAccount": "<string>",
"nickname": "<string>",
"routingNumber": "<string>",
"type": "CHECKING",
"verificationStatus": "UNVERIFIED",
"accountHolderType": "INDIVIDUAL",
"microDepositVerification": {
"attemptsAllowed": 123,
"attemptsRemaining": 123,
"canAttemptAgain": true,
"isTerminal": true,
"outcome": "AMOUNTS_MATCHED"
},
"suspension": {
"suspendedAt": "2023-11-07T05:31:56Z",
"reason": "PAYMENT_RETURNED",
"returnCategory": "ACCOUNT_CLOSED"
},
"verificationFailure": {
"incorrectDetails": [
"ROUTING_NUMBER"
],
"reason": "AMOUNTS_DID_NOT_MATCH",
"returnCategory": "ACCOUNT_CLOSED"
}
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"errorCode": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
Application (M2M) OAuth2 access token (client credentials).
Headers
ID of the organization to perform this operation on behalf of. Required for BANK and PLATFORM app token callers targeting a specific organization. If omitted, the request uses the authenticated caller's own organization. Must be a valid non-empty UUID. Present but malformed values return 400.
Path Parameters
The external bank account ID.
Body
The validate request.
Request to validate an external bank account using micro-deposits.
One of the two micro-deposit verification amounts, in minor units (e.g. cents for USD). Order does not matter: the pair is compared unordered.
The other micro-deposit verification amount, in minor units (e.g. cents for USD). Order does not matter: the pair is compared unordered.
Response
Amounts submitted; the body states whether they matched.
Response representing an external bank account.
Unique identifier for the external bank account.
Masked account number (last 4 digits visible).
Status of the external bank account.
ACTIVE, INACTIVE Name on the bank account.
Nickname for the external bank account.
Bank routing number (ABA number).
Type of bank account (checking or savings).
CHECKING, SAVINGS Verification status of the external bank account. Where the bank fails verification on the first incorrect attempt, FAILED can be recovered while attempts remain. Where it fails at the attempt limit, or after a returned micro-deposit or a notification of change, FAILED is final.
UNVERIFIED, VERIFICATION_SENT, VERIFIED, FAILED Holder of the bank account (individual or business).
INDIVIDUAL, BUSINESS Result of the micro-deposit validation attempt. Returned by the validate endpoint only.
Show child attributes
Show child attributes
Why no payment may be sent to or taken from the account, or null when it is usable.
Show child attributes
Show child attributes
Why verification failed, when verificationStatus is FAILED.
Show child attributes
Show child attributes
Was this page helpful?