限價訂單創建

限價單將在達到指定價格時執行

post
https://api.cryptomus.com/v2/user-api/exchange/orders
複製

要求

查詢參數

姓名參數類型定義
market*string指定可用交易對(例如“TRX_USDT”)
quantity*string以 base_currency 為單位的數量
price*string以 quote_currency 為單位的訂單執行限價
direction*string訂單類型可用選項:buysell
stop_loss_pricestring資產的門檻市場價格,達到該價格後訂單將自動取消
client_order_idstring客戶端創建的唯一標識符
tagstring經紀人標籤

參數類型

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