Skip to main content

Create Internal Transfer

Create the internal transfer between different account types under the same UID.

tip
  • Each account type has its own acceptable coins, e.g, you cannot transfer USDC from SPOT to CONTRACT.
  • Please refer to transferable coin list API to find out more.
  • Currently, the funding wallet only supports outgoing transfers in cryptocurrency, not in fiat currency.

API rate limit: 1 req / sec

HTTP Request

POST /private/v1/asset/transfer/single-account-transfer

Request Parameters

ParameterRequiredTypeComments
requestIdtruestringUUID. Please manually generate a UUID
cointruestringCoin
amounttruestringAmount
fromAccountTypetruestringFrom account type
toAccountTypetruestringTo account type

Response Parameters

ParameterTypeComments
transferIdstringUUID

Request Example

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/transfer/single-account-transfer'
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",
"amount":"1",
"fromAccountType":"CONTRACT",
"toAccountType":"SPOT",
}

create_transfer_request(apiKey, secret, body)

Response Example

{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"result": {
"transfer_id": "87c18caa-539a-449e-99cc-c39e4329bcc5"
},
"ext_info": null,
"time_now": 1721037889588
}