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:
- 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
}
- 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
PARAMETER | TYPE | Req'd | Example values | DESCRIPTION |
---|---|---|---|---|
symbol | STRING | Y | ETHUSDT-PERPETUAL | Name of contract |
side | STRING | Y | BUY_OPEN | Direction of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE. |
type | STRING | Y | LIMIT | The order type, possible types: LIMIT, STOP. |
quantity | INTEGER | Y | 10000 | The number of contracts to buy, should be integer for example 10 |
price | FLOAT | Required for (LIMIT & INPUT) orders | 3000 | Price of the order |
priceType | STRING | INPUT | The price type, possible types include: INPUT and MARKET. | |
stopPrice | FLOAT | Required for STOP orders | 2800 | The price at which the trigger order will be executed. |
timeInForce | STRING | GTC | Time in force for LIMIT orders. Possible values include GTC,FOK,IOC,LIMIT_MAKER. | |
clientOrderId | STRING | Y | 99999999980000 | A unique ID of the order (user defined) |
recvWindow | LONG | 5000 | recv Window | |
timestamp | LONG | Y | 1714311403031 | Timestamp |
stpMode | ENUM | C | EXPIRE_TAKER | Self Trade Prevention Mode. Enum: EXPIRE_TAKER, EXPIRE_MAKER Default EXPIRE_TAKER if not specified. |
Response Content
type = LIMIT
TYPE | PARAMETER | Example values | DESCRIPTION |
---|---|---|---|
time | LONG | 1714403283482 | Timestamp when the order is created |
updateTime | LONG | 1714403283501 | Last time this order was updated |
orderId | INTEGER | 1674930571497840128 | Order ID |
clientOrderId | STRING | 99999999980001 | A unique ID of the order. |
symbol | STRING | ETHUSDT-PERPETUAL | Name of the contract. |
price | FLOAT | 3000 | Price of the order. |
leverage | FLOAT | 5 | Leverage of the order. |
origQty | FLOAT | 10000 | Quantity ordered |
executedQty | FLOAT | 0 | Quantity of orders that has been executed |
avgPrice | FLOAT | 0 | Average price of filled orders. |
marginLocked | FLOAT | 6000 | Amount of margin locked for this order. This includes the actually margin needed plus fees to open and close the position. |
type | STRING | LIMIT | The order type, possible types: LIMIT, LIMIT_MAKER, MARKET_OF_BASE |
side | STRING | BUY_OPEN | The price type. Possible values include INPUT and MARKET. |
timeInForce | STRING | GTC | Direction of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE. |
status | STRING | NEW | The state of the order.Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, PARTIALLY_CANCELED, and REJECTED. |
priceType | STRING | INPUT | Time in force. Possible values include GTC,FOK,IOC, and LIMIT_MAKER |
contractMultiplier | STRING | 0.00100000 | Contract multiplier |
stpMode | ENUM | EXPIRE_TAKER | Self Trade Prevention Mode. Enum: EXPIRE_TAKER, EXPIRE_MAKER Default EXPIRE_TAKER if not specified. |
type = STOP
TYPE | PARAMETER | Example values | DESCRIPTION |
---|---|---|---|
time | LONG | 1714403283482 | Timestamp when order is created |
updateTime | LONG | 1714403283501 | Last time this order was updated |
orderId | INTEGER | 1674930571497840128 | Order ID |
clientOrderId | STRING | 99999999980001 | A unique ID of the order. |
symbol | STRING | ETHUSDT-PERPETUAL | Name of the contract. |
price | FLOAT | 3000 | Price of the order. |
leverage | FLOAT | 5 | Leverage of the order. |
origQty | FLOAT | 10000 | Quantity ordered |
type | STRING | STOP | The order type, possible types: STOP |
side | STRING | BUY | Direction of the order. Possible values include BUY_OPEN, SELL_OPEN, BUY_CLOSE, and SELL_CLOSE. |
status | STRING | NEW | The state of the order.Possible values include NEW, PARTIALLY_FILLED, FILLED, CANCELED, PARTIALLY_CANCELED, and REJECTED. |
stopPrice | STRING | 3000 | Average price of filled orders |
stpMode | ENUM | EXPIRE_TAKER | Self Trade Prevention Mode. Enum: EXPIRE_TAKER, EXPIRE_MAKER Default EXPIRE_TAKER if not specified. |