pocketful logo light
pocketful logo light

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":"<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

FieldNameDatatypeDescription
exchangeStringNSE, BSE, NFO, MCX
exchange_order_idNumberOrder Id generated by the exchange
instrument_tokenStringRepresents the unique id of instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMIT, SL
priceFloatthe price at which order needs to be placed
quantityIntegertotal quantity to buy
disclosed_quantityIntegerhidden quantity from the market.
validityStringDAY or IOC
productStringCNC, MIS, NRML
oms_order_idStringRepresents the oms id of order.
filled_quantityIntegerNumber of quantity which are traded.
remaining_quantityIntegerNumber of quantity which are pending.
last_activity_referenceStringUnique id of Last modification.
stop_loss_valueFloatvalue at which Sl will get hit
trailing_stop_lossStringadjusts sell order accordingly to reduce losses.
execution_typeStringCO

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"
}
ParameterDescription
basket_idIdentifier for the basket order
messageConfirmation message for the order
statusStatus of the order modification

Error Response

{
    "data": {},
    "error_code": 44000,
    "message": "`square_off_value` is invalid",
    "status": "error"
}
Error CodeDescription
44000In case of any of the parameter like Exchange, order_type, product being invalid or order price is out of DPR range.
45000In case of Invalid oms_order_id, price, last_activity_reference, exchange_order_id or Quantity.
45010Something Went Wrong message occurs if you have given wrong instrument token