Replace Order
note
You could modify those unfilled or partially filled orders.
HTTP Request
POST /contract/v3/private/order/replace
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
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 |
price | false | string | Order price after modification. Don't pass it if not modify the price |
qty | false | string | Order quantity after modification. Don't pass it if not modify the qty |
triggerPrice | false | string | Trigger price. Don't pass it if not modify the qty |
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. LastPrice , IndexPrice , MarkPrice , LastPrice |
tpLimitPrice | false | string | Limit order price when take profit is triggered. Only working when original order sets partial limit tp/sl |
slLimitPrice | false | string | Limit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl |
Response Parameters
Parameter | Type | Comments |
---|---|---|
orderId | string | Order ID |
orderLinkId | string | User 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
}