Creating withdrawal via API
XAMAX wallet
XAMAX provides the ability to use a cold wallet to store funds. This wallet allows you to:
- withdraw at a convenient time without restrictions
- independently control the network processing fee at the time of withdrawal
- reduce the size of the network fee by reducing the number of withdrawals
If automatic withdrawal from a rotating wallet is not enabled in the settings, then an XAMAX wallet is automatically created for the merchant in each cryptocurrency. When the amount of funds on the rotation wallet exceeds the rotation limit, the funds from it will be transferred to the XAMAX wallet with payment processing fee deducted. All funds on this wallet are funds available to the merchant without additional commissions (except a network fee for processing the withdraw transaction). An XAMAX wallet does not have a maximum limit for holding funds.
The merchant can also choose several types of network fee calculation behavior
:
fee_from_rest_amount
- the network fee will be deducted from the balance on the wallet fromAddressfee_from_amount
- network fee will be deducted from the withdrawal amountwithdraw_all
- used to withdraw all funds from the wallet. The network fee will be deducted from the withdrawal amount
Creating withdrawal transaction
Request
- Production
- Sandbox
POST https://api.xamax.io/v1/withdrawal HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"fromAddress": [
"string"
],
"code": "string",
"destination": [
{
"address": "string",
"amount": "string",
"behavior": "fee_from_rest_amount"
}
]
}
POST https://api.sandbox.xamax.io/v1/withdrawal HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"fromAddress": [
"string"
],
"code": "string",
"destination": [
{
"address": "string",
"amount": "string",
"behavior": "fee_from_rest_amount"
}
]
}
Parameter | Type | Description | Default value | Example |
---|---|---|---|---|
fromAddress | string | List of merchants wallet addresses with status waiting. Wallets must be of one code and one merchant | n1FgCvGuVKznM8ezByK8AdysqYwPCF8XKC 2NFABrcHC2pKwuPRhdfEQVtdicw4jTi1PEy | |
code | string | Crypto code | usdt | |
destination | array | List of addresses and amounts | ||
address | string | Destination address | n1FgCvGuVKznM8ezByK8AdysqYwPCF8XKC 2NFABrcHC2pKwuPRhdfEQVtdicw4jTi1PEy | |
amount | string | Amount for withdraw. Empty if strategy = withdraw_all | 100000000000 | |
behavior | string | Working only with XAMAX wallet. Default: fee_from_rest_amount | fee_from_rest_amount | fee_from_rest_amount |