跳至主要内容

提現

警告
  • 確保您已經將提現地址加入到地址簿
  • 僅支持母帳號的API key

API頻率: 1次/秒

HTTP 請求

POST /private/v1/asset/withdraw/create

請求參數

參數是否必需類型說明
cointruestring幣種
chaintruestring鏈名
addresstruestring錢包地址
tagfalsestring標籤
  • 若添加地址時有填寫tag,則該字段必傳.
  • 注意: 如果鏈不支持tag/memo,請移除地址簿中的tag/memo,然後調用接口時,也不要傳tag字段
amounttruestring提現金額
requestIdtruestring自定義ID, 全局唯一, 用於冪等校驗
  • 字母(區分大小寫)數字組合, 可以是純字母或者純數字, 長度在1-64字符之間
  • 響應參數

    參數類型說明
    withdraw_idstring提現Id

    請求示例

    import time
    import hmac
    import hashlib
    import uuid
    import requests
    import json

    def create_transfer_request(apiKey, secret, body):
    url = 'https://openapi-testnet.zoomex.com/private/v1/asset/withdraw/create'
    timestamp = int(time.time() * 1000)
    recv_window = 1000000

    body['api_key'] = apiKey
    body['timestamp'] = timestamp
    body['recv_window'] = recv_window

    ordered_params = '&'.join([f"{key}={body[key]}" for key in sorted(body.keys())])

    signature = hmac.new(secret.encode('utf-8'), ordered_params.encode('utf-8'), hashlib.sha256).hexdigest()

    body['sign'] = signature

    headers = {
    'X-BAPI-API-KEY': apiKey,
    'X-BAPI-SIGN': signature,
    'X-BAPI-TIMESTAMP': str(timestamp),
    'X-BAPI-RECV-WINDOW': str(recv_window),
    'Content-Type': 'application/json'
    }

    response = requests.post(url, headers=headers, data=json.dumps(body))

    print("响应状态:", response.status_code)
    print("响应信息:", response.json())
    print("响应时间:", response.elapsed.total_seconds())

    apiKey = 'your key'
    secret = 'your secret'
    transferId = uuid.uuid4().hex
    body = {
    "coin":"USDT",
    "chain": "your chain",
    "address": "your address",
    "amount":"1",
    "sub_user_id":"162119745",
    "requestId":transferId,
    }

    create_transfer_request(apiKey, secret, body)

    響應示例

    {
    "retCode": 0,
    "retMsg": "success",
    "result": {
    "withdraw_id": "10195"
    },
    "retExtInfo": null,
    "time": 1672196571239
    }