Withdraw
Withdraw assets from your Bybit account. You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
tip
- Make sure you have whitelisted your wallet address here
- Request by the master UID's api key only
formula
feeType=0:
- withdrawPercentageFee != 0: handlingFee = inputAmount / (1 - withdrawPercentageFee) * withdrawPercentageFee + withdrawFee
- withdrawPercentageFee = 0: handlingFee = withdrawFee
feeType=1:
- withdrawPercentageFee != 0: handlingFee = withdrawFee + (inputAmount - withdrawFee) * withdrawPercentageFee
- withdrawPercentageFee = 0: handlingFee = withdrawFee
HTTP Request
POST /v5/asset/withdraw/create
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
coin | true | string | Coin, uppercase only |
chain | false | string | Chain
|
address | true | string |
|
tag | false | string | Tag
|
amount | true | string | Withdraw amount |
timestamp | true | integer | Current timestamp (ms). Used for preventing from withdraw replay |
forceChain | false | integer | Whether or not to force an on-chain withdrawal
|
accountType | false | string | Select the wallet to be withdrawn from
|
feeType | false | integer | Handling fee option
|
requestId | false | string | Customised ID, globally unique, it is used for idempotent verification |
beneficiary | false | Object | Travel rule info, only required for kyc=KOR (korean) users |
> vaspEntityId | true | string | Receiver exchange entity Id. Please call this endpoint to get this ID |
> beneficiaryName | false | string | Receiver exchange user KYC name, like John Wilson or Wilson John |
Response Parameters
Parameter | Type | Comments |
---|---|---|
id | string | Withdrawal ID |
Request Example
- HTTP
- Python
- Node.js
POST /v5/asset/withdraw/create HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672196570254
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXX
Content-Type: application/json
{
"coin": "USDT",
"chain": "ETH",
"address": "0x99ced129603abc771c0dabe935c326ff6c86645d",
"amount": "24",
"timestamp": 1672196561407,
"forceChain": 0,
"accountType": "FUND"
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.withdraw(
coin="USDT",
chain="ETH",
address="0x99ced129603abc771c0dabe935c326ff6c86645d",
amount="24",
timestamp=1672196561407,
forceChain=0,
accountType="FUND",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.submitWithdrawal({
coin: 'USDT',
chain: 'ETH',
address: '0x99ced129603abc771c0dabe935c326ff6c86645d',
amount: '24',
timestamp: 1672196561407,
forceChain: 0,
accountType: 'FUND',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"id": "10195"
},
"retExtInfo": {},
"time": 1672196571239
}