Skip to main content
POST
/
customers
/
{id}
/
wallets
Create a new wallet asset for a customer
curl --request POST \
  --url https://sandbox-api.polygon.technology/v0.10/customers/{id}/wallets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "asset": "<string>",
  "chain": "<string>"
}
'
import requests

url = "https://sandbox-api.polygon.technology/v0.10/customers/{id}/wallets"

payload = {
"asset": "<string>",
"chain": "<string>"
}
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({asset: '<string>', chain: '<string>'})
};

fetch('https://sandbox-api.polygon.technology/v0.10/customers/{id}/wallets', 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/customers/{id}/wallets",
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([
'asset' => '<string>',
'chain' => '<string>'
]),
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/customers/{id}/wallets"

payload := strings.NewReader("{\n \"asset\": \"<string>\",\n \"chain\": \"<string>\"\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/customers/{id}/wallets")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"<string>\",\n \"chain\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.polygon.technology/v0.10/customers/{id}/wallets")

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 \"asset\": \"<string>\",\n \"chain\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "address": "<string>",
  "asset": "<string>",
  "blockchainAsset": {
    "chainId": "<string>",
    "tokenId": "<string>"
  },
  "chain": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "customerId": "<string>",
  "id": "<string>",
  "object": "wallet",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Token from POST /auth/token

Headers

Idempotency-Key
string
required

Required on POST and PUT requests. Use a unique value per logical mutation attempt, for example a UUID.

Path Parameters

id
string
required

Body

application/json

Request body for creating a wallet: the asset to hold and the chain it lives on.

asset
string
required
chain
string
required

Response

201 - application/json

The request has succeeded and a new resource has been created as a result.

A wallet holding a single asset on one chain for a customer. internal wallets are OMS-managed; external wallets are held outside OMS.

address
string
asset
string
blockchainAsset
object

On-chain identity for an asset: the chain it lives on, the wire-level protocol (EVM, SVM, Sui), and the token identifier within that chain.

chain
string
createdAt
string<date-time>
customerId
string
id
string
object
enum<string>
Available options:
wallet
status
enum<string>
Available options:
active,
suspended,
closed
type
enum<string>

Whether a wallet is internal (OMS-managed) or external (held outside OMS).

Available options:
internal,
external
updatedAt
string<date-time>