Smart Orders
Create, modify, cancel, get and list Smart Orders using simple cURL recipes.
Smart Orders help you automate entries/exits with minimal code. Two types are supported today:
- GTT (Good Till Triggered): Triggers a single order when price crosses your trigger
- OCO (One Cancels the Other): Places target and stop-loss together; execution of one cancels the other
Note: The COMMODITY segment is not supported for Smart Orders. OCO orders for CASH segment are currently not supported.
Create GTT
POST https://api.groww.in/v1/order-advance/create
Create a GTT that arms a single order when your trigger condition is met.
Request
Body parameter
Request schema
| Name | Type | Description |
|---|---|---|
reference_id * | string | User-provided alphanumeric string (8-20 characters) that serves as an idempotency key, with at most two hyphens (-) allowed. |
smart_order_type * | string | Set to GTT to create a Good‑Till‑Triggered smart order. Example: GTT. |
segment * | string | Segment for which the order will be placed. See Segment. Examples: CASH, FNO. |
trading_symbol * | string | Trading Symbol of the instrument as defined by the exchange |
quantity * | integer | Quantity for the post‑trigger order. For FNO, must respect lot size. Examples: 10, 50. |
trigger_price * | string | Trigger price as a decimal string. Example: 3985.00. |
trigger_direction * | string | Direction to monitor relative to the trigger price. Examples: UP, DOWN. |
order.order_type * | string | Post‑trigger execution order type. See Order type. Examples: LIMIT, SL. |
| order.price | string | Post‑trigger limit price (required if order.order_type is LIMIT or SL). Example: 3990.00. |
order.transaction_type * | string | Post‑trigger transaction type. See Transaction type. Examples: BUY, SELL. |
| child_legs | object | Optional child legs for bracket orders (target/stop‑loss). |
product_type * | string | Product for the post‑trigger order. See Product type. Examples: CNC, MIS. |
exchange * | string | Exchange where the instrument is traded. See Exchange. Examples: NSE. |
duration * | string | Validity of the post‑trigger order. See Validity. Example: DAY. |
*required parameters
Response (201)
Schema reference: Smart Order Response (GTT).
Create OCO
POST https://api.groww.in/v1/order-advance/create
Create an OCO to protect or exit positions with target and stop-loss.
Request
Body parameter
Request schema
| Name | Type | Description |
|---|---|---|
reference_id * | string | User-provided alphanumeric string (8-20 characters) that serves as an idempotency key, with at most two hyphens (-) allowed. |
smart_order_type * | string | Set to OCO to create a One‑Cancels‑Other smart order (target + stop‑loss). Example: OCO. |
segment * | string | Segment for which the order will be placed. See Segment. Examples: FNO, CASH. |
trading_symbol * | string | Trading Symbol of the instrument as defined by the exchange |
quantity * | integer | Total quantity for both legs. Must be ≤ abs(net_position_quantity). Example: 50. |
net_position_quantity * | integer | Your current net position in this symbol. Used to derive leg directions and validate quantity. Example: 50. |
transaction_type * | string | Direction of protection/exit for your position. See Transaction type. Examples: BUY, SELL. |
target.trigger_price * | string | Take‑profit trigger price (decimal string). Example: 120.50. |
target.order_type * | string | Order type for the target leg. See Order type. Examples: LIMIT, MARKET. |
| target.price | string | Target leg limit price (required if target.order_type = LIMIT). Example: 121.00. |
stop_loss.trigger_price * | string | Stop‑loss trigger price (decimal string). Example: 95.00. |
stop_loss.order_type * | string | Order type for the stop‑loss leg. See Order type. Examples: SL, SL_M. |
| stop_loss.price | string | Stop‑loss leg limit price (required if stop_loss.order_type = SL). Example: 94.50. |
product_type * | string | Product for the OCO. See Product type. Note: For OCO in cash segment, only MIS is supported currently. |
exchange * | string | Exchange for this instrument. See Exchange. Example: NSE. |
duration * | string | Validity for both legs. See Validity. Example: DAY. |
*required parameters
Response (201)
Schema reference: Smart Order Response (OCO).
Notes
quantitymust be ≤abs(net_position_quantity).- If a leg executes, the other cancels automatically.
Modify Smart Order
PUT https://api.groww.in/v1/order-advance/modify/{smart_order_id}
Modify contracts differ by flow. Only the fields listed below are honoured; everything else is ignored or rejected. Use cancel + create when you need changes outside of these lists.
Modifiable Fields - GTT
quantity- Updated order quantitytrigger_price- Updated trigger price thresholdtrigger_direction- Updated directionorder.order_type- Updated order typeorder.price- Updated limit price (required forLIMIT/SLtypes; set tonullforMARKET/SL_M)child_legs- Updated bracket order legs (optional; all child leg fields are modifiable if provided)
Modifiable Fields - OCO
quantity- Updated order quantityduration- Updated validityproduct_type- Updated product (e.g., MIS ↔ NRML for FNO; CASH OCO only supports MIS)target.trigger_price- Updated profit target trigger pricestop_loss.trigger_price- Updated stop-loss trigger price
Request (GTT)
Body parameter (GTT)
Request schema (GTT)
| Name | Type | Description |
|---|---|---|
smart_order_type * | string | Set to GTT to modify a Good‑Till‑Triggered smart order. Example: GTT. |
segment * | string | Segment of the order (for routing). See Segment. Examples: CASH, FNO. |
| quantity | integer | Updated quantity. |
| trigger_price | string | Updated trigger price (decimal string). |
| trigger_direction | string | Updated trigger direction. Examples: UP, DOWN. |
| order.order_type | string | Updated order type. See Order type. |
| order.price | string | Updated limit price (required if order.order_type is LIMIT or SL). |
| order.transaction_type | string | Transaction type (required but not modifiable). See Transaction type. |
| child_legs | object | Updated child legs for bracket orders (target/stop‑loss). |
*required parameters
Request (OCO)
Body parameter (OCO)
Request schema (OCO)
| Name | Type | Description |
|---|---|---|
smart_order_type * | string | Set to OCO to modify a One‑Cancels‑Other smart order. Example: OCO. |
segment * | string | Segment of the order (for routing). See Segment. Examples: FNO, CASH. |
| duration | string | Updated validity. See Validity. Modifiable for OCO. |
| quantity | integer | Updated total quantity. |
| product_type | string | Updated product. See Product type. Modifiable for OCO. |
| target.trigger_price | string | Updated target trigger price (decimal string). |
| stop_loss.trigger_price | string | Updated stop‑loss trigger price (decimal string). |
*required parameters
Response (202)
Schema reference: Smart Order Response (GTT) or Smart Order Response (OCO).
Modify vs Cancel-Create
| What you need to change | GTT | OCO | Action |
|---|---|---|---|
| Quantity | ✅ Modify | ✅ Modify | Use modify |
| Trigger price | ✅ Modify | ✅ Modify (both legs) | Use modify |
| Trigger direction | ✅ Modify | N/A | Use modify |
| Order type | ✅ Modify | ❌ Not modifiable | GTT: modify; OCO: cancel+create |
| Limit price | ✅ Modify | ❌ Not modifiable | GTT: modify; OCO: cancel+create |
| Duration/validity | ❌ Not modifiable | ✅ Modify | OCO: modify; GTT: cancel+create |
| Product type | ❌ Not modifiable | ✅ Modify | OCO: modify; GTT: cancel+create |
| Symbol/contract | ❌ Not modifiable | ❌ Not modifiable | Cancel + create |
| Exchange | ❌ Not modifiable | ❌ Not modifiable | Cancel + create |
| Segment | ❌ Not modifiable | ❌ Not modifiable | Cancel + create |
| Smart order type (GTT ↔ OCO) | ❌ Not modifiable | ❌ Not modifiable | Cancel + create |
Note: When a field is marked as "Not modifiable" (❌), you must cancel the existing smart order and create a new one with the desired changes. The "N/A" designation indicates that the feature does not apply to that smart order type.
Cancel Smart Order
POST https://api.groww.in/v1/order-advance/cancel/{segment}/{smart_order_type}/{smart_order_id}
Cancel any active smart order.
Request
Request schema
| Name | Type | Description |
|---|---|---|
segment * | string | Segment of the smart order to cancel. See Segment. Examples: CASH, FNO. |
smart_order_type * | string | Smart order type. Examples: GTT, OCO. |
smart_order_id * | string | Smart order identifier. Example: gtt_91a7f4. |
*required parameters
Response (202)
Schema reference: Smart Order Response (GTT) or Smart Order Response (OCO).
Response Schema
| Name | Type | Description |
|---|---|---|
| status | string | SUCCESS if processed successfully, FAILURE otherwise |
| smart_order_id | string | Smart order identifier |
| smart_order_type | string | Smart order type. Examples: GTT, OCO. |
| status | string | CANCELLED on success |
Get Smart Order
GET https://api.groww.in/v1/order-advance/status/{segment}/{smart_order_type}/internal/{smart_order_id}
Request
Request schema
| Name | Type | Description |
|---|---|---|
segment * | string | Segment of the smart order to fetch. See Segment. Examples: CASH, FNO. |
smart_order_type * | string | Smart order type. Examples: GTT, OCO. |
smart_order_id * | string | Smart order identifier. Example: gtt_91a7f4. |
*required parameters
Response (200)
Schema reference: Smart Order Response (GTT) or Smart Order Response (OCO).
List Smart Orders
GET https://api.groww.in/v1/order-advance/list
Filter by type, segment, status and a time window. Pagination is supported.
Request
Request schema
| Name | Type | Description |
|---|---|---|
| segment | string | Segment to list smart orders for. See Segment. Examples: FNO, CASH. |
| smart_order_type | string | Smart order type to create/list. Examples: OCO, GTT. Default: OCO. |
| status | string | Current state filter (live vs past). Examples: ACTIVE, CANCELLED, COMPLETED. Default: ACTIVE. |
| page | integer | Page number starting from 0. Use with page_size to paginate long lists. Examples: 0, 1. Min: 0, Max: 500. Default: 0. |
| page_size | integer | Number of records per page. Tune this for your UI/export. Examples: 10, 25. Min: 1, Max: 50. Default: 10. |
| start_date_time | string | Inclusive start of the time window in ISO8601 (YYYY-MM-DDThh:mm:ss). Defaults to start of today (server timezone). Examples: 2025-01-16T09:15:00, 2025-01-16T00:00:00. |
| end_date_time | string | Inclusive end of the time window in ISO8601. Must not be before start_date_time. Defaults to start of next day (server timezone). Examples: 2025-01-16T15:30:00, 2025-01-16T23:59:59. |
Validations:
end_date_timemust not be beforestart_date_time.- Date range between
start_date_timeandend_date_timemust not exceed one month.
Response (200)
Response Schema
| Name | Type | Description |
|---|---|---|
| status | string | SUCCESS if processed successfully, FAILURE otherwise |
| orders | array | List of smart orders |
| orders[] | object | Smart order item (GTT or OCO). See Smart Order Response (GTT) or Smart Order Response (OCO) |
Quick Tips
- Use a unique
reference_idper new smart order to avoid accidental duplicates. - For symbol/segment/type changes: cancel the old smart order and create a new one.
- For OCO, ensure
quantity≤abs(net_position_quantity). The leg directions are derived from your net position.
Schemas
Smart Order Response (GTT)
| Name | Type | Description |
|---|---|---|
| status | string | SUCCESS if processed successfully, FAILURE otherwise |
| smart_order_id | string | Smart order identifier |
| smart_order_type | string | Smart order type. Example: GTT. |
| status | string | Smart order status (e.g., ACTIVE) |
| trading_symbol | string | Trading Symbol of the instrument as defined by the exchange |
| exchange | string | Stock exchange |
| quantity | integer | Quantity |
| product_type | string | Product type |
| duration | string | Validity |
| order.order_type | string | Order type. See Order type. Examples: LIMIT, SL. |
| order.price | string | Price for LIMIT/SL |
| order.transaction_type | string | See Transaction type. Examples: BUY, SELL. |
| ltp | number | Last traded price of the instrument |
| trigger_direction | string | Trigger direction. Examples: UP, DOWN. |
| trigger_price | string | Trigger price (decimal string) |
| segment | string | Market segment |
| remark | string | Remark or status message |
| display_name | string | Display name for the instrument |
| child_legs | object | Child legs for bracket orders (target/stop‑loss) |
| is_cancellation_allowed | boolean | Whether cancellation is allowed |
| is_modification_allowed | boolean | Whether modification is allowed |
| created_at | string | Creation time (ISO 8601) |
| expire_at | string | Expiry time (ISO 8601) |
| triggered_at | string | Trigger time (ISO 8601) |
| updated_at | string | Last updated time (ISO 8601) |
Smart Order Response (OCO)
| Name | Type | Description |
|---|---|---|
| status | string | SUCCESS if processed successfully, FAILURE otherwise |
| smart_order_id | string | Smart order identifier |
| smart_order_type | string | Smart order type. Example: OCO. |
| status | string | Smart order status (e.g., ACTIVE) |
| trading_symbol | string | Trading Symbol of the instrument as defined by the exchange |
| exchange | string | Stock exchange |
| quantity | integer | Quantity of the order to be placed |
| product_type | string | Product type |
| duration | string | Validity |
| target.trigger_price | string | Target trigger price (decimal string) |
| target.order_type | string | Order type. See Order type. Examples: LIMIT, MARKET. |
| target.price | string | Target limit price |
| stop_loss.trigger_price | string | Stop-loss trigger price (decimal string) |
| stop_loss.order_type | string | Order type. See Order type. Examples: SL, SL_M. |
| stop_loss.price | string | Stop-loss limit price |
| is_cancellation_allowed | boolean | Whether cancellation is allowed |
| is_modification_allowed | boolean | Whether modification is allowed |
| created_at | string | Creation time (ISO 8601) |
| expire_at | string | Expiry time (ISO 8601) |
| triggered_at | string | Trigger time (ISO 8601) |
| updated_at | string | Last updated time (ISO 8601) |