市場訂單創建
post https://api.cryptomus.com/v2/user-api/exchange/orders/market 複製
要求
查詢參數
姓名 | 參數類型 | 定義 |
---|---|---|
market* | string | 指定可用交易對(例如“TRX_USDT”) |
quantity* | string | 以 base_currency 為單位的數量 |
value* | string | 以 quote_currency 為單位的訂單執行限價 |
direction* | string | 訂單類型可用選項:• buy• sell |
client_order_id | string | 客戶端創建的唯一標識符 |
tag | string | 經紀人標籤 |
參數類型
string定義
指定可用交易對(例如“TRX_USDT”)參數類型
string定義
以 base_currency 為單位的數量參數類型
string定義
以 quote_currency 為單位的訂單執行限價參數類型
string定義
訂單類型可用選項:- buy- sell參數類型
string定義
客戶端創建的唯一標識符參數類型
string定義
經紀人標籤
* - 必需參數
請求範例
curl https://api.cryptomus.com/v2/user-api/exchange/orders/market \
-X POST \
-H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
"market": "TRX_USDT",
"quantity": "100",
"direction": "sell"
}'
複製可能的程式碼
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": 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 "state": 3,
3 "message": "Order quantity must be between 10 and 10000000000 size."
4}
複製