curl --request POST \
--url https://sandbox-api.polygon.technology/v0.10/virtual-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountHolder": "<string>",
"customerId": "<string>",
"destination": {
"details": {
"asset": "<string>",
"id": "<string>",
"network": "<string>"
},
"type": "walletOms",
"amount": "<string>"
},
"source": {
"asset": "<string>",
"network": "<string>"
},
"type": "<string>",
"bankMemo": "<string>",
"label": "<string>",
"metadata": {},
"sponsorGas": true
}
'import requests
url = "https://sandbox-api.polygon.technology/v0.10/virtual-accounts"
payload = {
"accountHolder": "<string>",
"customerId": "<string>",
"destination": {
"details": {
"asset": "<string>",
"id": "<string>",
"network": "<string>"
},
"type": "walletOms",
"amount": "<string>"
},
"source": {
"asset": "<string>",
"network": "<string>"
},
"type": "<string>",
"bankMemo": "<string>",
"label": "<string>",
"metadata": {},
"sponsorGas": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountHolder: '<string>',
customerId: '<string>',
destination: {
details: {asset: '<string>', id: '<string>', network: '<string>'},
type: 'walletOms',
amount: '<string>'
},
source: {asset: '<string>', network: '<string>'},
type: '<string>',
bankMemo: '<string>',
label: '<string>',
metadata: {},
sponsorGas: true
})
};
fetch('https://sandbox-api.polygon.technology/v0.10/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://sandbox-api.polygon.technology/v0.10/virtual-accounts",
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([
'accountHolder' => '<string>',
'customerId' => '<string>',
'destination' => [
'details' => [
'asset' => '<string>',
'id' => '<string>',
'network' => '<string>'
],
'type' => 'walletOms',
'amount' => '<string>'
],
'source' => [
'asset' => '<string>',
'network' => '<string>'
],
'type' => '<string>',
'bankMemo' => '<string>',
'label' => '<string>',
'metadata' => [
],
'sponsorGas' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://sandbox-api.polygon.technology/v0.10/virtual-accounts"
payload := strings.NewReader("{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://sandbox-api.polygon.technology/v0.10/virtual-accounts")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.polygon.technology/v0.10/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}"
response = http.request(request)
puts response.read_body{
"bankDetails": {
"domestic": {
"accountNumber": "<string>",
"accountType": "<string>",
"bankAddress": "<string>",
"bankName": "<string>",
"beneficiary": {
"address": {
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"streetAddress": "<string>",
"countryArea": "<string>"
},
"name": "<string>"
},
"network": [],
"routingNumber": "<string>"
},
"swift": {
"accountNumber": "<string>",
"bankAddress": "<string>",
"bankName": "<string>",
"beneficiary": {
"address": {
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"streetAddress": "<string>",
"countryArea": "<string>"
},
"name": "<string>"
},
"bic": "<string>",
"memo": "<string>"
}
},
"bankMemo": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"deletionRequestedAt": "2023-11-07T05:31:56Z",
"deletionRequestedBy": "<string>",
"destination": {
"category": "crypto",
"details": {
"asset": "<string>",
"blockchainAddress": "<string>",
"blockchainAsset": {
"chainId": "<string>",
"tokenId": "<string>"
},
"id": "<string>",
"network": "<string>",
"txHash": "<string>"
},
"type": "walletOms",
"party": {
"customerId": "<string>",
"relationship": "customer"
}
},
"finalBalance": {
"currency": "<string>",
"display": "<string>",
"value": "<string>"
},
"id": "<string>",
"label": "<string>",
"metadata": {},
"object": "virtualAccount",
"source": {
"asset": "<string>",
"network": "<string>"
},
"statusReason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}Create a Virtual Account
Create a Virtual Account for a customer. Partner must have virtual_account_provider configured.
curl --request POST \
--url https://sandbox-api.polygon.technology/v0.10/virtual-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"accountHolder": "<string>",
"customerId": "<string>",
"destination": {
"details": {
"asset": "<string>",
"id": "<string>",
"network": "<string>"
},
"type": "walletOms",
"amount": "<string>"
},
"source": {
"asset": "<string>",
"network": "<string>"
},
"type": "<string>",
"bankMemo": "<string>",
"label": "<string>",
"metadata": {},
"sponsorGas": true
}
'import requests
url = "https://sandbox-api.polygon.technology/v0.10/virtual-accounts"
payload = {
"accountHolder": "<string>",
"customerId": "<string>",
"destination": {
"details": {
"asset": "<string>",
"id": "<string>",
"network": "<string>"
},
"type": "walletOms",
"amount": "<string>"
},
"source": {
"asset": "<string>",
"network": "<string>"
},
"type": "<string>",
"bankMemo": "<string>",
"label": "<string>",
"metadata": {},
"sponsorGas": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountHolder: '<string>',
customerId: '<string>',
destination: {
details: {asset: '<string>', id: '<string>', network: '<string>'},
type: 'walletOms',
amount: '<string>'
},
source: {asset: '<string>', network: '<string>'},
type: '<string>',
bankMemo: '<string>',
label: '<string>',
metadata: {},
sponsorGas: true
})
};
fetch('https://sandbox-api.polygon.technology/v0.10/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://sandbox-api.polygon.technology/v0.10/virtual-accounts",
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([
'accountHolder' => '<string>',
'customerId' => '<string>',
'destination' => [
'details' => [
'asset' => '<string>',
'id' => '<string>',
'network' => '<string>'
],
'type' => 'walletOms',
'amount' => '<string>'
],
'source' => [
'asset' => '<string>',
'network' => '<string>'
],
'type' => '<string>',
'bankMemo' => '<string>',
'label' => '<string>',
'metadata' => [
],
'sponsorGas' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://sandbox-api.polygon.technology/v0.10/virtual-accounts"
payload := strings.NewReader("{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://sandbox-api.polygon.technology/v0.10/virtual-accounts")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.polygon.technology/v0.10/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountHolder\": \"<string>\",\n \"customerId\": \"<string>\",\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"source\": {\n \"asset\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"<string>\",\n \"bankMemo\": \"<string>\",\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}"
response = http.request(request)
puts response.read_body{
"bankDetails": {
"domestic": {
"accountNumber": "<string>",
"accountType": "<string>",
"bankAddress": "<string>",
"bankName": "<string>",
"beneficiary": {
"address": {
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"streetAddress": "<string>",
"countryArea": "<string>"
},
"name": "<string>"
},
"network": [],
"routingNumber": "<string>"
},
"swift": {
"accountNumber": "<string>",
"bankAddress": "<string>",
"bankName": "<string>",
"beneficiary": {
"address": {
"city": "<string>",
"country": "<string>",
"postalCode": "<string>",
"streetAddress": "<string>",
"countryArea": "<string>"
},
"name": "<string>"
},
"bic": "<string>",
"memo": "<string>"
}
},
"bankMemo": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"deletionRequestedAt": "2023-11-07T05:31:56Z",
"deletionRequestedBy": "<string>",
"destination": {
"category": "crypto",
"details": {
"asset": "<string>",
"blockchainAddress": "<string>",
"blockchainAsset": {
"chainId": "<string>",
"tokenId": "<string>"
},
"id": "<string>",
"network": "<string>",
"txHash": "<string>"
},
"type": "walletOms",
"party": {
"customerId": "<string>",
"relationship": "customer"
}
},
"finalBalance": {
"currency": "<string>",
"display": "<string>",
"value": "<string>"
},
"id": "<string>",
"label": "<string>",
"metadata": {},
"object": "virtualAccount",
"source": {
"asset": "<string>",
"network": "<string>"
},
"statusReason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
Token from POST /auth/token
Headers
Required on POST and PUT requests. Use a unique value per logical mutation attempt, for example a UUID.
Body
Must be "customer".
Owning customer (cus_… or legacy public id).
Side-shaped destination: walletOms (OMS wallet) or walletExternal (registered ExternalAccount). The server validates asset/network against the resolved EA.
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Must be "bankUs".
Optional wire/ACH memo the customer can include.
Partner display label.
Show child attributes
Show child attributes
When true, OMS absorbs the on-chain gas cost for the destination
delivery. Only true is currently supported.
Response
The request has succeeded and a new resource has been created as a result.
Null until the underlying deposit account is provisioned.
Show child attributes
Show child attributes
Set when DELETE has been requested but the close webhook has not yet finalized.
Identity (JWT subject claim) of the caller who invoked DELETE.
Unified side shape.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Set when status = failed; closed enum identifying the failure category.
provisioningTimeout, systemError, ereborRejected, deletePendingTimeout DDA balance snapshot at the moment the VA flipped to deleted.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
virtualAccount Show child attributes
Show child attributes
pending, active, frozen, closed, deleted, failed, inactiveActionRequired Was this page helpful?