Skip to main content
PATCH
/
virtual-accounts
/
{virtualAccountId}
Update a Virtual Account
curl --request PATCH \
  --url https://sandbox-api.polygon.technology/v0.10/virtual-accounts/{virtualAccountId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "destination": {
    "details": {
      "asset": "<string>",
      "id": "<string>",
      "network": "<string>"
    },
    "type": "walletOms",
    "amount": "<string>"
  },
  "label": "<string>",
  "metadata": {},
  "sponsorGas": true
}
'
import requests

url = "https://sandbox-api.polygon.technology/v0.10/virtual-accounts/{virtualAccountId}"

payload = {
"destination": {
"details": {
"asset": "<string>",
"id": "<string>",
"network": "<string>"
},
"type": "walletOms",
"amount": "<string>"
},
"label": "<string>",
"metadata": {},
"sponsorGas": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: {
details: {asset: '<string>', id: '<string>', network: '<string>'},
type: 'walletOms',
amount: '<string>'
},
label: '<string>',
metadata: {},
sponsorGas: true
})
};

fetch('https://sandbox-api.polygon.technology/v0.10/virtual-accounts/{virtualAccountId}', 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/{virtualAccountId}",
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([
'destination' => [
'details' => [
'asset' => '<string>',
'id' => '<string>',
'network' => '<string>'
],
'type' => 'walletOms',
'amount' => '<string>'
],
'label' => '<string>',
'metadata' => [

],
'sponsorGas' => true
]),
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://sandbox-api.polygon.technology/v0.10/virtual-accounts/{virtualAccountId}"

payload := strings.NewReader("{\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\n \"label\": \"<string>\",\n \"metadata\": {},\n \"sponsorGas\": true\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://sandbox-api.polygon.technology/v0.10/virtual-accounts/{virtualAccountId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\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/{virtualAccountId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": {\n \"details\": {\n \"asset\": \"<string>\",\n \"id\": \"<string>\",\n \"network\": \"<string>\"\n },\n \"type\": \"walletOms\",\n \"amount\": \"<string>\"\n },\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

Authorization
string
header
required

Token from POST /auth/token

Path Parameters

virtualAccountId
string
required

Body

application/json

Partial update payload for a Virtual Account. The patchable fields are destination (re-point to a different walletExternal / walletOms target), sponsorGas, label, and metadata. Any additional key in the JSON body is rejected with 400 by the handler (strict whitelist).

Re-pointing destination to a healthy External Account recovers a VA from inactiveActionRequired back to active; a re-point on an already active VA updates the target without a status transition.

destination
object

Re-point the VA destination (walletExternal by registered EA id, or walletOms by wallet id). Re-validated exactly like create.

label
string

Partner display label.

metadata
object
sponsorGas
boolean
default:true

When true, OMS absorbs the on-chain gas cost for the destination delivery. Only true is currently supported; accepted for forward-compatibility.

Response

200 - application/json

The request has succeeded.

bankDetails
object

Null until the underlying deposit account is provisioned.

bankMemo
string
createdAt
string<date-time>
customerId
string
deletionRequestedAt
string<date-time>

Set when DELETE has been requested but the close webhook has not yet finalized.

deletionRequestedBy
string

Identity (JWT subject claim) of the caller who invoked DELETE.

destination
object

Unified side shape.

failureReason
enum<string>

Set when status = failed; closed enum identifying the failure category.

Available options:
provisioningTimeout,
systemError,
ereborRejected,
deletePendingTimeout
finalBalance
object

DDA balance snapshot at the moment the VA flipped to deleted.

id
string
label
string
metadata
object
object
enum<string>
Available options:
virtualAccount
source
object
status
enum<string>
Available options:
pending,
active,
frozen,
closed,
deleted,
failed,
inactiveActionRequired
statusReason
string
updatedAt
string<date-time>