建立市價單
post
https://api.cryptomus.com/v2/user-api/convert/
要求
查詢參數
姓名 | 參數類型 | 定義 |
---|---|---|
from* | stringmax:10 | 轉換貨幣 |
to* | stringmax:10 | 要轉換的貨幣 |
amount* | string | 需要兌換成貨幣的金額如果金額中有便士,則使用分隔符號“.”發送。 例如:10.28 |
參數類型
stringmax:10定義
轉換貨幣參數類型
stringmax:10定義
要轉換的貨幣參數類型
string定義
需要兌換成貨幣的金額如果金額中有便士,則使用分隔符號“.”發送。
例如:10.28
* - 必需參數
請求範例
curl https://api.cryptomus.com/v2/user-api/convert/ \
-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"
}'
複製回覆
響應參數
姓名 | 定義 |
---|---|
order_id | 轉換ID |
convert_amount_from | 轉換金額從 |
convert_amount_to | 將金額轉換為 |
executed_amount_to | 已執行金額 |
executed_amount_from | 執行金額來自 |
convert_currency_from | 貨幣轉換自 |
convert_currency_to | 將貨幣轉換為 |
type | 類型枚舉可用選項:• market• limit |
status | 狀態枚舉可用選項:• active• completed• partially_completed• cancelled• expired• failed |
created_at | 日期時間創建 |
current_rate | 目前利率 |
limit | 限制值(僅限限制類型) |
expires_at | 限製到期日時間 |
completed_at | 訂單完成的日期時間(僅限訂單完成時) |
定義
轉換ID定義
轉換金額從定義
將金額轉換為定義
已執行金額定義
執行金額來自定義
貨幣轉換自定義
將貨幣轉換為定義
類型枚舉可用選項:- market- limit定義
狀態枚舉可用選項:- active- completed- partially_completed- cancelled- expired- failed定義
日期時間創建定義
目前利率定義
限制值(僅限限制類型)定義
限製到期日時間定義
訂單完成的日期時間(僅限訂單完成時)
回應範例
1{
2 "state": 0,
3 "result": {
4 "order_id": "2d9bf426-98ef-448b-84c2-03cc1ec78feb",
5 "convert_amount_from": "10.000",
6 "convert_amount_to": "3.000",
7 "executed_amount_from": null,
8 "executed_amount_to": null,
9 "convert_currency_from": "USDT",
10 "convert_currency_to": "XMR",
11 "type": "market",
12 "status": "completed",
13 "created_at": "2024-07-11 , 18:06:04",
14 "current_rate": "100",
15 "completed_at": "2024-07-11 , 18:06:04"
16 }
17}
複製