pocketful logo light
pocketful logo light

Place Bracket Order

A Bracket Order helps traders manage risk by placing a stop loss and a target order together with a regular order. The stop loss order protects against losses, while the target order aims for profitability in the trade.

Endpoint: /api/v1/orders/kart
Method-Type: POST

Request Packet

{
    "client_id": "clintId",
    "device": "WEB",
    "disclosed_quantity": 0,
    "exchange": "NSE",
    "execution_type": "BO",
    "instrument_token": "11915",
    "is_trailing": true,
    "order_side": "BUY",
    "order_type": "LIMIT",
    "price": 18.3,
    "product": "MIS",
    "quantity": 1,
    "square_off_value": 1,
    "stop_loss_value": 1,
    "trailing_stop_loss": "0.05",
    "trigger_price": 0,
    "user_order_id": 10002,
    "validity": "DAY"
}

Body Params

FieldNameDatatypeDescription
exchangeStringNSEBSENFOMCX
instrument_tokenStringRepresents the unique id of instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMITSL
priceFloatthe price at which order needs to be placed
quantityIntegertotal quantity to buy
disclosed_quantityIntegerhidden quantity from the market.
validityStringDAYIOC
productStringCNCMISNRML
order_sideStringBUY or SELL
deviceStringWeb or Mobile
user_order_idIntegerRepresents the unique id of order.
trigger_priceFloatprice at which target is set
stop_loss_valueFloatvalue at which Sl will get hit
square_off_valueFloatvalue at which position will get squared off.
trailing_stop_lossFloatadjusts sell order accordingly to reduce losses.
is_trailingBooleanTRUE or FALSE
execution_typeStringBO

Example

data=pocket.placeConditionalOrder({
    "client_id": clintId,
    "device": "WEB",
    "disclosed_quantity": 0,
    "exchange": "NSE",
    "execution_type": "BO",
    "instrument_token": "11915",
    "is_trailing": True,
    "order_side": "BUY",
    "order_type": "LIMIT",
    "price": 18.3,
    "product": "MIS",
    "quantity": 1,
    "square_off_value": 1,
    "stop_loss_value": 1,
    "trailing_stop_loss": "0.05",
    "trigger_price": 0,
    "user_order_id": 10002,
    "validity": "DAY"
})

Response

{
    "data":{
        "data":{
            "basket_id": "202403132873",
            "message": "basket Order Placed Successfully"
        }
    },
    "message": "Order place 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": "`product` is invalid",
   "status": "error"
 }