curl --request POST \
--url https://api.openxswitch.com/v2/wallets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotencyKey": "8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"blockchain": "ethereum",
"name": "user_1 Wallet",
"refId": "ref_user_1",
"userId": "user_1",
"autoSweep": false
}
'import requests
url = "https://api.openxswitch.com/v2/wallets"
payload = {
"idempotencyKey": "8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"blockchain": "ethereum",
"name": "user_1 Wallet",
"refId": "ref_user_1",
"userId": "user_1",
"autoSweep": False
}
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({
idempotencyKey: '8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04',
accountId: '123e4567-e89b-12d3-a456-426614174000',
blockchain: 'ethereum',
name: 'user_1 Wallet',
refId: 'ref_user_1',
userId: 'user_1',
autoSweep: false
})
};
fetch('https://api.openxswitch.com/v2/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://api.openxswitch.com/v2/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([
'idempotencyKey' => '8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04',
'accountId' => '123e4567-e89b-12d3-a456-426614174000',
'blockchain' => 'ethereum',
'name' => 'user_1 Wallet',
'refId' => 'ref_user_1',
'userId' => 'user_1',
'autoSweep' => false
]),
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.openxswitch.com/v2/wallets"
payload := strings.NewReader("{\n \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\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.openxswitch.com/v2/wallets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/wallets")
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 \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "8e6f5877-d71a-4017-a3eb-3d1d4464e274",
"address": "0x1234567890123456789012345678901234567890",
"blockchain": "ethereum",
"protocol": "EVM",
"network": "mainnet",
"isEvmCompatible": true,
"type": "smart_wallet",
"intent": "deposit",
"gaslessWithdraw": true,
"autoSweep": true,
"state": "LIVE",
"custodyType": "DEVELOPER",
"userId": "user_1",
"accountId": "WALLET_ACCOUNT_ID",
"workspaceId": "WORKSPACE_ID",
"createdAt": "2022-01-01T00:00:00.000Z",
"updatedAt": "2022-01-01T00:00:00.000Z",
"decimals": 18,
"name": "Wallet 1",
"refId": "WALLET_REF_ID"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Create Wallet
Create a new wallet (blockchain address) under a account.
curl --request POST \
--url https://api.openxswitch.com/v2/wallets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotencyKey": "8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"blockchain": "ethereum",
"name": "user_1 Wallet",
"refId": "ref_user_1",
"userId": "user_1",
"autoSweep": false
}
'import requests
url = "https://api.openxswitch.com/v2/wallets"
payload = {
"idempotencyKey": "8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"blockchain": "ethereum",
"name": "user_1 Wallet",
"refId": "ref_user_1",
"userId": "user_1",
"autoSweep": False
}
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({
idempotencyKey: '8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04',
accountId: '123e4567-e89b-12d3-a456-426614174000',
blockchain: 'ethereum',
name: 'user_1 Wallet',
refId: 'ref_user_1',
userId: 'user_1',
autoSweep: false
})
};
fetch('https://api.openxswitch.com/v2/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://api.openxswitch.com/v2/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([
'idempotencyKey' => '8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04',
'accountId' => '123e4567-e89b-12d3-a456-426614174000',
'blockchain' => 'ethereum',
'name' => 'user_1 Wallet',
'refId' => 'ref_user_1',
'userId' => 'user_1',
'autoSweep' => false
]),
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.openxswitch.com/v2/wallets"
payload := strings.NewReader("{\n \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\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.openxswitch.com/v2/wallets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/wallets")
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 \"idempotencyKey\": \"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04\",\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"blockchain\": \"ethereum\",\n \"name\": \"user_1 Wallet\",\n \"refId\": \"ref_user_1\",\n \"userId\": \"user_1\",\n \"autoSweep\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "8e6f5877-d71a-4017-a3eb-3d1d4464e274",
"address": "0x1234567890123456789012345678901234567890",
"blockchain": "ethereum",
"protocol": "EVM",
"network": "mainnet",
"isEvmCompatible": true,
"type": "smart_wallet",
"intent": "deposit",
"gaslessWithdraw": true,
"autoSweep": true,
"state": "LIVE",
"custodyType": "DEVELOPER",
"userId": "user_1",
"accountId": "WALLET_ACCOUNT_ID",
"workspaceId": "WORKSPACE_ID",
"createdAt": "2022-01-01T00:00:00.000Z",
"updatedAt": "2022-01-01T00:00:00.000Z",
"decimals": 18,
"name": "Wallet 1",
"refId": "WALLET_REF_ID"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
This key is utilized to ensure exactly-once execution of mutating requests. If the same key is reused, it will be treated as the same request and the original response will be returned.
"8d5be8f5-a8e7-4e8a-b715-0e7d6f2a6d04"
The unique identifier of the Account
"123e4567-e89b-12d3-a456-426614174000"
The chain. Can be either the blockchain name or slug.
Refer to the Get Supported Blockchains endpoint for the list of supported blockchains.
"ethereum"
The name of the wallet
"user_1 Wallet"
The external reference ID to uniquely identify the wallet
"ref_user_1"
The id of the user to link to the wallet
"user_1"
Flag indicating whether to auto-sweep native tokens to the settlement account
false
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)