Modify Cover Order
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":"YG1234",
"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 |
String |
NSE , BSE , NFO , MCX |
exchange_order_id |
Number |
Order Id generated by the exchange |
instrument_token |
String |
Represents the unique id of instrument. |
client_id |
String |
Represents the unique id of user or username. |
order_type |
String |
LIMIT , MARKET , SL , SLM |
price |
Float |
the price at which order needs to be placed |
quantity |
Integer |
total quantity to buy |
disclosed_quantity |
Integer |
hidden quantity from the market. |
validity |
String |
DAY or IOC |
product |
String |
CNC , MIS , NRML |
oms_order_id |
String |
Represents the oms id of order. |
filled_quantity |
Integer |
Number of quantity which are traded. |
remaining_quantity |
Integer |
Number of quantity which are pending. |
last_activity_reference |
String |
Unique id of Last modification. |
stop_loss_value |
Float |
value at which Sl will get hit |
trailing_stop_loss |
String |
adjusts sell order accordingly to reduce losses. |
execution_type |
String |
CO |
Example
data = pocket.modifyConditionalOrder({
"exchange":"NSE",
"exchange_order_id":"1100000030285558",
"instrument_token":14366,
"client_id":"YG1234",
"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 |