Auto Sweep Funds to Settlement Wallet
curl --request POST \
--url https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"minBalance": 10,
"token": "USDT",
"blockchain": "ethereum",
"walletId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"accountId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"limit": "10",
"dryRun": false
}
'import requests
url = "https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep"
payload = {
"minBalance": 10,
"token": "USDT",
"blockchain": "ethereum",
"walletId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"accountId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"limit": "10",
"dryRun": 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({
minBalance: 10,
token: 'USDT',
blockchain: 'ethereum',
walletId: '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
accountId: '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
limit: '10',
dryRun: false
})
};
fetch('https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep', 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/transactions/transfer/settlement/sweep",
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([
'minBalance' => 10,
'token' => 'USDT',
'blockchain' => 'ethereum',
'walletId' => '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
'accountId' => '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
'limit' => '10',
'dryRun' => 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/transactions/transfer/settlement/sweep"
payload := strings.NewReader("{\n \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": 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/transactions/transfer/settlement/sweep")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep")
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 \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totalQueued": 5,
"totalItems": 5,
"items": [
{
"walletId": "69f6300e8a1cb46ed1653b91",
"token": "USDT",
"blockchain": "polygon",
"balance": "10.5",
"balanceInUSD": "10.5",
"idempotencyKey": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4"
}
]
}
}{
"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": "......"
}Transactions
Auto Sweep Funds to Settlement Wallet
Auto Sweep wallet balances with autoSweep enabled that exceed the specified minimum USD amount (minBalance) into the settlement wallet.
Transfers are executed on-chain through the underlying blockchain, and network fees may vary depending on the blockchain.
POST
/
v2
/
transactions
/
transfer
/
settlement
/
sweep
Auto Sweep Funds to Settlement Wallet
curl --request POST \
--url https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"minBalance": 10,
"token": "USDT",
"blockchain": "ethereum",
"walletId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"accountId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"limit": "10",
"dryRun": false
}
'import requests
url = "https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep"
payload = {
"minBalance": 10,
"token": "USDT",
"blockchain": "ethereum",
"walletId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"accountId": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4",
"limit": "10",
"dryRun": 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({
minBalance: 10,
token: 'USDT',
blockchain: 'ethereum',
walletId: '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
accountId: '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
limit: '10',
dryRun: false
})
};
fetch('https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep', 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/transactions/transfer/settlement/sweep",
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([
'minBalance' => 10,
'token' => 'USDT',
'blockchain' => 'ethereum',
'walletId' => '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
'accountId' => '0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4',
'limit' => '10',
'dryRun' => 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/transactions/transfer/settlement/sweep"
payload := strings.NewReader("{\n \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": 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/transactions/transfer/settlement/sweep")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/transactions/transfer/settlement/sweep")
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 \"minBalance\": 10,\n \"token\": \"USDT\",\n \"blockchain\": \"ethereum\",\n \"walletId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"accountId\": \"0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4\",\n \"limit\": \"10\",\n \"dryRun\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totalQueued": 5,
"totalItems": 5,
"items": [
{
"walletId": "69f6300e8a1cb46ed1653b91",
"token": "USDT",
"blockchain": "polygon",
"balance": "10.5",
"balanceInUSD": "10.5",
"idempotencyKey": "0e472f6b-336b-4d4f-87d6-4f93e4e4e4e4"
}
]
}
}{
"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
Body
application/json
The token symbol (e.g., USDT, USDC, ETH).
Refer to the Get Supported Tokens endpoint for the list of supported tokens.
Example:
"USDT"
The chain. Can be either the blockchain name or slug.
Refer to the Get Supported Blockchains endpoint for the list of supported blockchains.
Example:
"ethereum"
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)