Skip to main content

Batch Amend Order

tip

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

  • You can modify unfilled or partially filled orders. Conditional orders are not supported.
  • A maximum of 20 orders (option), 10 orders (inverse), 10 orders (linear), 10 orders (spot) can be amended per request.

HTTP Request

POST /v5/order/amend-batch

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0: linear, option, spot, inverse
  • UTA1.0: linear, option, spot
  • requesttruearrayObject
    > symboltruestringSymbol name, like BTCUSDT, uppercase only
    > orderIdfalsestringOrder ID. Either orderId or orderLinkId is required
    > orderLinkIdfalsestringUser customised order ID. Either orderId or orderLinkId is required
    > orderIvfalsestringImplied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed
    > 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 for tpslOrder or stopOrder trigger price
    > qtyfalsestringOrder quantity after modification. Do not pass it if not modify the qty
    > pricefalsestringOrder price after modification. Do not pass it if not modify the price
    > 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
    > takeProfitfalsestringTake profit price after modification. If pass "0", it means cancel the existing take profit of the order. Do not pass it if you do not want to modify the take profit
    > stopLossfalsestringStop loss price after modification. If pass "0", it means cancel the existing stop loss of the order. Do not pass it if you do not want to modify the stop loss
    > tpTriggerByfalsestringThe price type to trigger take profit. When set a take profit, this param is required if no initial value for the order
    > slTriggerByfalsestringThe price type to trigger stop loss. When set a take profit, this param is required if no initial value for the order
    > triggerByfalsestringTrigger price type
    > tpLimitPricefalsestringLimit order price when take profit is triggered. Only working when original order sets partial limit tp/sl
    > slLimitPricefalsestringLimit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl

    Response Parameters

    ParameterTypeComments
    resultObject
    > listarrayObject
    >> categorystringProduct type
    >> symbolstringSymbol name
    >> orderIdstringOrder ID
    >> orderLinkIdstringUser customised order ID
    retExtInfoObject
    > listarrayObject
    >> codenumberSuccess/error code
    >> msgstringSuccess/error message
    info

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


    Request Example

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

    {
    "category": "option",
    "request": [
    {
    "symbol": "ETH-30DEC22-500-C",
    "qty": null,
    "price": null,
    "orderIv": "6.8",
    "orderId": "b551f227-7059-4fb5-a6a6-699c04dbd2f2"
    },
    {
    "symbol": "ETH-30DEC22-700-C",
    "qty": null,
    "price": "650",
    "orderIv": null,
    "orderId": "fa6a595f-1a57-483f-b9d3-30e9c8235a52"
    }
    ]
    }

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "list": [
    {
    "category": "option",
    "symbol": "ETH-30DEC22-500-C",
    "orderId": "b551f227-7059-4fb5-a6a6-699c04dbd2f2",
    "orderLinkId": ""
    },
    {
    "category": "option",
    "symbol": "ETH-30DEC22-700-C",
    "orderId": "fa6a595f-1a57-483f-b9d3-30e9c8235a52",
    "orderLinkId": ""
    }
    ]
    },
    "retExtInfo": {
    "list": [
    {
    "code": 0,
    "msg": "OK"
    },
    {
    "code": 0,
    "msg": "OK"
    }
    ]
    },
    "time": 1672222808060
    }