List Virtual Accounts
curl --request GET \
--url https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts', 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.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"virtual_accounts": [
{
"id": "<string>",
"identity_id": "<string>",
"status": "VIRTUAL_ACCOUNT_STATUS_PENDING",
"source": {
"banking_country": "<string>"
},
"destination": {
"currency": "USDC",
"account_id": "<string>",
"chain": "ETHEREUM_MAINNET"
},
"deposit_instructions": {
"amount": "<string>",
"currency": "USDC",
"bank_name": "<string>",
"bank_address": "<string>",
"payment_method": "BLOCKCHAIN",
"deposit_message": "<string>",
"bank_account_number": "<string>",
"bank_routing_number": "<string>",
"bank_beneficiary_name": "<string>",
"bank_beneficiary_address": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"cursor": "<string>"
}Virtual Accounts
List Virtual Accounts
List virtual accounts for an identity
GET
/
v2
/
identities
/
{identity_id}
/
virtual-accounts
List Virtual Accounts
curl --request GET \
--url https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts', 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.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.bastion.com/v2/identities/{identity_id}/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"virtual_accounts": [
{
"id": "<string>",
"identity_id": "<string>",
"status": "VIRTUAL_ACCOUNT_STATUS_PENDING",
"source": {
"banking_country": "<string>"
},
"destination": {
"currency": "USDC",
"account_id": "<string>",
"chain": "ETHEREUM_MAINNET"
},
"deposit_instructions": {
"amount": "<string>",
"currency": "USDC",
"bank_name": "<string>",
"bank_address": "<string>",
"payment_method": "BLOCKCHAIN",
"deposit_message": "<string>",
"bank_account_number": "<string>",
"bank_routing_number": "<string>",
"bank_beneficiary_name": "<string>",
"bank_beneficiary_address": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"cursor": "<string>"
}Authorizations
Bearer authentication with an API token
Path Parameters
Query Parameters
(OPTIONAL)
Available options:
VIRTUAL_ACCOUNT_STATUS_UNSPECIFIED, VIRTUAL_ACCOUNT_STATUS_PENDING, VIRTUAL_ACCOUNT_STATUS_ACTIVE, VIRTUAL_ACCOUNT_STATUS_INACTIVE, VIRTUAL_ACCOUNT_STATUS_FAILED Example:
"VIRTUAL_ACCOUNT_STATUS_PENDING"
(OPTIONAL)
Required range:
1 <= x <= 50(OPTIONAL)
Related topics
Create Virtual AccountOn-ramp: Fund a stablecoin account with a USD wireList AccountsList Bank AccountsStablecoin on-ramp and off-ramp conversions⌘I