Update wallet
curl --request PATCH \
--url https://api.onswitch.xyz/wallet/{wallet_id} \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"callback_url": "https://your-app.com/webhook"
}
'import requests
url = "https://api.onswitch.xyz/wallet/{wallet_id}"
payload = { "callback_url": "https://your-app.com/webhook" }
headers = {
"x-service-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-service-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: 'https://your-app.com/webhook'})
};
fetch('https://api.onswitch.xyz/wallet/{wallet_id}', 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.onswitch.xyz/wallet/{wallet_id}",
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([
'callback_url' => 'https://your-app.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-service-key: <api-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://api.onswitch.xyz/wallet/{wallet_id}"
payload := strings.NewReader("{\n \"callback_url\": \"https://your-app.com/webhook\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-service-key", "<api-key>")
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://api.onswitch.xyz/wallet/{wallet_id}")
.header("x-service-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://your-app.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/wallet/{wallet_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-service-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://your-app.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Wallet updated successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"id": "68d4f2a91eb37c15b8e3a4f7",
"name": "My Wallet",
"address": {
"BASE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"ETHEREUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"POLYGON": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"BSC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"ARBITRUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"OPTIMISM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"GNOSIS": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"AVALANCHE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"MONAD": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"PLASMA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"LINEA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"MANTLE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"HYPEREVM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"BERACHAIN": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"SONIC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"SOLANA": "2dTHot2BVjqqGD3S5Z2bzEVYnyEcJCdr9SawzqTdKo4h"
},
"callback_url": "https://your-app.com/webhook"
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Update wallet
Update wallet details (e.g. callback URL for wallet notifications).
PATCH
/
wallet
/
{wallet_id}
Update wallet
curl --request PATCH \
--url https://api.onswitch.xyz/wallet/{wallet_id} \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"callback_url": "https://your-app.com/webhook"
}
'import requests
url = "https://api.onswitch.xyz/wallet/{wallet_id}"
payload = { "callback_url": "https://your-app.com/webhook" }
headers = {
"x-service-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-service-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callback_url: 'https://your-app.com/webhook'})
};
fetch('https://api.onswitch.xyz/wallet/{wallet_id}', 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.onswitch.xyz/wallet/{wallet_id}",
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([
'callback_url' => 'https://your-app.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-service-key: <api-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://api.onswitch.xyz/wallet/{wallet_id}"
payload := strings.NewReader("{\n \"callback_url\": \"https://your-app.com/webhook\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-service-key", "<api-key>")
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://api.onswitch.xyz/wallet/{wallet_id}")
.header("x-service-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://your-app.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onswitch.xyz/wallet/{wallet_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-service-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callback_url\": \"https://your-app.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Wallet updated successfully",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": {
"id": "68d4f2a91eb37c15b8e3a4f7",
"name": "My Wallet",
"address": {
"BASE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"ETHEREUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"POLYGON": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"BSC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"ARBITRUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"OPTIMISM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"GNOSIS": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"AVALANCHE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"MONAD": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"PLASMA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"LINEA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"MANTLE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"HYPEREVM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"BERACHAIN": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"SONIC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
"SOLANA": "2dTHot2BVjqqGD3S5Z2bzEVYnyEcJCdr9SawzqTdKo4h"
},
"callback_url": "https://your-app.com/webhook"
}
}{
"success": false,
"message": "amount must be greater than 0 for the selected corridor",
"timestamp": "2026-04-18T14:22:08.631Z",
"data": null
}Authorizations
Service key for API authentication
Path Parameters
Unique identifier for the wallet
Pattern:
^[a-f0-9]{24}$Body
application/json
Webhook URL to receive wallet notifications.
⌘I