Skip to Content

GTT Single Order

This API allows you to place a single GTT (Good Till Trigger) order that stays active until its trigger price is hit or you cancel it.

USE CASE

Set a target or stop-loss on a holding or position, or queue a new order that is sent only when your trigger price is reached.

Details

  • This type is used to create a single GTT order.
  • It supports placing orders for CNC, Margin, and MTF.
  • It can be applied either as a Target or Stop Loss for your existing holdings/positions.
  • Alternatively, it can be used to create a GTT order for a new position/holding.
  • It supports Limit and Market order types through orderInfo.leg1.type. For Market orders, the order is sent at the market price once the trigger price is hit, so the executed price can differ from the trigger price.
  • Market orders are not allowed for BFO symbols. Such requests are rejected with code -50.
  • A GTT order stays active for up to one year, until its trigger is hit or you cancel it.
  • A single GTT uses leg1 only. leg2 is used only for OCO orders, which have their own GTT OCO Order page.
  • type in leg1 sets the order type: 1 for Limit (the default) and 2 for Market. For a Market order, send price as 0 or leave it out.
  • Response code 1101 means the order was placed. Code 201 means it is in transit, so confirm it in the GTT Order Book.
  • Keep the returned id. You need it to modify or cancel the order while it is still pending.
  • orderTag is optional. FYERS adds 1:GTT at the start of your tag. Without a tag the order gets 2:GTTUntagged.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes

AttributeData TypeDescription
SideintIndicates the side of the order: 1 for buy, -1 for sell.
symbol*stringThe instrument's unique identifier, e.g., "NSE:CHOLAFIN-EQ"
productType*stringThe product type for the order. Valid values: "CNC", "MARGIN", "MTF".
orderInfo*objectContains information about the GTT order leg.
orderInfo.leg1*objectDetails for the GTT order leg.
orderInfo.leg1.price*floatPrice at which the order should be placed. Required for Limit. For Market, send 0 or leave it out.
orderInfo.leg1.triggerPricefloatTrigger price for the GTT order.
orderInfo.leg1.qty*intQuantity for the GTT order leg.
orderInfo.leg1.typeint
  • Order type for this leg:
  • 1: Limit (default if not provided).
  • 2: Market.
orderTagstring
  • ordertag provided when placing the order
  • Note: 1:GTT will be concatenated at the start of tag provided by user.
  • Default value if tag not provided when order is placed is 2:GTTUntagged

Response Attributes

AttributeData TypeDescription
codeint
  • Status code indicating the outcome of the request:
  • 1101: Order placed successfully.
  • 201: Order is in transit. Confirm details using the Orderbook API.
  • Other codes represent specific error conditions.
message*stringDescriptive message about the request status, e.g., "Successfully placed order".
s*stringRequest status indicator: "ok" for success, "error" for failure.
id*stringUnique identifier for the placed order, returned when the order is successfully processed.
Last updated on