Prerequisites
Before starting this guide, ensure you have:- Obtained an API key from the OpenXSwitch Console.
- An active API key with the necessary write and withdraw permissions.
- Obtained an
accountId(if not using the default dashboard account). See the Get Started with Account Management for details. - A provisioned source wallet with sufficient asset balance.
The Plan
We’ll go through:- Fetching Supported Blockchains and Tokens: Identifying valid target networks and asset symbols.
- Obtaining Source Wallet ID: Retrieving the originating
walletIdcontaining the assets. - Initiating a Token Withdrawal: Submitting the transfer request via the API.
- Fetching Transaction Status: Tracking transaction state using the returned transaction ID.
Step 1: Fetch Supported Blockchains & Tokens
Before initiating a transfer, query the tokens endpoint to fetch supported cryptocurrencies and their associated blockchain network identifiers (slug or name).
Send a GET request to retrieve available tokens along with their supported target networks:
Sample Response
💡 Selecting Network and Asset Parameters
- Use the
symbol(e.g.,"ETH"or"USDT") for thetokenparameter when initiating a withdrawal request.- For the
blockchainparameter, you can pass either the networkname(e.g.,"Ethereum") or the networkslug(e.g.,"ethereum-sepolia"). Using thenameis recommended for standard network routing unless targeting a specific testnet environment.
Step 2: Obtain Source Wallet ID
You must provide a validwalletId from which the assets will be debited. If you do not already have the wallet ID, you can retrieve it using either of the following endpoints depending on your application flow:
Option A: Query Wallets by User ID
If the source wallet is linked to a specific user entity, fetch all wallets associated with thatuserId:
Option B: List Account Wallets
If you are operating across account-level wallets or treasury reserves, fetch all wallets provisioned under your workspace/account:Sample Response (Common)
Tip: Select and copy thewalletIdmatching the targetblockchainnetwork and asset balance to pass into the withdrawal payload in Step 3.
Step 3: Initiate a Token Withdrawal
To execute a token transfer or external withdrawal, send aPOST request to the /v2/transactions/withdraw endpoint.
Request Payload Fields
idempotencyKey(string, required): Unique client string to prevent duplicate execution during retries.walletId(string, required): The source wallet initiating the transfer.amount(string, required): The nominal token or native currency quantity to send.withdrawalAddress(string, required): The destination blockchain address.token(string, required): Asset symbol (e.g.,USDT,ETH).blockchain(string, required): Target network identifier.refId(string, optional): Client transaction reference ID for internal mapping.note(string, optional): Human-readable internal label or memo.
Step 4: Fetch Transaction Details
To monitor execution status, query the transaction endpoint using thetransactionId returned in Step 3.
Bash
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)