订单
获取订单列表
每次请求获取一种订单类型的分页订单列表。可按状态和日期范围筛选。支持全部三种订单类型。
GET
/
v2
/
orders
获取订单列表
curl --request GET \
--url https://api-test.velafi.com/v2/orders \
--header 'X-BH-TOKEN: <api-key>'import requests
url = "https://api-test.velafi.com/v2/orders"
headers = {"X-BH-TOKEN": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BH-TOKEN': '<api-key>'}};
fetch('https://api-test.velafi.com/v2/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api-test.velafi.com/v2/orders")
.header("X-BH-TOKEN", "<api-key>")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"data.currentPage": 123,
"data.size": 123,
"data.total": 123,
"data.record": [
{
"orderId": "<string>",
"clientId": "<string>",
"merchantId": 123,
"paymentId": 123,
"country": "<string>",
"crypto": "<string>",
"fiat": "<string>",
"orderType": "<string>",
"orderPrice": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"fiatFee": "<string>",
"orderStatus": 123,
"hasRefund": 123,
"createTime": "<string>",
"completedTime": "<string>",
"onRampMerchantId": 123,
"onRampPaymentId": 123,
"onRampCountry": "<string>",
"onRampFiat": "<string>",
"onRampFiatAmount": "<string>",
"onRampFiatFee": "<string>",
"offRampMerchantId": 123,
"offRampPaymentId": 123,
"offRampCountry": "<string>",
"offRampFiat": "<string>",
"offRampFiatAmount": "<string>",
"offRampFiatFee": "<string>"
}
]
}
}使用此端点获取分页订单列表,每次请求仅限一种订单类型 ——
fiat_to_crypto、crypto_to_fiat 或 fiat_to_fiat。可通过状态或日期范围筛选来缩小结果范围。结果按 completedTime 排序,最新的在前。单币种订单与法币兑法币订单的响应记录结构不同;其结构与单个订单详情端点保持一致。可将其用于对账看板、报表流程,以及主动监控需要处理的订单。
端点
GET https://api.velafi.com/v2/orders
在沙盒环境中测试时,请使用
https://api-test.velafi.com/v2/orders。查询参数
日期范围筛选的开始时间,以毫秒级 Unix 时间戳表示(例如
"1700000000000")。对于 fiat_to_crypto 和 crypto_to_fiat 订单,该范围与订单的 completedTime 进行匹配;对于 fiat_to_fiat 订单,则与其最后更新时间进行匹配。响应字段
分页结果集。
显示 data 字段
显示 data 字段
订单摘要对象数组。字段因
orderType 而异。显示 法币兑加密货币 / 加密货币兑法币记录字段
显示 法币兑加密货币 / 加密货币兑法币记录字段
显示 法币兑法币记录字段
显示 法币兑法币记录字段
示例
- 法币兑加密货币订单
- 法币兑法币订单
curl -X GET "https://api.velafi.com/v2/orders?orderType=fiat_to_crypto&orderStatus=60¤tPage=1&pageSize=10" \
-H "X-BH-TOKEN: YOUR_TOKEN"
{
"code": 200,
"msg": "SUCCESS",
"data": {
"size": 10,
"currentPage": 1,
"total": 1,
"record": [
{
"orderId": "493829236956962816",
"clientId": "f_c_0250222004",
"merchantId": 3,
"paymentId": 0,
"country": "Mexico",
"crypto": "USDT",
"fiat": "MXN",
"orderType": "fiat_to_crypto",
"orderPrice": "21.4104",
"cryptoAmount": "5.1376",
"fiatAmount": "110",
"fiatFee": "0",
"orderStatus": 60,
"hasRefund": 0,
"createTime": "1740214865000",
"completedTime": "1740214866000"
}
]
}
}
curl -X GET "https://api.velafi.com/v2/orders?orderType=fiat_to_fiat&startTime=1740000000000&endTime=1741000000000¤tPage=1&pageSize=10" \
-H "X-BH-TOKEN: YOUR_TOKEN"
{
"code": 200,
"msg": "SUCCESS",
"data": {
"size": 10,
"currentPage": 1,
"total": 1,
"record": [
{
"orderId": "494541042692263936",
"clientId": "c_f_0250224003",
"onRampMerchantId": 3,
"onRampPaymentId": 17,
"onRampCountry": "Mexico",
"onRampFiat": "MXN",
"onRampFiatAmount": "110",
"onRampFiatFee": "1",
"offRampCountry": "Argentina",
"offRampMerchantId": 4,
"offRampPaymentId": 134,
"offRampFiat": "ARS",
"offRampFiatAmount": "6156.3",
"offRampFiatFee": "1",
"orderPrice": "55.9664",
"orderStatus": 31,
"createTime": "1740384573000",
"completedTime": "1740384573000"
}
]
}
}
⌘I
获取订单列表
curl --request GET \
--url https://api-test.velafi.com/v2/orders \
--header 'X-BH-TOKEN: <api-key>'import requests
url = "https://api-test.velafi.com/v2/orders"
headers = {"X-BH-TOKEN": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BH-TOKEN': '<api-key>'}};
fetch('https://api-test.velafi.com/v2/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api-test.velafi.com/v2/orders")
.header("X-BH-TOKEN", "<api-key>")
.asString();{
"code": 123,
"msg": "<string>",
"data": {
"data.currentPage": 123,
"data.size": 123,
"data.total": 123,
"data.record": [
{
"orderId": "<string>",
"clientId": "<string>",
"merchantId": 123,
"paymentId": 123,
"country": "<string>",
"crypto": "<string>",
"fiat": "<string>",
"orderType": "<string>",
"orderPrice": "<string>",
"cryptoAmount": "<string>",
"fiatAmount": "<string>",
"fiatFee": "<string>",
"orderStatus": 123,
"hasRefund": 123,
"createTime": "<string>",
"completedTime": "<string>",
"onRampMerchantId": 123,
"onRampPaymentId": 123,
"onRampCountry": "<string>",
"onRampFiat": "<string>",
"onRampFiatAmount": "<string>",
"onRampFiatFee": "<string>",
"offRampMerchantId": 123,
"offRampPaymentId": 123,
"offRampCountry": "<string>",
"offRampFiat": "<string>",
"offRampFiatAmount": "<string>",
"offRampFiatFee": "<string>"
}
]
}
}