Skip to main content

Replace Order

note

You could modify those unfilled or partially filled orders.

HTTP Request

POST /contract/v3/private/order/replace

Request Parameters

ParameterRequiredTypeComments
symboltruestringSymbol name
orderIdfalsestringOrder id. Either orderId or orderLinkId is required
orderLinkIdfalsestringUser customised order id. Either orderId or orderLinkId is required
pricefalsestringOrder price after modification. Don't pass it if not modify the price
qtyfalsestringOrder quantity after modification. Don't pass it if not modify the qty
triggerPricefalsestringTrigger price. Don't pass it if not modify the qty
takeProfitfalsestringTake profit price after modification. Don't pass it if not modify the take profit
stopLossfalsestringStop loss price after modification. Don't pass it if not 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 stop loss, this param is required if no initial value for the order
triggerByfalsestringTrigger price type. LastPrice, IndexPrice, MarkPrice, LastPrice
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
orderIdstringOrder ID
orderLinkIdstringUser customised order id

Request Example

POST /contract/v3/private/order/replace HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1670554903846
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"symbol": "XRPUSDT",
"orderId": "5ba57394-0ff0-4cb8-8000-59085d2c3aba",
"orderLinkId": null,
"price": "14.5"
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "5ba57394-0ff0-4cb8-8000-59085d2c3aba",
"orderLinkId": ""
},
"retExtInfo": {},
"time": 1670554904609
}