Initiate Withdrawal
API Description
This interface is used to initiate withdrawals, supporting both on-chain transfers and internal transfers between CoinW users. The required parameters include amount, address, chain, and memo.
Note: Initiate withdrawl is only available via RESTful API.
Precautions
None
Authentication
This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Request Method
POST
Endpoint
/api/v1/private?command=doWithdraw
Frequency limit
The frequency limit for this interface is 3 requests/s per user ID. In addition to this per-interface limit, a global rate limit is also enforced.
For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| memo | True | String | Memo |
| type | False | String | ordinary_withdraw , internal_transfer Default: ordinary_withdraw |
| amount | True | String | Withdrawal quantity |
| currency | True | String | Currency |
| address | True | String | Withdrawal address: When "type" is "ordinary_withdraw, provide the blockchain address. When "type" is internal_transfer, provide the user ID, email address or mobile phone number based on "innerToType". |
| chain | True | String | Blockchain name., e.g., ERC20,TRC20,BSC |
| innerToType | True | Integer | Internal withdrawal address type.When type is internal_transfer, 1. User ID, 2. Mobile phone number, 3. Email address are required. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| depositNumber | String | Unique ID |
Request Example
The following Python code shows how to withdraw.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
api_url = "/api/v1/private?command=doWithdraw"
method = "post"
params = {
"memo" : "None" ,
"type" : "internal_transfer" ,
"amount" : "0.001" ,
"currency" : "BTC" ,
"address" : "3491077",
"chain" : "BTC" ,
"innerToType" : 1 ,
}
SpotRestfulPrivate(host, api_url, method, api_key, params, secret_key) # function SpotRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface)
Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Response Example
The following is an example response returned by the above Python request:
{'code': '200', 'data': {'depositNumber': '23705'}, 'msg': 'SUCCESS'}