pocketful logo light
pocketful logo light

Modify AMO Order

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

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

Body Params

FieldNameDatatypeDescription
exchangeStringName of the exchange where the order is being placed. Possible values include NSEBSENFOMCX
instrument_tokenStringThe unique ID of the financial instrument.
client_idStringRepresents the unique id of user.
order_typeStringLIMITSL
priceFloatIf order_type is market, give value 0 else limit price
quantityIntegerTotal quantity of the instrument.
disclosed_quantityIntegerhidden quantity from the market
validityStringDAY or IOC
productStringCNCMISNRML
oms_order_idIntegerRepresents the unique id of order given by oms.
trigger_priceIntegerspecified activation threshold, required in SL orders
execution_typeStringAMO

Example Code

data=pocket.modifyOrder({
    "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": "AMO"
    })

Response

{
    "data":{
        "oms_order_id": "202403111778"
    },
    "message": "Order modification request submitted",
    "status": "success"
}
KeyDescription
oms_order_idThe ID assigned to the order in the Order Management System.
messageA message indicating the result of the order placement.
statusThe status of the operation (success/failure).

Error Response

{
    "data":{
    },
    "error_code": 45010,
    "message": "Something went wrong",
    "status": "error"
}