Skip to main content

Get Bonus Usage Records

Query bonus and coupon usage records.

API rate limit: 60 req / min

HTTP Request

GET /private/v1/asset/bonus/usage

Request Parameters

ParameterRequiredTypeComments
cointruestringCoin. Currently only USDT is supported
awardTypefalseintegerAward type. 1: Bonus. 2: Coupon. If not passed, all types are returned
startTimefalseintegerThe start timestamp (s). Records after this time are returned
endTimefalseintegerThe end timestamp (s). Records before this time are returned
limitfalseintegerLimit for data size per page. [1, 50]. Default: 10

Response Parameters

ParameterTypeComments
rowsarrayObject
> award_typeintegerAward type. 1: Bonus. 2: Coupon
> symbolstringTrading pair using the award
> timeintegerAward usage timestamp (s), UTC
> typeintegerUsage type. 1: Trade. 2: Trading fee. 3: Funding fee
> coinstringCoin
> amountstringUsage amount
> order_idstringOrder ID. Returns empty when no order is associated

Request Example

import time
import hmac
import hashlib
import requests
import urllib.parse

def create_request(apiKey, secret, params):
url = 'https://openapi-testnet.zoomex.com/private/v1/asset/bonus/usage'
timestamp = int(time.time() * 1000)
recv_window = 1000000

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

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

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

params['sign'] = signature

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

query_string = urllib.parse.urlencode(params)
full_url = f"{url}?{query_string}"

response = requests.get(full_url, headers=headers)

print("response status:", response.status_code)
print("response info:", response.json())
print("response time:", response.elapsed.total_seconds())

apiKey = 'your key'
secret = 'your secret'
params = {
"coin": "USDT",
"awardType": 1,
"limit": 10,
}

create_request(apiKey, secret, params)

Response Example

{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"result": {
"rows": [
{
"award_type": 1,
"symbol": "BTCUSDT",
"time": 1718353508,
"type": 1,
"coin": "USDT",
"amount": "10",
"order_id": "1234567890"
},
{
"award_type": 2,
"symbol": "ETHUSDT",
"time": 1718353600,
"type": 2,
"coin": "USDT",
"amount": "1.5",
"order_id": ""
}
]
},
"ext_info": null,
"time_now": 1718353700000
}