跳至主要内容

査詢快捷買幣記錄

査詢快捷買幣記錄.

API頻率: 300次/分

HTTP 請求

GET /private/v1/asset/fiat/query-record

請求參數

參數是否必需類型說明
orderIdfalsestring訂單Id
startTimefalseinteger開始時間戳 (秒)
endTimefalseinteger結束時間戳 (秒)
pageSizefalseinteger每頁數量限制. [1, 50]. 默認: 20
cursorfalsestring游標,用於翻頁

響應參數

參數類型說明
rowsarrayObject
> orderIdstring訂單id.
> cryptostring數字貨幣
> crypto_amountstring數字貨幣數量
> fiatstring法幣
> fiat_amountstring法幣數量
> trans_statusint狀態0-已付款1-進行中2-待支付3-已完成4-申訴中5-已取消6-失敗
> platformstring渠道商
> unitPricestring單價(fiat/crypto)
> timestring時間
> sidestring交易方向
cursorstring游標,用於翻頁

請求示例

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/fiat/query-record'
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 = {}

create_request(apiKey, secret, params)

響應示例

{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"result": {
"rows": [
{
"order_id": "1392502109169127424",
"crypto": "USDT",
"crypto_amount": "0",
"fiat": "USD",
"fiat_amount": "10",
"trans_status": 5,
"platform": "AIchemypay",
"unitPrice": "0",
"time": "1752068774",
"side": "buy",
"user_id": "101421193"
}
],
"cursor": ""
},
"ext_info": null,
"time_now": 1718476267321
}