订单
获取订单列表
每次请求获取一种订单类型的分页订单列表。可按状态和日期范围筛选。支持全部三种订单类型。
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。查询参数
string
必填
要列出的订单类型。可选值为
fiat_to_crypto、crypto_to_fiat 或 fiat_to_fiat。integer
string
日期范围筛选的开始时间,以毫秒级 Unix 时间戳表示(例如
"1700000000000")。对于 fiat_to_crypto 和 crypto_to_fiat 订单,该范围与订单的 completedTime 进行匹配;对于 fiat_to_fiat 订单,则与其最后更新时间进行匹配。string
日期范围筛选的结束时间,以毫秒级 Unix 时间戳表示(例如
"1800000000000")。与 startTime 匹配同一时间戳字段。integer
要获取的页码。默认为
1。integer
每页记录数。默认为
10,最大为 100。响应字段
integer
响应状态码。
200 表示成功。string
可读的响应信息。
object
分页结果集。
显示 data 字段
显示 data 字段
integer
返回的当前页码。
integer
每页记录数。
integer
所有页中匹配的订单总数。
array
订单摘要对象数组。字段因
orderType 而异。显示 法币兑加密货币 / 加密货币兑法币记录字段
显示 法币兑加密货币 / 加密货币兑法币记录字段
string
唯一订单 ID。
string
您自定义的订单参考 ID。
integer
该订单的商户 ID。
integer
该订单使用的支付方式 ID。
string
该订单的国家名称。
string
加密货币代码(例如
"USDT")。string
法币代码(例如
"MXN")。string
订单类型:
fiat_to_crypto 或 crypto_to_fiat。string
订单创建时的汇率。
string
该订单的加密货币金额。
string
该订单的法币金额。
string
以法币收取的费用。
integer
当前订单状态码。
integer
如果该订单已退款则为
1;否则为 0。string
订单创建时间的 Unix 时间戳(毫秒)。
string
订单达到最终状态时的 Unix 时间戳(毫秒)。在此之前,其值等于
createTime。显示 法币兑法币记录字段
显示 法币兑法币记录字段
string
唯一订单 ID。
string
您自定义的订单参考 ID。
integer
入金环节的商户 ID。
integer
入金环节的支付方式 ID。
string
入金环节的国家。
string
入金环节收取的法币。
string
入金环节收取的金额。
string
入金环节的费用。
integer
出金环节的商户 ID。
integer
出金环节的收款人支付 ID。
string
出金环节的国家。
string
出金环节交付的法币。
string
出金环节交付的金额。
string
出金环节的费用。
string
订单创建时的跨币种汇率。
integer
当前订单状态码。
string
订单创建时间的 Unix 时间戳(毫秒)。
string
订单完成时间的 Unix 时间戳(毫秒)。
示例
- 法币兑加密货币订单
- 法币兑法币订单
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>"
}
]
}
}
