Skip to main content

Place Order

tip
  • Market order: A traditional market order, which will be filled at the current optimal price. Only when the market order selected, the price could be null. To protect the market order from serious slippage, Bybit will convert the market order into a limit order with the buy order price higher than the optimal selling price, and the sell order price lower than the optimal buying price. Both the limit price and the executed price can be queried through the user's transaction history interface.

  • Limit order: You can set an executed price for your order. When the market price touches the price you set, the system will fill the order for you.

  • Take profit / Stop loss: You can set TP/SL while placing orders. Besides, you could modify the position's TP/SL.

  • Order quantity: The quantity of perpetual contracts you are going to buy/sell. For the order quantity, Bybit only supports positive number at present.

  • Order price: Place a limit order, this parameter is required. If you don't have position, the long order price should be higher than 10% of the market price and lower than 1 million. If you have position, the price should be higher than the liquidation price. For the minimum unit of the price change, please refer to the priceFilter field in the instrumentInfo.

  • orderLinkId: You can customize the active order ID. We can link this ID to the order ID in the system. Once the active order is successfully created, we will send the unique order ID in the system to you. Then, you can use this order ID to cancel active orders. Meanwhile, your customized order ID should be no longer than 36 characters and should be unique.

  • Each account can hold a maximum of 500 active orders simultaneously. This is contract-specific, so the following situation is allowed: The same account can hold 300 BTCUSD active orders and 280 ETHUSD active orders at the same time. When the upper limit of orders is reached, you can still place orders with parameters of reduceOnly or closeOnTrigger.

HTTP Request

POST /contract/v3/private/order/create

Request Parameters

ParameterRequiredTypeComments
symboltruestringSymbol name
sidetruestringBuy,Sell
orderTypetruestringMarket, Limit
qtytruestringOrder quantity
timeInForcetruestringRead more about Time in force.
pricefalsestringOrder price. Invalid if orderType=Market
triggerDirectionfalseintegerConditional order param. Used to identify the expected direction of the conditional order.
  • 1: triggered when market price rises to triggerPrice
  • 2: triggered when market price falls to triggerPrice
triggerPricefalsestringConditional order param. If you expect the price to rise to trigger your conditional order, make sure:
triggerPrice > market price
Else, triggerPrice < market price
triggerByfalsestringTrigger price type. default:LastPrice.
positionIdxfalseintegerPosition index. It is required for hedge position mode
orderLinkIdfalsestringUser customised order id. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
rule of future:
  • optional param
  • The same orderLinkId can be used for both USDC PERP and USDT PERP.
  • An orderLinkId can be reused once the original order is either Filled or Cancelled
  • rule of option:
  • This param is required
  • always unique
takeProfitfalsestringTake profit price
stopLossfalsestringStop loss price
tpTriggerByfalsestringThe price type to trigger take profit. default:LastPrice
slTriggerByfalsestringThe price type to trigger stop loss. default:LastPrice
reduceOnlyfalsebooleanWhat is a reduce-only order? true means your position can only reduce in size if this order is triggered. When reduce_only is true, take profit/stop loss cannot be set
smpTypefalsestringSmp execution type. What is SMP?
closeOnTriggerfalsebooleanWhat is a close on trigger order? For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin.
tpslModefalsestringTP/SL mode
  • Full: entire position for TP/SL. Then, tpOrderType or slOrderType must be Market
  • Partial: partial position tp/sl. Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is required and it must be Partial
tpLimitPricefalsestringThe limit order price when take profit price is triggered. Only works when tpslMode=Partial and tpOrderType=Limit
slLimitPricefalsestringThe limit order price when stop loss price is triggered. Only works when tpslMode=Partial and slOrderType=Limit
tpOrderTypefalsestringThe order type when take profit is triggered. Market(default), Limit. For tpslMode=Full, it only supports tpOrderType=Market
slOrderTypefalsestringThe order type when stop loss is triggered. Market(default), Limit. For tpslMode=Full, it only supports slOrderType=Market

Response Parameters

ParameterTypeComments
orderIdstringOrder ID
orderLinkIdstringUser customised order id

Request Example

POST /contract/v3/private/order/create HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1670487164902
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json; charset=utf-8
{
"symbol": "BTCUSDT",
"side": "Buy",
"orderType": "Limit",
"qty": "0.05",
"price": "18500",
"timeInForce": "GoodTillCancel",
"positionIdx": null,
"triggerDirection": 1,
"triggerPrice": "19000"
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "0cf62262-7dc2-4503-9566-8835c841509b",
"orderLinkId": ""
},
"retExtInfo": {},
"time": 1670486764551
}