Skip to main content

Withdraw internal

caution
  • Make sure you have whitelisted your wallet address in address book
  • Can query by the master UID's api key only

API rate limit: 1 req / sec

HTTP Request

POST /private/v1/asset/withdraw/inner-create

Request Parameters

ParameterRequiredTypeComments
requestIdtruestringCustom ID, globally unique, used for idempotent verification.
  • The combination of letters (case sensitive) and numbers can be pure letters or pure numbers, with a length between 1-64 characters
  • cointruestringcoin
    addressTypetrueintegerWithdrawal address type: 1-EMAIL 2-PHONE 3-UID
    areaCodefalseintegerArea code, when the withdrawal address is a mobile phone, this parameter must be filled in. When the withdrawal address is not a mobile phone, this parameter does not need to be filled in. If it is filled in, it will not be used in the background
    addresstruestringRecipient information, email: email, mobile: mobile phone or phone number, uid: user ID, please confirm that the recipient information has been added to the address book
    amounttruestringWithdrawal amount
    remarkfalsestringNote information, cannot exceed 50 characters

    Response Parameters

    ParameterTypeComments
    withdraw_idstringWithdrawal ID

    Request Example

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

    def create_request(apiKey, secret, body):
    url = 'https://openapi-testnet.zoomex.com/private/v1/asset/withdraw/inner-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:", response.status_code)
    print("response info:", response.json())
    print("response time:", response.elapsed.total_seconds())

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

    create_request(apiKey, secret, body)

    Response Example

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