建立限價單

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_pricestring|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_idstring轉換ID
uuidstring轉換訂單的UUID
convert_amount_fromstring|null轉換金額從
convert_amount_tostring|null將金額轉換為
executed_amount_fromstring|null執行金額來自
executed_amount_tostring|null已執行金額
convert_currency_fromstring|null貨幣轉換自
convert_currency_tostring|null將貨幣轉換為
typestring類型枚舉可用選項:• market• limit
statusstring狀態枚舉可用選項:• active• completed• partially_completed• cancelled• expired• failed
created_atstring日期時間創建
current_ratestring|null目前利率
market_ratestring|null市場價格
limitstring|null限制值(僅限限制類型)
expires_atstring限製到期日時間
completed_atstring訂單完成的日期和時間(僅限訂單已完成的情況)

參數類型

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}
複製