Skip to content

Smart Order APIs (GTT)

This section outlines the APIs for placing, modifying, and canceling multi-leg "Good Till Triggered" (GTT) orders, which include simultaneous stop-loss and target legs, as well as Trigger orders.

Supported Segments

Smart Orders (GTT) and Trigger Orders are supported for Equity, Derivative and Commodity (MCX) instruments.


How Smart Orders Work

When you place a smart order via /smart/order, the system creates two linked orders:

  1. Parent Order — The primary order (MARKET, LIMIT, or TRIGGER) that gets sent to the exchange first (except if the entered limit price is outside the circuit bounds, then parent order is placed as a GTT order instead).
  2. Child Order — A GTT (Good Till Triggered) order containing the stop-loss and/or target legs. It is linked to the parent and only activates once the parent order is successfully executed.

Order ID Prefixes

Each order ID carries a prefix that indicates its type:

Prefix Meaning Used For
EQ- Equity order Parent orders in the EQUITY segment
DRV- Derivative order Parent orders in the DERIVATIVE segment
COM- Commodity order Parent orders in the COMMODITY segment
GTT- Good Till Triggered Child orders (always), and parent orders when the limit price falls outside the circuit range
  • A parent order normally receives an EQ-, DRV- or COM- prefix depending on the segment.
  • If the entered limit price is outside the circuit bounds, the parent order is placed as a GTT order instead and receives a GTT- prefix. This does not apply to COMMODITY: an out-of-range commodity limit is rejected (see Commodity (MCX) Smart Orders).
  • Child orders always carry a GTT- prefix.

Placement Response

The API response returns both order IDs in a single payload:

JSON
{
  "status": "success",
  "data": {
    "order_data": [
      {
        "order_id": "DRV-28131451",
        "order_status": "CREATED",
        "child_order_details": {
          "order_id": "GTT-2914581",
          "order_status": "CREATED"
        }
      }
    ]
  }
}

Looking up the link later

When a child leg is created after the placement response, as for sliced smart orders, the response has no child_order_details. Read the link from Get Order Details or Get Order Book: a parent order carries child_order_id, and a child leg carries parent_order_id.

Modification and Cancellation

Parent and child orders are independent entities. To modify or cancel a smart order, you must operate on each order separately using its own order_id:

  • Use /smart/order/modify with the parent order_id (e.g. DRV-28131451) to modify the parent.
  • Use /smart/order/modify with the child order_id (e.g. GTT-2914581) to modify the child.
  • The same applies to /smart/order/cancel — each order must be cancelled individually.

Child Order Lifecycle

The child order will not activate until the parent order is successfully executed. If the parent order is cancelled, rejected, or fails, the linked child order remains inactive.


Request Type Path Description
POST /smart/order Place a new multi-leg smart order
POST /smart/order/modify Modify a pending smart order
POST /smart/order/cancel Cancel a pending smart order

Place Smart Order

This API allows you to place a new multi-leg smart order (GTT).

Endpoint

Text Only
POST /smart/order

Request Body

Parameter Type Mandatory Description
txn_type string ✅ The transaction type. Enum: "BUY", "SELL"
exchange string ✅ The exchange to place the order on. Enum: "NSE", "MCX" (MCX only with segment: "COMMODITY")
segment string ✅ The market segment. Enum: "EQUITY", "DERIVATIVE", "COMMODITY"
product string ✅ The product type. For Equity: "CNC", "INTRADAY". For Derivative: "MARGIN", "INTRADAY". For Commodity: "MARGIN", "INTRADAY"
order_type string ✅ The type of order. Enum: "LIMIT", "MARKET", "TRIGGER". Note: MARKET orders are converted to LIMIT orders before they reach the exchange (see note below).
validity string ✅ The order validity. Enum: "DAY"
security_id string ✅ The unique identifier for the instrument.
qty integer ✅ The quantity of the instrument to trade. For DERIVATIVE and COMMODITY this is in units, not lots, and must be a whole multiple of the contract lot size.
algo_id string ❌ Algo identifier for the smart order. Optional. Defaults to "99999" for NSE and MCX, "9999999999999999" for BSE.
limit_price number ❌ The price for the main LIMIT order. Required if order_type is "LIMIT". Leave it out for MARKET orders (see note below); a COMMODITY MARKET order that carries it is rejected. Not allowed on "TRIGGER" orders — a TRIGGER order that carries limit_price is rejected (see the warning below).
trigger_price number ❌ The trigger price for the order. Required if order_type is "TRIGGER". Must be a multiple of the instrument's tick size. For BUY: must be strictly greater than CMP. For SELL: must be strictly less than CMP.
trigger_limit_price number ❌ Optional limit price for a trigger-limit order. If provided alongside trigger_price, the order executes as trigger-limit; otherwise it executes as trigger-market. If omitted, trigger_limit_price is automatically set equal to trigger_price. Must be a multiple of the instrument's tick size.
sl_trigger_price number ❌ The trigger price for the stop-loss leg. Must sit below the entry price on a BUY, above it on a SELL. If set, sl_limit_price must also be provided or the order is rejected.
tgt_trigger_price number ❌ The trigger price for the target (profit) leg. Must sit above the entry price on a BUY, below it on a SELL. If set, tgt_limit_price must also be provided or the order is rejected.
sl_limit_price number ❌ The limit price for the stop-loss order once triggered. Required when sl_trigger_price is set.
tgt_limit_price number ❌ The limit price for the target order once triggered. Required when tgt_trigger_price is set.
is_tsl boolean ❌ Currently ignored — TSL is not live. Intended: set to true to make the stop-loss leg a trailing stop-loss. Requires a stop-loss leg and tsl_step_size. Not supported when order_type is "TRIGGER". See Trailing Stop Loss.
tsl_step_size number ❌ Currently ignored — TSL is not live. Intended: the trailing step, in rupees. Must be greater than zero and a multiple of the instrument's tick size. Required when is_tsl is true, and must be omitted (or zero) when is_tsl is false.
remarks string ❌ Your own free-text tag for the order — a strategy name, a signal id, anything you want to reconcile against later. Carried onto every leg, including the live order created when a stop-loss or target leg triggers. Max 100 characters, silently truncated beyond that; cannot be changed on modify. See Order Remarks.
slice_order boolean ❌ DERIVATIVE and COMMODITY only; rejected on EQUITY. Set true to let a qty that exceeds one exchange order be split into several independent orders. Has no effect when qty fits in one order. Default false. See Slicing Large Orders.

Example Request — LIMIT order (Derivative)

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "DERIVATIVE",
  "product": "MARGIN",
  "order_type": "LIMIT",
  "validity": "DAY",
  "security_id": "51011",
  "qty": 75,
  "limit_price": 37,
  "sl_trigger_price": 34,
  "tgt_trigger_price": 41,
  "sl_limit_price": 33,
  "tgt_limit_price": 38,
  "algo_id": "99999",
  "remarks": "momentum-v2/sig-4471"
}'

Example Request — Trigger-Market order (Equity)

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "EQUITY",
  "product": "CNC",
  "order_type": "TRIGGER",
  "validity": "DAY",
  "security_id": "3045",
  "qty": 10,
  "trigger_price": 1520.00,
  "algo_id": "99999"
}'

Example Request — Trigger-Limit order (Derivative)

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "DERIVATIVE",
  "product": "MARGIN",
  "order_type": "TRIGGER",
  "validity": "DAY",
  "security_id": "51011",
  "qty": 75,
  "trigger_price": 38.50,
  "trigger_limit_price": 38.75,
  "algo_id": "99999"
}'

Example Request — Trigger order with stop-loss and target legs (Derivative)

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "DERIVATIVE",
  "product": "MARGIN",
  "order_type": "TRIGGER",
  "validity": "DAY",
  "security_id": "46997",
  "qty": 65,
  "trigger_price": 318.75,
  "trigger_limit_price": 319,
  "sl_trigger_price": 316.65,
  "sl_limit_price": 316.40,
  "tgt_trigger_price": 328.65,
  "tgt_limit_price": 328.90,
  "algo_id": "99999"
}'

Here the legs are checked against an entry price of 319 — the trigger_limit_price — rather than limit_price, which plays no part in a TRIGGER order's execution.

Validations

  • QtyMustBeAboveZero: Qty must be specified and greater than zero
  • LimitPriceMustBeAboveZero: Limit price must be specified and greater than zero (applies to LIMIT orders)
  • QtyAboveFreezeRequiresSlicing: a DERIVATIVE or COMMODITY qty above the freeze quantity is rejected unless slice_order is true (see Slicing Large Orders)
  • MaxValueOfOption: Max Value of option allowed is enforced
  • QtyMultipleOfLotSize: Qty should be multiple of lot size
  • MaxSlTriggerPrice / MinSlTriggerPrice: the stop-loss trigger must sit below the entry price on a BUY, above it on a SELL
  • MaxSlLimitPrice / MinSlLimitPrice: the stop-loss limit must sit below the stop-loss trigger on a BUY, above it on a SELL
  • MinTgtTriggerPrice / MaxTgtTriggerPrice: the target trigger must sit above the entry price on a BUY, below it on a SELL
  • MinTgtLimitPrice / MaxTgtLimitPrice: the target limit must sit above the target trigger on a BUY, below it on a SELL
  • TriggerPriceMustBeAboveZero: trigger_price must be present and greater than zero when order_type is "TRIGGER"
  • TriggerPriceTickSize: trigger_price must be a multiple of the instrument's tick size
  • TriggerLimitPriceTickSize: trigger_limit_price (if provided) must be a multiple of the instrument's tick size
  • TriggerPriceVsCMP (BUY): trigger_price must be strictly greater than the current market price
  • TriggerPriceVsCMP (SELL): trigger_price must be strictly less than the current market price
  • The five Tsl* rules below are not currently enforced — TSL is not live and both fields are ignored. See Trailing Stop Loss.
  • TslStepSizeRequiredWhenEnabled: tsl_step_size must be specified and greater than zero when is_tsl is true
  • TslFlagRequiredWithStepSize: is_tsl must be true when tsl_step_size is provided
  • TslRequiresStopLoss: a trailing stop loss requires a stop-loss leg (sl_trigger_price and sl_limit_price)
  • TslNotAllowedForTriggerOrder: a trailing stop loss is not supported for order_type: "TRIGGER"
  • TslStepSizeMultipleOfTickSize: tsl_step_size must be a multiple of the instrument's tick size
  • ReservedRemarks: remarks must not use a value reserved for INDstocks' internal channel tags (see Order Remarks)

Market Orders Are Converted to Limit Orders

API trading does not send pure MARKET orders to the exchange. If you submit order_type: "MARKET", the order is converted to a LIMIT order before it is sent: at the live price for EQUITY, and at the live price plus (BUY) or minus (SELL) a protection band for DERIVATIVE or a protection buffer for COMMODITY. The exact rules are under Market Orders Are Converted to Limit Orders on the Orders page.

Similarly, for TRIGGER orders, if trigger_limit_price is omitted it is automatically set equal to trigger_price, so the order executes as a trigger-limit order at the trigger price.

Stop-Loss and Target Legs Require a Limit Price

If you provide sl_trigger_price, you must also provide sl_limit_price. Likewise, if you provide tgt_trigger_price, you must also provide tgt_limit_price. Submitting a stop-loss or target leg without its corresponding limit price will cause the order to be rejected.

Where the Stop-Loss and Target Legs Must Sit

Both legs are validated against the parent order's entry price, which depends on order_type:

order_type Entry price
LIMIT limit_price
MARKET the live market price
TRIGGER trigger_limit_price, or trigger_price when that is omitted

On a BUY the stop-loss must sit below the entry price and the target above it. On a SELL it is the mirror image — stop-loss above, target below. A leg on the wrong side is rejected.

Do Not Send limit_price on a TRIGGER Order

A trigger order's entry price comes from trigger_limit_price (or trigger_price); limit_price plays no part in it.

Sending limit_price on a TRIGGER order is rejected with 400 and Limit Price is not allowed for TRIGGER order type; use Trigger Limit Price instead. Omit the field, and put the entry limit in trigger_limit_price.


Commodity (MCX) Smart Orders

/smart/order accepts segment: "COMMODITY" with exchange: "MCX". The fields and the placement response are the same as for any smart order; slicing works as described under Slicing Large Orders.

The commodity-specific rules — the price and leg constraints, the COM-/GTT- id combinations, and modify/cancel behaviour — are collected in Commodity (MCX) Trading.


Slicing Large Orders

A single exchange order is capped at the instrument's freeze quantity — and on COMMODITY, also at ₹3.5 crore of order value. Place Smart Order refuses a larger qty:

Text Only
Qty exceeds freeze quantity of 3511; set slice_order=true to enable slicing

Set slice_order: true and the same request is split server-side into several independent orders, each within every applicable cap, with the stop-loss and target legs attached to every slice.

DERIVATIVE and COMMODITY only

On an EQUITY request the flag is rejected with Order slicing is available for segments DERIVATIVE and COMMODITY only. This is checked before the price rules.

slice_order is an opt-in, not a mode switch. With qty inside the caps the flag has no effect: the request is placed as an ordinary smart order and answers synchronously with order_status: "CREATED".

Example Request

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "DERIVATIVE",
  "product": "MARGIN",
  "order_type": "LIMIT",
  "validity": "DAY",
  "security_id": "48704",
  "qty": 7020,
  "limit_price": 22500,
  "sl_trigger_price": 22000,
  "sl_limit_price": 21950,
  "tgt_trigger_price": 23000,
  "tgt_limit_price": 22950,
  "slice_order": true,
  "algo_id": "99999",
  "remarks": "momentum-v2/sig-4471"
}'

Every other field behaves exactly as on Place Smart Order. limit_price, the stop-loss and target legs, and remarks are applied to every slice.

How the quantity is split

The slice size is the largest number of whole lots that fits every applicable cap. Each slice except the last is exactly that size; the last takes the remainder.

Segment Caps on a single slice
DERIVATIVE The instrument's freeze quantity.
COMMODITY The freeze quantity and ₹3.5 crore of order value (qty × price × general factor) — whichever binds first.

Both inputs are published in the instruments master — LOT_UNITS is the lot size, FREEZE_QTY the freeze quantity — so you can work the slice count out before you send:

Text Only
slice size = floor(FREEZE_QTY / LOT_UNITS) × LOT_UNITS
slices     = ceil(qty / slice size)
Instrument LOT_UNITS FREEZE_QTY Slice size qty Slices
NIFTY-Oct2026-FUT 65 3511 3510 3510 3510
NIFTY-Oct2026-FUT 65 3511 3510 7020 3510, 3510
NIFTY-Oct2026-FUT 65 3511 3510 3900 3510, 390

Exchange freeze quantities are rarely whole multiples of the lot size — across the F&O master, 94% sit exactly one unit above a lot boundary — so the slice size rounds down to the nearest lot. Because the total must itself be a lot multiple, the remainder always is one too.

On COMMODITY the value cap usually binds first and the slice is then smaller than the freeze quantity alone would allow. For a silver contract with a lot size of 30 quoted at ₹220,000, one slice is 5 lots — floor(3,50,00,000 ÷ (220000 × 30)) — not the 20 lots the freeze quantity would permit.

Maximum 10 slices per request

If the total qty would need more than 10 slices the request is rejected before anything is created: Qty requires 12 slices for this instrument; a maximum of 10 slices is allowed per request. This lines up with the exchange's 10 orders-per-second threshold for API clients. Reduce qty, or send it as more than one request.

Response

Each slice is a fully independent order. It has its own order_id, its own row in the order book, and its own stop-loss/target leg. It is modified or cancelled on its own through /smart/order/modify and /smart/order/cancel, parent and leg separately, exactly like any other smart order.

order_data holds one entry per slice, in slice order.

Response Payload (Success)

JSON
{
  "status": "success",
  "data": {
    "order_data": [
      { "order_id": "DRV-28131451", "order_status": "INITIATED" },
      { "order_id": "DRV-28131452", "order_status": "INITIATED" }
    ]
  }
}

Field Type Description
order_id string Same format as an unsliced smart order (DRV- prefix, or GTT- when the limit price is outside the circuit range). Use it to modify, cancel or look up this specific slice.
order_status string Always INITIATED for a sliced request. See the note below.
child_order_id string The GTT- stop-loss/target leg of this slice. Present only when the leg already exists at response time, which is the case when the slice itself is placed as a GTT- order. Otherwise see the note on legs below.
child_order_details object order_id and order_status of that leg. Present under the same condition as child_order_id.

There is no bulk_order_id in a sliced response. Reconcile the request through your own remarks tag, which is carried onto every slice.

The response confirms acceptance, not execution

The slices are created and accepted synchronously, then sent to the exchange by a background processor a moment later. So every entry comes back INITIATED, the state of a created-but-not-yet-sent order. The response cannot tell you whether a slice went on to fill, or was rejected for margin or by RMS.

Get the real outcome from Get Order Book, Get Order Details, or the Order Updates WebSocket, which pushes each slice's status as it changes. Do not treat INITIATED in this response as a fill.

Stop-loss and target legs are created with the slice, not with the response

For a DRV- slice the stop-loss/target leg is created when the background processor sends that slice, so the response carries no child_order_id or child_order_details for it. Read the link back from Get Order Details or Get Order Book: the slice carries child_order_id once the leg exists, and the leg carries parent_order_id. Poll until it appears.

One slice failing does not affect the others

Slices are placed independently. If one is rejected because margin runs out partway through, RMS blocks it, or a rate limit trips, the rest are still placed. That slice ends up FAILED on the order book with its reason, while its siblings proceed normally. The HTTP response is 200 either way, because it only reports that the request was accepted.

Outside market hours

A sliced request placed while the derivative market is closed is accepted and queued for release at the next open, the same as an unsliced smart order.

Validations

Every Place Smart Order validation applies, checked on the total qty before anything is created, so a failed validation means nothing was placed — not a partial set of slices. Exceeding the freeze quantity is the expected input here, so that check alone is lifted.

Each of these returns 400 with error_type: "RequestValidationException" and the message shown.

Message Cause
Order slicing is available for segments DERIVATIVE and COMMODITY only slice_order was true on an EQUITY request. Checked before the price rules.
Qty exceeds freeze quantity of 3511; set slice_order=true to enable slicing qty exceeds the freeze quantity and slice_order was not set.
Qty requires 12 slices for this instrument; a maximum of 10 slices is allowed per request The total qty needs more than 10 slices.
Qty should be multiple of 65 Applies to the total qty. A total that is not a lot multiple is rejected rather than rounded.
Order slicing is unavailable for 565899: lot size or freeze qty is not available The instrument has no usable lot size or freeze quantity.
Limit Price is outside circuit limits or execution band range. Allowed range: 212384.00 - 230082.00 The limit price is outside the contract's permitted range.

Rate limits

The request itself counts once against the /smart/order request limit. Each slice is a real order, so when the background processor sends it, it counts against the per-second order placement cap exactly as a standalone order would. A request that produces 10 slices sends 10 orders.

Those units are spent when the slices are sent, not when the call returns, so the spend lands a moment after your request completes. If you are already close to the cap, a slice can be rate-limited and end up FAILED on the order book while its siblings go through. Pace your own submissions accordingly; firing several sliced requests back-to-back multiplies the order count, not just the request count.


Trailing Stop Loss (TSL)

Trailing Stop Loss Is Not Yet Available

is_tsl and tsl_step_size are not live. They are accepted and then silently ignored — the request succeeds and your order is placed with an ordinary, non-trailing stop-loss. You will not receive an error.

Do not rely on trailing behaviour until this notice is removed. The rest of this section describes the intended behaviour once the feature ships.

A trailing stop loss is a stop-loss leg whose trigger price follows the market in your favour. As the price moves favourably, the stop-loss trigger is stepped along behind it by tsl_step_size; when the price moves against you, the trigger stays where it is. It only ever ratchets one way, which is what locks in gains.

TSL is not a separate order type — it is a modifier on the stop-loss leg of a smart order. You enable it with two fields:

Field Meaning
is_tsl true turns the stop-loss leg into a trailing stop-loss
tsl_step_size How far, in rupees, the trigger trails behind the price

Example Request — Trailing stop loss (Equity)

Bash
curl --location 'https://api.indstocks.com/smart/order' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "txn_type": "BUY",
  "exchange": "NSE",
  "segment": "EQUITY",
  "product": "CNC",
  "order_type": "LIMIT",
  "validity": "DAY",
  "security_id": "2885",
  "qty": 1,
  "limit_price": 1400.05,
  "sl_trigger_price": 1375.00,
  "sl_limit_price": 1374.50,
  "is_tsl": true,
  "tsl_step_size": 0.05,
  "algo_id": "99999"
}'

In this example the stop-loss starts at ₹1375.00. If the price climbs, the trigger is trailed upward in ₹0.05 steps; if the price falls back, the trigger holds at the highest level it reached.

Requirements

  • A stop-loss leg is mandatory: send both sl_trigger_price and sl_limit_price. TSL rides on the stop-loss leg, so a request with is_tsl: true and no stop-loss is rejected.
  • is_tsl and tsl_step_size must agree — is_tsl: true requires tsl_step_size > 0, and sending a tsl_step_size without is_tsl: true is rejected.
  • tsl_step_size must be a multiple of the instrument's tick size.
  • Not supported for order_type: "TRIGGER". A trigger order can carry an ordinary stop-loss leg, but that leg cannot trail.
  • Supported on /smart/order only. is_tsl sent to the plain /order endpoint is ignored.

The Trail Starts Only After the Parent Order Executes

Like every child leg (see Child Order Lifecycle), the trailing stop-loss becomes active only once the parent order is successfully executed. Until the parent fills, the stop-loss is recorded against the order but is not yet trailing. If the parent is cancelled or rejected, the trail never starts.

Reading the trailed price

On /order and /order-book, a trailing stop-loss order carries two extra fields:

Field Type Description
is_tsl boolean true when the order has an active trailing stop-loss
tsl_step_size number The trailing step in rupees

For a TSL order, sl_trigger_price reflects the live trailed trigger — the current, stepped-up value — not the price you originally submitted. sl_limit_price moves with it, preserving your original trigger-to-limit gap.

Changing a trailing stop loss

The Step Size Is Fixed Once the Order Is Placed

tsl_step_size cannot be changed, and TSL cannot be switched off, through /smart/order/modify — those fields are not accepted on modify. To use a different step size, cancel the order and place a new one.

You can still modify the other attributes of a trailing order (for example sl_trigger_price, sl_limit_price, or qty) in the normal way. Simply omit the TSL fields and the trail is preserved.


Modify Smart Order

This API allows you to modify a pending smart order.

Endpoint

Text Only
POST https://api.indstocks.com/smart/order/modify

Request Body

Parameter Type Mandatory Description
order_id string ✅ The unique ID of the order to be modified
segment string ✅ The market segment. Enum: "EQUITY", "DERIVATIVE", "COMMODITY"
algo_id string ✅ Algo identifier. "99999" for NSE and MCX, "9999999999999999" for BSE.
order_type string ❌ Not read. The order type is worked out from the prices you send — see Order Type Mismatch below.
qty integer ❌ The quantity of the instrument to trade
limit_price number ❌ The price for the main LIMIT order (applies to LIMIT orders only)
trigger_price number ❌ The trigger price for the order. Required when modifying a TRIGGER order. Must be a multiple of tick size. For BUY: must be strictly greater than CMP. For SELL: must be strictly less than CMP.
trigger_limit_price number ❌ Optional limit price for a trigger-limit order. Must be a multiple of tick size.
sl_trigger_price number ❌ The trigger price for the stop-loss leg
tgt_trigger_price number ❌ The trigger price for the target (profit) leg
sl_limit_price number ❌ The limit price for the stop-loss order
tgt_limit_price number ❌ The limit price for the target order

remarks cannot be changed

This endpoint does not accept remarks. The order keeps the remark it was placed with. See Order Remarks.

Example Request — Modify LIMIT order

Bash
curl --location 'https://api.indstocks.com/smart/order/modify' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--data '{
  "order_id": "DRV-123",
  "segment": "DERIVATIVE",
  "algo_id": "99999",
  "qty": 20,
  "limit_price": 0.35
}'

Example Request — Modify a stop-loss and target leg (OCO)

Bash
curl --location 'https://api.indstocks.com/smart/order/modify' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--data '{
  "order_id": "GTT-2914581",
  "segment": "DERIVATIVE",
  "algo_id": "99999",
  "sl_trigger_price": 0.15,
  "sl_limit_price": 0.1,
  "tgt_trigger_price": 41,
  "tgt_limit_price": 42
}'

Example Request — Modify Trigger order

Bash
curl --location 'https://api.indstocks.com/smart/order/modify' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--data '{
  "order_id": "GTT-456",
  "segment": "EQUITY",
  "algo_id": "99999",
  "qty": 10,
  "trigger_price": 1530.00,
  "trigger_limit_price": 1532.00
}'

Order Type Mismatch

On a GTT- order or a DRV- order, the prices you send decide the order type of the request, and it must match the type of the existing order. No price at all is a MARKET; limit_price alone is a LIMIT; sl_trigger_price alone is a stop-loss; tgt_trigger_price alone is a target; sl_trigger_price with tgt_trigger_price is an OCO (stop-loss and target); trigger_price alone is a TRIGGER. The order_type field is not read.

A mismatch is rejected with Order Type requested is not eligible for modification, Eligible OrderType is <type>. For example, to modify an OCO leg pair, send both sl_trigger_price and tgt_trigger_price, even if only one of them changes. On an EQ- or COM- order only qty and limit_price are read.

Trailing Stop Loss on Modify

is_tsl and tsl_step_size are not accepted on modify. Modifying any other field of a trailing order leaves the trail running with its original step size — see Changing a trailing stop loss.


Cancel Smart Order

This API allows you to cancel a pending smart order.

Endpoint

Text Only
POST /smart/order/cancel

Request Body

Parameter Type Mandatory Description
order_id string ✅ The unique ID of the order to be cancelled.
segment string ✅ The market segment. Enum: "EQUITY", "DERIVATIVE", "COMMODITY"

Example Request

Bash
curl --location 'https://api.indstocks.com/smart/order/cancel' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--data '{
  "segment": "DERIVATIVE",
  "order_id": "DRV-123456789"
}'

Validations

  • OrderIdMissing: Order ID is missing or invalid
  • OrderCannotBeCancelled: Order is not eligible for cancellation

See Also