pocketful logo light
pocketful logo light

Modify Bracket Order

The Modify Order API enables users to make changes in the bracket 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

{
  "client_id": "<client id>",
  "disclosed_quantity": 0,
  "exchange": "NSE",
  "exchange_order_id": "1100000007437522",
  "execution_type": "BO",
  "filled_quantity": 0,
  "instrument_token": 14366,
  "is_trailing":false,
  "last_activity_reference": "1394876196271146000",
  "oms_order_id": "20240314659",
  "order_type": "LIMIT",
  "price": 11.5,
  "quantity": 1,
  "product": "MIS",
  "remaining_quantity": 1,
  "square_off_value": 0.9,
  "stop_loss_value": 0.06,
  "trailing_stop_loss": 0,
  "trigger_price": 0,
  "validity": "DAY",
}

Body Params

FieldNameDatatypeDescription
exchangeStringNSEBSENFOMCX
instrument_tokenStringRepresents the unique id of instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMITSL
priceNumberthe price at which order needs to be placed
quantityNumbertotal quantity to buy
disclosed_quantityNumberhidden quantity from the market.
validityStringDAYIOC
productStringCNCMISNRML
user_order_idNumberRepresents the unique id of order.
filled_quantityNumberNumber of quantity which are traded.
remaining_quantityNumberNumber of quantity which are pending.
last_activity_referenceNumberUnique id of Last modification.
oms_order_idNumberRepresents the oms id of order.
exchange_order_idNumberOrder Id generated by the exchange
trigger_priceNumberprice at which target is set
stop_loss_valueNumbervalue at which Sl will get hit
square_off_valueNumbervalue at which position will get squared off.
trailing_stop_lossNumberadjusts sell order accordingly to reduce losses.
is_trailingBooleanTRUE or FALSE
execution_typeStringBO

Example Code

data=pocket.modifyConditionalOrder( {
  "client_id": "<client id>",
  "disclosed_quantity": 0,
  "exchange": "NSE",
  "exchange_order_id": "1100000007437522",
  "execution_type": "BO",
  "filled_quantity": 0,
  "instrument_token": 14366,
  "is_trailing":False,
  "last_activity_reference": "1394876196271146000",
  "oms_order_id": "20240314659",
  "order_type": "LIMIT",
  "price": 11.5,
  "quantity": 1,
  "product": "MIS",
  "remaining_quantity": 1,
  "square_off_value": 0.9,
  "stop_loss_value": 0.06,
  "trailing_stop_loss": 0,
  "trigger_price": 0,
  "validity": "DAY",
})

Response

{
    "data": {
        "basket_id": "",
        "message": "basket Order modified Successfully"
    },
    "message": "Order modified successfully",
    "status": "success"
}
ParameterDescription
basket_idIdentifier for the basket order
messageConfirmation message for the order
statusStatus of the order modification

Error Response

{
    "data": {},
    "error_code": 44000,
    "message": "`trigger_price` is invalid",
    "status": "error"
}