Skip to main content

Modify Order Sandbox Enabled Deprecated

API to modify an open or pending order.To perform a modification, the orderId is a required field. Along with the orderId, you should include any optional parameters that require modification. If no optional parameters are included in the modification request, the default values will be assumed from the original order.

Request

curl --location --request PUT 'https://api-hft.upstox.com/v2/order/modify' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {your_access_token}' \
--data '{
"quantity": 2,
"validity": "DAY",
"price": 16.8,
"order_id": "240108010918222",
"order_type": "LIMIT",
"disclosed_quantity": 0,
"trigger_price": 16.9
}'

Additional samples in various languages are available in the Sample Code section on this page.

Request Body

NameRequiredTypeDescription
quantityfalseinteger (int32)Quantity with which the order was placed
validitytruestringOrder validity (DAY- Day and IOC- Immediate or Cancel (IOC) order).
Possible values: DAY, IOC.
pricetruenumber (float)Price at which the order was placed
order_idtruestringThe order ID for which the order must be modified. For the regex pattern applicable to this field, see the Field Pattern Appendix.
order_typetruestringType of order. It can be one of the following
MARKET refers to market order
LIMILT refers to Limit Order
SL refers to Stop Loss Limit
SL-M refers to Stop Loss Market.
Possible values: MARKET, LIMIT, SL, SL-M.
disclosed_quantityfalseinteger (int32)Indicates the volume to be displayed in the market depth. If provided, this value must be non-zero.
trigger_pricetruenumber (float)If the order is a stop loss order then the trigger price to be set is mentioned here
Responses

Response Body

{
"status": "success",
"data": {
"order_id": "1644490272000"
}
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectResponse data for modify order request
data.order_idstringOrder ID

Sample Code

Modify a delivery order

curl --location --request PUT 'https://api-hft.upstox.com/v2/order/modify' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {your_access_token}' \
--data '{
"quantity": 2,
"validity": "DAY",
"price": 16.8,
"order_id": "240108010918222",
"order_type": "LIMIT",
"disclosed_quantity": 0,
"trigger_price": 16.9
}'
Loading...