API Reference

Create new Futures order

Weight: 1

This endpoint allows you to create a new Futures order. There are two main types of orders you can place: Limit orders and Market orders. Here's how to use them:

  1. Limit Order

A Limit order allows you to set a specific price at which you want to buy or sell.

To place a Limit order:

  • Set "type" to "LIMIT"
  • Set "priceType" to "INPUT" (this is the default, so you can omit it if you prefer)
  • Specify the "price" at which you want to execute the order
  • Set other required parameters like "symbol", "side", "quantity", etc.

Example:
For a Limit order to buy 10,000 contracts of ETHUSDT-PERPETUAL at a price of 3000

{
  "symbol": "ETHUSDT-PERPETUAL",
  "side": "BUY_OPEN",
  "type": "LIMIT",
  "quantity": 10000,
  "price": 3000,
  "priceType": "INPUT",
  "timeInForce": "GTC",
  "clientOrderId": "limit_order_001",
  "timestamp": 1714311403031
}
  1. Market Order

A Market order is executed immediately at the best available current market price.

To place a Market order:

  • Set "type" to "LIMIT"
  • Set "priceType" to "MARKET"
  • Do not specify a "price" (it will be ignored if included)
  • Set other required parameters like "symbol", "side", "quantity", etc.
{
  "symbol": "ETHUSDT-PERPETUAL",
  "side": "SELL_OPEN",
  "type": "LIMIT",
  "quantity": 5000,
  "priceType": "MARKET",
  "timeInForce": "GTC",
  "clientOrderId": "market_order_001",
  "timestamp": 1714311503031
}

📘

Quick tip how to input your position type

BUY_OPEN: Initiating a long position by buying. This results in a long position

SELL_CLOSE: Closing a long position by selling. This reduces the long position

SELL_OPEN: Initiating a short position by selling. This results in a short position

BUY_CLOSE: Closing a short position by buying. This reduces the short position

You can get contracts' price, quantity precision configuration data in the brokerInfo endpoint.

Note: if your balance does not meet the margin requirement (which is the minimum margin requirement + open position fee + close position fee), "insufficient balance" error message will be returned.

For detailed information regarding various price types and _order types. Please refer to the explanation section in the end.


Request Parameters


PARAMETERTYPEReq'dExample valuesDESCRIPTION
symbolSTRINGYETHUSDT-PERPETUALName of contract
sideSTRINGYBUY_OPENDirection of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE.
typeSTRINGYLIMITThe order type, possible types: LIMIT, STOP.
quantityINTEGERY10000The number of contracts to buy, should be integer for example 10
priceFLOATRequired for (LIMIT & INPUT) orders3000Price of the order
priceTypeSTRINGINPUTThe price type, possible types include: INPUT and MARKET.
stopPriceFLOATRequired for STOP orders2800The price at which the trigger order will be executed.
timeInForceSTRINGGTCTime in force for LIMIT orders. Possible values include GTC,FOK,IOC,LIMIT_MAKER.
clientOrderIdSTRINGY99999999980000A unique ID of the order (user defined)
recvWindowLONG5000recv Window
timestampLONGY1714311403031Timestamp
stpModeENUMCEXPIRE_TAKERSelf Trade Prevention Mode.
Enum: EXPIRE_TAKER, EXPIRE_MAKER
Default EXPIRE_TAKER if not specified.

Response Content


type = LIMIT

TYPEPARAMETERExample valuesDESCRIPTION
timeLONG1714403283482Timestamp when the order is created
updateTimeLONG1714403283501Last time this order was updated
orderIdINTEGER1674930571497840128Order ID
clientOrderIdSTRING99999999980001A unique ID of the order.
symbolSTRINGETHUSDT-PERPETUALName of the contract.
priceFLOAT3000Price of the order.
leverageFLOAT5Leverage of the order.
origQtyFLOAT10000Quantity ordered
executedQtyFLOAT0Quantity of orders that has been executed
avgPriceFLOAT0Average price of filled orders.
marginLockedFLOAT6000Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position.
typeSTRINGLIMITThe order type, possible types: LIMIT, LIMIT_MAKER, MARKET_OF_BASE
sideSTRINGBUY_OPENThe price type. Possible values include INPUT and MARKET.
timeInForceSTRINGGTCDirection of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE.
statusSTRINGNEWThe state of the order.Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, PARTIALLY_CANCELED, and REJECTED.
priceTypeSTRINGINPUTTime in force. Possible values include GTC,FOK,IOC, and LIMIT_MAKER
contractMultiplierSTRING0.00100000Contract multiplier
stpModeENUMEXPIRE_TAKERSelf Trade Prevention Mode.
Enum: EXPIRE_TAKER, EXPIRE_MAKER
Default EXPIRE_TAKER if not specified.

type = STOP

TYPEPARAMETERExample valuesDESCRIPTION
timeLONG1714403283482Timestamp when order is created
updateTimeLONG1714403283501Last time this order was updated
orderIdINTEGER1674930571497840128Order ID
clientOrderIdSTRING99999999980001A unique ID of the order.
symbolSTRINGETHUSDT-PERPETUALName of the contract.
priceFLOAT3000Price of the order.
leverageFLOAT5Leverage of the order.
origQtyFLOAT10000Quantity ordered
typeSTRINGSTOPThe order type, possible types: STOP
sideSTRINGBUYDirection of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE.
statusSTRINGNEWThe state of the order.Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, PARTIALLY_CANCELED, and REJECTED.
stopPriceSTRING3000Average price of filled orders
stpModeENUMEXPIRE_TAKERSelf Trade Prevention Mode.
Enum: EXPIRE_TAKER, EXPIRE_MAKER
Default EXPIRE_TAKER if not specified.
Language
Credentials
Header
Click Try It! to start a request and see the response here!