Replace Order
caution
You could modify those unfilled or partially filled orders.
HTTP Request
POST /unified/v3/private/order/replace
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| category | true | string | Product type. linear, option |
| symbol | true | string | Symbol name |
| orderId | false | string | Order id. Either orderId or orderLinkId is required |
| orderLinkId | false | string | User customised order id. Either orderId or orderLinkId is required |
| orderFilter | false | string | Order: active order, StopOrder: conditional order |
| orderIv | false | string | Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed |
| triggerPrice | false | string | If you expect the price to rise to trigger your conditional order, make sure: triggerPrice > max(market price, basePrice) Else, triggerPrice < min(market price, basePrice) |
| qty | false | string | Order quantity after modification. Don't pass it if not modify the qty |
| price | false | string | Order price after modification. Don't pass it if not modify the price |
| takeProfit | false | string | Take profit price after modification. Don't pass it if not modify the take profit |
| stopLoss | false | string | Stop loss price after modification. Don't pass it if not modify the Stop loss |
| tpTriggerBy | false | string | The price type to trigger take profit. When set a take profit, this param is required if no initial value for the order |
| slTriggerBy | false | string | The price type to trigger stop loss. When set a stop loss, this param is required if no initial value for the order |
| triggerBy | false | string | Trigger price type |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| orderId | string | Order ID |
| orderLinkId | string | User 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"
}
}