创建限价订单
post https://api.cryptomus.com/v2/user-api/convert/limit 复制
要求
查询参数
| 姓名 | 参数类型 | 定义 |
|---|---|---|
| from* | stringmax:10 | 转换货币(来源) |
| to* | stringmax:10 | 转换货币(目标) |
| amount* | string | 需要在来源货币中转换的金额如果金额中有便士,请与分离器一起发送。 示例:10.28 |
| price* | string | 转换价格如果金额中有便士,请与分离器一起发送。 示例:10.28 |
| stop_loss_price | string|null | 资产的市场价格阈值,达到该阈值订单将自动取消如果金额中有便士,请与分离器一起发送。 示例:10.28 |
参数类型
stringmax:10定义
转换货币(来源)参数类型
stringmax:10定义
转换货币(目标)参数类型
string定义
需要在来源货币中转换的金额如果金额中有便士,请与分离器一起发送。
示例:10.28参数类型
string定义
转换价格如果金额中有便士,请与分离器一起发送。
示例:10.28参数类型
string|null定义
资产的市场价格阈值,达到该阈值订单将自动取消如果金额中有便士,请与分离器一起发送。
示例:10.28
* - 强制性参数
请求示例
curl https://api.cryptomus.com/v2/user-api/convert/limit \
-X POST \
-H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
"from": "BTC",
"to": "USDT",
"amount": "0.0001",
"price": "70000",
"stop_loss_price": "0.21"
}'
复制回复
响应参数
| 姓名 | 参数类型 | 定义 |
|---|---|---|
| order_id | string | 转换 ID |
| uuid | string | 转换订单的UUID |
| convert_amount_from | string|null | 转换金额(来源) |
| convert_amount_to | string|null | 转换金额(目标) |
| executed_amount_from | string|null | 执行金额(来源) |
| executed_amount_to | string|null | 执行金额(目标) |
| convert_currency_from | string|null | 转换货币(来源) |
| convert_currency_to | string|null | 转换货币(目标) |
| type | string | 类型枚举可用选项:• market• limit |
| status | string | 状态枚举可用选项:• active• completed• partially_completed• cancelled• expired• failed |
| created_at | string | 创建日期和时间 |
| current_rate | string|null | 当前汇率 |
| market_rate | string|null | 市场价格 |
| limit | string|null | 限制值(仅限类型为限制时) |
| expires_at | string | 限制到期日期和时间 |
| completed_at | string | 订单完成的日期和时间(仅限订单已完成的情况) |
参数类型
string定义
转换 ID参数类型
string定义
转换订单的UUID参数类型
string|null定义
转换金额(来源)参数类型
string|null定义
转换金额(目标)参数类型
string|null定义
执行金额(来源)参数类型
string|null定义
执行金额(目标)参数类型
string|null定义
转换货币(来源)参数类型
string|null定义
转换货币(目标)参数类型
string定义
类型枚举可用选项:- market- limit参数类型
string定义
状态枚举可用选项:- active- completed- partially_completed- cancelled- expired- failed参数类型
string定义
创建日期和时间参数类型
string|null定义
当前汇率参数类型
string|null定义
市场价格参数类型
string|null定义
限制值(仅限类型为限制时)参数类型
string定义
限制到期日期和时间参数类型
string定义
订单完成的日期和时间(仅限订单已完成的情况)
响应示例
1{
2 "state": 0,
3 "result": {
4 "order_id": "2d9bf426-98ef-448b-84c2-03cc1ec78feb",
5 "uuid": "740a39d1-2edd-4b4d-bf49-826caf324312",
6 "convert_amount_from": "10.000",
7 "convert_amount_to": "3.000",
8 "executed_amount_from": null,
9 "executed_amount_to": null,
10 "convert_currency_from": "USDT",
11 "convert_currency_to": "XMR",
12 "type": "limit",
13 "status": "active",
14 "created_at": "2024-07-11 , 18:06:04",
15 "current_rate": "100",
16 "market_rate": "100",
17 "limit": "70000",
18 "expires_at": "2024-07-12 , 18:06:04"
19 }
20}复制