限價訂單創建
限價單將在達到指定價格時執行
post
https://api.cryptomus.com/v2/user-api/exchange/orders
要求
查詢參數
姓名 | 參數類型 | 定義 |
---|---|---|
market* | string | 指定可用交易對(例如“TRX_USDT”) |
quantity* | string | 以 base_currency 為單位的數量 |
price* | string | 以 quote_currency 為單位的訂單執行限價 |
direction* | string | 訂單類型可用選項:• buy• sell |
stop_loss_price | string | 資產的門檻市場價格,達到該價格後訂單將自動取消 |
client_order_id | string | 客戶端創建的唯一標識符 |
tag | string | 經紀人標籤 |
參數類型
string定義
指定可用交易對(例如“TRX_USDT”)參數類型
string定義
以 base_currency 為單位的數量參數類型
string定義
以 quote_currency 為單位的訂單執行限價參數類型
string定義
訂單類型可用選項:- buy- sell參數類型
string定義
資產的門檻市場價格,達到該價格後訂單將自動取消參數類型
string定義
客戶端創建的唯一標識符參數類型
string定義
經紀人標籤
* - 必需參數
請求範例
{
"market": "TRX_USDT",
"quantity": "20",
"price": "0.2964",
"direction": "buy",
"stop_loss_price": "0.31"
}
複製可能的程式碼
200:訂單創建成功
404:未找到使用者或資源
422:無效的輸入數據
500:內部伺服器錯誤
回應範例
1{
2 "order_id": "01JEXAFCCC5ZVJPZAAHHDKQBNG"
3}
複製可能的錯誤
範例回覆:
1{
2 "state": 1,
3 "message": "Market validation error"
4}
複製
1{
2 "state": 2,
3 "message": "Incorrect amount or price accuracy"
4}
複製
1{
2 "state": 3,
3 "message": "Order amount is out of acceptable ranges"
4}
複製
1{
2 "state": 4,
3 "message": "Stop Loss order price error"
4}
複製
1{
2 "state": 6,
3 "message": "Insufficient balance"
4}
複製
1{
2 "state": 7,
3 "message": "client_order_id error"
4}
複製
1{
2 "state": 0,
3 "message": "Standard validation error"
4}
複製錯誤回應範例
1{
2 "code": 4,
3 "message": "Stop-loss price must be higher than order price"
4}
複製