Skip to main content

Replace Order

caution

You could modify those unfilled or partially filled orders.

HTTP Request

POST /unified/v3/private/order/replace

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type. linear, option
symboltruestringSymbol name
orderIdfalsestringOrder id. Either orderId or orderLinkId is required
orderLinkIdfalsestringUser customised order id. Either orderId or orderLinkId is required
orderFilterfalsestringOrder: active order, StopOrder: conditional order
orderIvfalsestringImplied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed
triggerPricefalsestringIf you expect the price to rise to trigger your conditional order, make sure:
triggerPrice > max(market price, basePrice) Else,
triggerPrice < min(market price, basePrice)
qtyfalsestringOrder quantity after modification. Don't pass it if not modify the qty
pricefalsestringOrder price after modification. Don't pass it if not modify the price
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

Response Parameters

ParameterTypeComments
orderIdstringOrder ID
orderLinkIdstringUser customised order id

Request Example

curl --location --request POST 'https://api-testnet.bybit.com/unified/v3/private/order/replace' \
--header 'X-BAPI-SIGN-TYPE: 2' \
--header 'X-BAPI-SIGN: XXXXX' \
--header 'X-BAPI-API-KEY: {api key}' \
--header 'X-BAPI-TIMESTAMP: 1657871228347' \
--header 'X-BAPI-RECV-WINDOW: 5000' \
--header 'Content-Type: application/json' \
--data-raw '{
"category": "linear",
"symbol":"BTCUSDT",
"orderId":"1a1ae001-2034-4a6b-8b25-45aa9100b1ec",
"price":"35000"
}'

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "1a1ae001-2034-4a6b-8b25-45aa9100b1ec",
"orderLinkId": "e80d558e-ed"
}
}