Skip to main content

Batch Place Order

tip

This endpoint allows you to place more than one order in a single request.

  • Make sure you have sufficient funds in your account when placing an order. Once an order is placed, according to the funds required by the order, the funds in your account will be frozen by the corresponding amount during the life cycle of the order.
  • A maximum of 20 orders (option), 10 orders (inverse), 10 orders (linear), 10 orders (spot) can be placed per request. The returned data list is divided into two lists. The first list indicates whether or not the order creation was successful and the second list details the created order information. The structure of the two lists are completely consistent.
info
  • Option rate limt instruction: its rate limit is count based on the actual number of request sent, e.g., by default, option trading rate limit is 10 reqs per sec, so you can send up to 20 * 10 = 200 orders in one second.
  • Perpetual, Futures, Spot rate limit instruction, please check here
  • Risk control limit notice:
    Bybit will monitor on your API requests. When the total number of orders of a single user (aggregated the number of orders across main account and sub-accounts) within a day (UTC 0 - UTC 24) exceeds a certain upper limit, the platform will reserve the right to remind, warn, and impose necessary restrictions. Customers who use API default to acceptance of these terms and have the obligation to cooperate with adjustments.

HTTP Request

POST /v5/order/create-batch

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0: linear, option, spot, inverse
  • UTA1.0: linear, option, spot
  • requesttruearrayObject
    > symboltruestringSymbol name, like BTCUSDT, uppercase only
    > isLeveragefalseintegerWhether to borrow. Valid for Unified spot only. 0(default): false then spot trading, 1: true then margin trading
    > sidetruestringBuy, Sell
    > orderTypetruestringMarket, Limit
    > qtytruestringOrder quantity
    • UTA account
      • Spot: set marketUnit for market order qty unit, quoteCoin for market buy by default, baseCoin for market sell by default
      • Perps, Futures & Option: always use base coin as unit
    • Perps & Futures: if you pass qty="0" and specify reduceOnly=true&closeOnTrigger=true, you can close the position up to maxMktOrderQty or maxOrderQty shown on Get Instruments Info of current symbol
    > marketUnitfalsestringThe unit for qty when create Spot market orders for UTA account, orderFilter=tpslOrder and StopOrder are supported as well.
  • baseCoin: for example, buy BTCUSDT, then "qty" unit is BTC
  • quoteCoin: for example, sell BTCUSDT, then "qty" unit is USDT
  • > pricefalsestringOrder price
    • Market order will ignore this field
    • Please check the min price and price precision from instrument info endpoint
    • If you have position, price needs to be better than liquidation price
    > 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
    Valid for linear
    > orderFilterfalsestringIf it is not passed, Order by default.
    • Order
    • tpslOrder: Spot TP/SL order, the assets are occupied even before the order is triggered
    • StopOrder: Spot conditional order, the assets will not be occupied until the price of the underlying asset reaches the trigger price, and the required assets will be occupied after the Conditional order is triggered
    Valid for spot only
    > triggerPricefalsestring
    • For Perps & Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure:
      triggerPrice > market price
      Else, triggerPrice < market price
    • For spot, it is the orderFilter=tpslOrder, or orderFilter=stopOrder trigger price
    > triggerByfalsestringConditional order param (Perps & Futures). Trigger price type. LastPrice, IndexPrice, MarkPrice
    > orderIvfalsestringImplied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed. orderIv has a higher priority when price is passed as well
    > timeInForcefalsestringTime in force
    • Market order will use IOC directly
    • If not passed, GTC is used by default
    > positionIdxfalseintegerUsed to identify positions in different position modes. Under hedge-mode, this param is required
    • 0: one-way mode
    • 1: hedge-mode Buy side
    • 2: hedge-mode Sell side
    > orderLinkIdfalsestringUser customised order ID. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
    Futures, Perps & Spot: orderLinkId rules:
    • optional param
    • always unique
    • option orderLinkId rules:
    • required param
    • always unique
    > takeProfitfalsestringTake profit price
    > stopLossfalsestringStop loss price
    > tpTriggerByfalsestringThe price type to trigger take profit. MarkPrice, IndexPrice, default: LastPrice.
    Valid for linear, inverse
    > slTriggerByfalsestringThe price type to trigger stop loss. MarkPrice, IndexPrice, default: LastPrice
    Valid for linear, inverse
    > reduceOnlyfalsebooleanWhat is a reduce-only order? true means your position can only reduce in size if this order is triggered.
    • You must specify it as true when you are about to close/reduce the position
    • When reduceOnly is true, take profit/stop loss cannot be set
    Valid for linear, inverse & option
    > 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.
    Valid for linear, inverse
    > smpTypefalsestringSmp execution type. What is SMP?
    > mmpfalsebooleanMarket maker protection. option only. true means set the order as a market maker protection order. What is mmp?
    > tpslModefalsestringTP/SL mode
    • Full: entire position for TP/SL. Then, tpOrderType or slOrderType must be Market
    • Partial: partial position tp/sl (as there is no size option, so it will create tp/sl orders with the qty you actually fill). Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is required and it must be Partial
    Valid for linear, inverse
    > tpLimitPricefalsestringThe limit order price when take profit price is triggered
    • linear&inverse: only works when tpslMode=Partial and tpOrderType=Limit
    • Spot(UTA): it is required when the order has takeProfit and tpOrderType=Limit
    > slLimitPricefalsestringThe limit order price when stop loss price is triggered
    • linear&inverse: only works when tpslMode=Partial and slOrderType=Limit
    • Spot(UTA): it is required when the order has stopLoss and slOrderType=Limit
    > tpOrderTypefalsestringThe order type when take profit is triggered
    • linear&inverse: Market(default), Limit. For tpslMode=Full, it only supports tpOrderType=Market
    • Spot(UTA):
      Market: when you set "takeProfit",
      Limit: when you set "takeProfit" and "tpLimitPrice"
    > slOrderTypefalsestringThe order type when stop loss is triggered
    • linear&inverse: Market(default), Limit. For tpslMode=Full, it only supports slOrderType=Market
    • Spot(UTA):
      Market: when you set "stopLoss",
      Limit: when you set "stopLoss" and "slLimitPrice"

    Response Parameters

    ParameterTypeComments
    resultObject
    > listarrayObject
    >> categorystringProduct type
    >> symbolstringSymbol name
    >> orderIdstringOrder ID
    >> orderLinkIdstringUser customised order ID
    >> createAtstringOrder created time (ms)
    retExtInfoObject
    > listarrayObject
    >> codenumberSuccess/error code
    >> msgstringSuccess/error message
    info

    The ack of create order request indicates that the request is successfully accepted. Please use websocket order stream to confirm the order status


    Request Example

    POST /v5/order/create-batch HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: XXXXX
    X-BAPI-TIMESTAMP: 1672222064519
    X-BAPI-RECV-WINDOW: 5000
    Content-Type: application/json

    {
    "category": "spot",
    "request": [
    {
    "symbol": "BTCUSDT",
    "side": "Buy",
    "orderType": "Limit",
    "isLeverage": 0,
    "qty": "0.05",
    "price": "30000",
    "timeInForce": "GTC",
    "orderLinkId": "spot-btc-03"
    },
    {
    "symbol": "ATOMUSDT",
    "side": "Sell",
    "orderType": "Limit",
    "isLeverage": 0,
    "qty": "2",
    "price": "12",
    "timeInForce": "GTC",
    "orderLinkId": "spot-atom-03"
    }
    ]
    }

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "list": [
    {
    "category": "spot",
    "symbol": "BTCUSDT",
    "orderId": "1666800494330512128",
    "orderLinkId": "spot-btc-03",
    "createAt": "1713434102752"
    },
    {
    "category": "spot",
    "symbol": "ATOMUSDT",
    "orderId": "1666800494330512129",
    "orderLinkId": "spot-atom-03",
    "createAt": "1713434102752"
    }
    ]
    },
    "retExtInfo": {
    "list": [
    {
    "code": 0,
    "msg": "OK"
    },
    {
    "code": 0,
    "msg": "OK"
    }
    ]
    },
    "time": 1713434102753
    }