The Modify Order API enables users to make changes in the cover order, pending within the order book. To execute a modification, users must provide the oms_order_id, last_activity_reference and exchange_order_id which can be obtained from the order book. User can modify parameters like price, quantity, order type, and validity. This API facilitates efficient management of orders by allowing users to tailor their orders to meet changing market conditions or trading strategies seamlessly.
Endpoint: /api/v1/orders/kart
Method-Type: PUT
Request Packet
{
"exchange":"NSE",
"exchange_order_id":"1100000030285558",
"instrument_token":14366,
"client_id":"<client id>",
"order_type":"LIMIT",
"price":12.45,
"quantity":2,
"disclosed_quantity":0,
"validity":"DAY",
"product":"CNC",
"oms_order_id":"202403132133",
"filled_quantity":0,
"remaining_quantity":1,
"last_activity_reference":"1394797204460943183",
"stop_loss_value":12.35,
"trailing_stop_loss":0,
"execution_type":"CO"
}
Body Params
FieldName Datatype Description exchange StringNSE, BSE, NFO, MCXexchange_order_id NumberOrder Id generated by the exchange instrument_token StringRepresents the unique id of instrument. client_id StringRepresents the unique id of user or username. order_type StringLIMIT, SLprice Floatthe price at which order needs to be placed quantity Integertotal quantity to buy disclosed_quantity Integerhidden quantity from the market. validity StringDAY or IOCproduct StringCNC, MIS, NRMLoms_order_id StringRepresents the oms id of order. filled_quantity IntegerNumber of quantity which are traded. remaining_quantity IntegerNumber of quantity which are pending. last_activity_reference StringUnique id of Last modification. stop_loss_value Floatvalue at which Sl will get hit trailing_stop_loss Stringadjusts sell order accordingly to reduce losses. execution_type StringCO
Example
data = pocket.modifyConditionalOrder({
"exchange":"NSE",
"exchange_order_id":"1100000030285558",
"instrument_token":14366,
"client_id":"<client id>",
"order_type":"LIMIT",
"price":12.45,
"quantity":2,
"disclosed_quantity":0,
"validity":"DAY",
"product":"CNC",
"oms_order_id":"202403132133",
"filled_quantity":0,
"remaining_quantity":1,
"last_activity_reference":"1394797204460943183",
"stop_loss_value":12.35,
"trailing_stop_loss":0,
"execution_type":"CO"
})
Response
{
"data": {
"basket_id": "20210531-23",
"message": "basket Order modified Successfully"
},
"message": "Order modified successfully",
"status": "success"
}
Parameter Description basket_id Identifier for the basket order message Confirmation message for the order status Status of the order modification
Error Response
{
"data": {},
"error_code": 44000,
"message": "`square_off_value` is invalid",
"status": "error"
}
Error Code Description 44000 In case of any of the parameter like Exchange, order_type, product being invalid or order price is out of DPR range. 45000 In case of Invalid oms_order_id, price, last_activity_reference, exchange_order_id or Quantity. 45010 Something Went Wrong message occurs if you have given wrong instrument token