Mass sending
Mass sending allows the User to create and send 2 or more withdrawals at a time, in the same currency, to different wallets. For the User this looks like one transaction, for XAMAX it is many single transactions completed at one time.
Creating mass sending transaction
API requests to single withdrawal and mass sending has only one difference.
At mass sending request adding a few destination wallets and amounts.
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"
},
{
"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"
},
{
"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 |
Example
Request
- Production
- Sandbox
POST https://api.xamax.io/v1/withdrawal HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"fromAddress": [
"0x98c7320928aA5358e29F21364CbAa3ab97a3a9AC"
],
"code": "usdt",
"destination": [
{
"address": "0xba783696FEcB5E964a0716B6f5917C8bB1935a7b",
"amount": "1000000",
"behavior": "fee_from_rest_amount"
},
{
"address": "0x98c7320928aA5358e29F21364CbAb3ab97a3a9AC",
"amount": "1000000",
"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": [
"0x98c7320928aA5358e29F21364CbAa3ab97a3a9AC"
],
"code": "usdt",
"destination": [
{
"address": "0xba783696FEcB5E964a0716B6f5917C8bB1935a7b",
"amount": "1000000",
"behavior": "fee_from_rest_amount"
},
{
"address": "0x98c7320928aA5358e29F21364CbAb3ab97a3a9AC",
"amount": "1000000",
"behavior": "fee_from_rest_amount"
}
]
}
Response body
{
"withdrawals": [
{
"withdrawalAddresses": [
{
"address": "0xba783696FEcB5E964a0716B6f5917C8bB1935a7b",
"amount": "1000000",
"amountUnit": "1.00",
"code": "usdt",
"exchangeRate": {
"currency": "usd",
"exchangeRate": 1,
"currencyAmount": 1,
"code": "usdt"
}
}
],
"txHash": "0x7c5b1746db0eed98f3f7f7d5b839950069a710e2e0fa25fa187c69f229f3870e",
"fee": "207856831777650",
"feeCurrency": "eth",
"feeUnit": "0.00020785683177765",
"currency": "usdt",
"feeExchangeRate": {
"currency": "usd",
"exchangeRate": 1900,
"currencyAmount": 0.394927980377535,
"code": "eth"
},
"exchange": null,
"processingAdditionalCost": null
},
{
"withdrawalAddresses": [
{
"address": "0x98c7320928aA5358e29F21364CbAb3ab97a3a9AC",
"amount": "1000000",
"amountUnit": "1.00",
"code": "usdt",
"exchangeRate": {
"currency": "usd",
"exchangeRate": 1,
"currencyAmount": 1,
"code": "usdt"
}
}
],
"txHash": "0xea8f6998aaa0608bd97cea0250e04b024d619228bbbcd56f36ac51add62dedba",
"fee": "207856831777650",
"feeCurrency": "eth",
"feeUnit": "0.00020785683177765",
"currency": "usdt",
"feeExchangeRate": {
"currency": "usd",
"exchangeRate": 1900,
"currencyAmount": 0.394927980377535,
"code": "eth"
},
"exchange": null,
"processingAdditionalCost": null
}
],
"total": {
"fee": {
"amount": "415713663555300",
"amountUnit": "0.0004157136635553",
"currency": "eth"
},
"processingAdditionalCost": {
"amount": "0",
"amountUnit": "",
"currency": ""
}
}
}