The Modify Order API enables users to make changes in both open or pending orders within the order book. To execute a modification, users must provide the oms_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
Method-Type: PUT
Header Name Value Description x-authorization-token <your_access_token>Valid JWT token for authentication x-device-type WEBThe device type (e.g., WEB, ANDROID, IOS) Content-Type application/jsonFormat of the request body
Request Packet
{
"exchange": "NSE",
"instrument_token": "11915",
"client_id": "clientId",
"order_type": "LIMIT",
"price": 13,
"quantity": 3,
"disclosed_quantity": 0,
"validity": "DAY",
"product": "CNC",
"order_side": "BUY",
"device": "WEB",
"user_order_id": 1,
"trigger_price": 0,
"oms_order_id":"202403111778",
"execution_type": "REGULAR"
}
Body Params
FieldName Datatype Description exchange StringName of the exchange where the order is being placed. Possible values include NSE, BSE, NFO, MCX instrument_token StringThe unique ID of the financial instrument. client_id StringRepresents the unique id of user. order_type StringLIMIT, SLprice FloatIf order_type is market, give value 0 else limit price quantity IntegerTotal quantity of the instrument. disclosed_quantity Integerhidden quantity from the market validity StringDAY or IOCproduct StringCNC, MIS, NRMLoms_order_id IntegerRepresents the unique id of order given by oms. trigger_price Integerspecified activation threshold, required in SL or SLM orders execution_type StringREGULAR
Example cURL Request
curl --location --request PUT 'https://algo.pocketful.in/api/v1/orders' \
--header 'Content-Type: application/json' \
--header 'x-authorization-token: <your_access_token>' \
--header 'x-device-type: WEB' \
--data '{
"exchange": "NSE",
"instrument_token": "11915",
"client_id": "clientId",
"order_type": "LIMIT",
"price": 13,
"quantity": 3,
"disclosed_quantity": 0,
"validity": "DAY",
"product": "CNC",
"order_side": "BUY",
"device": "WEB",
"user_order_id": 1,
"trigger_price": 0,
"oms_order_id": "202403111778",
"execution_type": "REGULAR"
}'
Response
{
"data":{
"oms_order_id": "202403111778"
},
"message": "Order modification request submitted",
"status": "success"
}
Key Description oms_order_id The ID assigned to the order in the Order Management System. message A message indicating the result of the order placement. status The status of the operation (success/failure).
Error Response
{
"data":{
},
"error_code": 45010,
"message": "Something went wrong",
"status": "error"
}