Skip to main content

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 fromAddress
  • fee_from_amount - network fee will be deducted from the withdrawal amount
  • withdraw_all - used to withdraw all funds from the wallet. The network fee will be deducted from the withdrawal amount

Creating withdrawal transaction

Request

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"
}
]
}
ParameterTypeDescriptionDefault valueExample
fromAddress *stringList of merchants wallet addresses with status waiting. Wallets must be of one code and one merchantn1FgCvGuVKznM8ezByK8AdysqYwPCF8XKC 2NFABrcHC2pKwuPRhdfEQVtdicw4jTi1PEy
codestringCrypto codeusdt
destinationarrayList of addresses and amounts
address *stringDestination addressn1FgCvGuVKznM8ezByK8AdysqYwPCF8XKC 2NFABrcHC2pKwuPRhdfEQVtdicw4jTi1PEy
amount *stringAmount for withdraw. Empty if strategy = withdraw_all100000000000
behavior *stringWorking only with XAMAX wallet. Default: fee_from_rest_amountfee_from_rest_amountfee_from_rest_amount
* - Required parameter