Skip to main content
Version: Next

Create Order

Create a futures opening or closing order, supporting market and limit orders.

API Information

  • Method: POST
  • Path: /api/v1/futures/open-api/order/create

Margin Mode

The create order endpoint does not accept a marginMode parameter. The server uses the current account configuration for the trading pair: 1=Cross, 2=Isolated.

Isolated margin workflow:

1. GET  /account/config?symbol=BTCUSDT        → confirm current marginMode
2. POST /account/margin-mode { symbol, marginMode: 2 } → switch if needed
3. POST /order/create { ... } → no marginMode required

Request Parameters

ParameterTypeRequiredDescription
symbolstringYesFutures trading pair, e.g. BTCUSDT
coTypeintYesContract type: 1=US stocks, 2=Hong Kong stocks, 3=Cryptocurrency
orderTypeintYesOrder type: 1=Limit, 2=Market
openTypeintYesOpen/Close: 1=Open, 2=Close
sideintYesDirection: 1=Long (Buy), 2=Short (Sell)
pricestringConditionalOrder price (required for limit orders)
volstringConditionalQuantity (choose vol or amt)
amtstringConditionalAmount in USD (choose vol or amt, recommended for opening)
leveragestringRequired for openLeverage, e.g. "10"
posIdint64Required for closePosition ID
stopProfitPricestringNoTake profit price
stopLossPricestringNoStop loss price
triggerTypeintNoTrigger type: 1=Normal, 2=Take profit, 3=Stop loss, 4=Liquidation

Request Example

Opening Example:

{
"symbol": "BTCUSDT",
"coType": 3,
"orderType": 2,
"openType": 1,
"side": 1,
"amt": "10000",
"leverage": "10",
"triggerType": 1
}

Closing Example:

{
"symbol": "BTCUSDT",
"coType": 3,
"orderType": 2,
"openType": 2,
"side": 1,
"posId": 123456,
"vol": "0.5",
"triggerType": 1
}

Response Fields

FieldTypeDescription
codeintStatus code, 0 indicates success
msgstringResponse message
data.orderIdint64Order ID
data.orderNostringOrder number

Response Example

{
"code": 0,
"msg": "success",
"data": {
"orderId": 123456789,
"orderNo": "ORD20240120001"
}
}

Error Codes

Business errors are returned with HTTP 200. Use the body code field to identify the specific error.

codeDescription
3000Trading pair not found
8001Below minimum trade amount
8002Close position order failed, please check your position
8003Insufficient balance to close, please check position and open orders
8004Order creation failed
8005Take-profit/stop-loss order creation failed
8006Take-profit/stop-loss order would be triggered immediately
8016Exceeds maximum trade amount
8017Exceeds maximum position size
8018Insufficient margin
8100Product information error