pocketful logo light
pocketful logo light

Create GTT Order

Create GTT Rule

This API is used to place the gtt order. Good Till Triggered is active until the trigger condition is met. The trigger is valid for the given expiry date. Whenever the price condition within this period is met, the order will be placed and executed, provided there are enough funds in the trading account, and the limit price order is filled on the exchange.

Endpoint: api/v1/event/gtt
Method-Type: POST

Request Packet

{
"action_type": "single_order",
"expiry_time": "2024-12-12",
"order":{
"client_id": "<client id>",
"disclosed_quantity": 0,
"exchange": "NSE",
"instrument_token": "14366",
"market_protection_percentage": 0,
"order_side": "BUY",
"order_type": "LIMIT",
"price": 11.3,
"product": "CNC",
"quantity": 1,
"sl_order_price": 0,
"sl_order_quantity": 0,
"sl_trigger_price": 0,
"trigger_price": 13.6,
"user_order_id": 122321
    }
}

Body Params

Field NameData TypeDescription
action_typeStringType of action single_order
expiry_timeStringRepresents a particular date of expiry
client_idStringRepresents the unique ID of a user.
deviceStringDevice type: WebMobile.
disclosed_quantityIntegerquantity hidden from market
exchangeStringExchange: NSEBSENFOMCX
instrument_tokenStringRepresents the unique ID of an instrument.
market_protection_percentageStringsets limit on the price deviation
order_sideStringSide of the order
BUY or SELL
order_typeStringType of order LIMITSL
priceFloatthe price at which order needs to be placed
productStringProduct type: CNCMISNRML
quantityIntegerQuantity of the order.
sl_order_priceFloatStop-loss order price.
sl_order_quantityIntegerStop-loss order quantity.
sl_trigger_priceFloatStop-loss trigger price.
trigger_priceFloatTrigger price.
user_order_idIntegerRepresents the unique ID of the order.

Example Code

data = pocket.gttCreateRule(
{
"action_type": "single_order",
"expiry_time": "2024-12-12",
"order":{
"client_id": "<client id>",
"disclosed_quantity": 0,
"exchange": "NSE",
"instrument_token": "14366",
"market_protection_percentage": 0,
"order_side": "BUY",
"order_type": "LIMIT",
"price": 11.3,
"product": "CNC",
"quantity": 1,
"sl_order_price": 0,
"sl_order_quantity": 0,
"sl_trigger_price": 0,
"trigger_price": 13.6,
"user_order_id": 122321
    }
})

Response

{
    "data":
     {
        "id": "ea036a20-2073-4bfb-a852-34662c4bd770"
        },
        "message": "GTT created 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": "`order` `product` is invalid",
    "status": "error"
}