Skip to Content

Smart Limit Order

This API allows you to place a limit order that stays active until an end time you choose on the same trading day.

USE CASE

Place a limit order that is cancelled or converted to a market order automatically if it is not filled by your chosen time.

Note

Supported product types are CNC, MARGIN, MTF and INTRADAY. High-price range (HPR) and low-price range (LPR) apply to NSE and BSE symbols.

  • Supports order placement under CNC, MARGIN, MTF, and INTRADAY.
  • You can define a price range (HPR/LPR) to restrict execution within your specified limits.
  • Supports only selected NSE and BSE symbols.

Details

  • Smart Limit Orders allow you to place limit orders that remain active until the specified end time. Once the end time is reached, the order can be converted to an MPP order or cancelled.
  • endTime is a Unix timestamp. It must be in the future, within market hours and before midnight of the current day.
  • onExp sets what happens at endTime: 1 cancels the order and 2 turns it into a market order.
  • orderType is 1 (Limit) or 4 (Stop-Limit). A Stop-Limit order needs stopPrice: lower than limitPrice for buy, higher for sell.
  • hpr and lpr default to 0, meaning no limit. For a buy, hpr must not be below limitPrice. For a sell, lpr must not be above it.
  • qty must be 1 to 999999, a multiple of the lot size and within the freeze limit. limitPrice must be at least 0.01. mpp must be 0 to 3 or -1.
  • MTF needs MTF to be enabled and a symbol and exchange that support it. For F&O and currency derivatives only near expiries and strikes close to LTP are allowed.
  • Smart orders can be created only on trading days (not special trading days), from 8:00 AM and within regular trading hours. The limit is 100 smart orders per day.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes

AttributeData TypeRequiredDescription
symbolstringYesThe instrument's unique identifier, e.g., "NSE:SBIN-EQ"
sideintYesOrder side: 1 for Buy, -1 for Sell (enum: 1, -1)
qtyintYesOrder quantity (Min: 1, Max: 999999; must be a multiple of lot size)
productTypestringYesMust be one of: "CNC", "MARGIN", "INTRADAY", "MTF"
limitPricefloatYesThe price at which the order should be placed (Min: 0.01)
endTimeintYesOrder expiry time as a Unix timestamp (epoch)
orderTypeintYesOrder type: 1 for Limit, 4 for Stop-Limit (enum: 1, 4)
onExpintYesAction on expiry: 1 = Cancel, 2 = Market (enum: 1, 2)
stopPricefloatNoDefault: 0. Required when orderType is 4 (Stop-Limit)
hprfloatNoDefault: 0. 0 = no upper price limit. If provided, order executes only below this price
lprfloatNoDefault: 0. 0 = no lower price limit. If provided, order executes only above this price
mppfloatNoDefault: 0. 0 = no market protection. Valid values: 0–3 or -1 (disabled)

Validations & Error Handling

AttributeValidation RuleError Message
symbolMust be a valid trading symbol"The symbol entered is invalid."
symbolMust be allowed for smart orders"The selected symbol is not allowed for placing smart orders. Please try again with a different symbol."
symbolMust be allowed for this segment"The smart order not allowed for this segment"
sideMust be 1 or -1 (enum)"The input details entered is invalid."
qtyMin: 1, Max: 999999, must be multiple of lot size"Quantity should be multiple of min lot size."
qtyMust not exceed freeze limit"Quantity exceeds the allowable freeze limit."
productTypeMust be one of: CNC, MARGIN, INTRADAY, MTF"productType must be one of the following: CNC, MARGIN, INTRADAY, MTF"
productTypeMTF requires MTF activation"MTF is not enabled. Please use a different productType"
limitPriceMin: 0.01"The input details entered is invalid."
orderTypeMust be 1 or 4 (enum)"orderType must be one of the following: 1, 4"
onExpMust be 1 or 2 (enum)"onExp must be one of the following: 1, 2"
endTimeMust not be 0"EndTime is required and cannot be 0."
endTimeMust be within market hours"End time cannot fall within market closed hours."
endTimeMust not be in the past"The end time entered is earlier than the current time."
endTimeMust be within current day"The end time cannot extend beyond midnight of the current day."
hpr (buy)Min: 0, if provided (>0), must be >= limitPrice"The maximum price must be higher than the limit price."
lpr (sell)Min: 0, if provided (>0), must be <= limitPrice"The minimum price must be lower than the limit price."
stopPrice (buy)Min: 0, if orderType=4, must be < limitPrice"For buy orders, the stop price must be lower than the limit price."
stopPrice (sell)Min: 0, if orderType=4, must be > limitPrice"For sell orders, the stop price must be higher than the limit price."
mppIf provided (>0), must be 0-3 or -1"MPP must be either -1 or a value between 0 to 3% (0 to 3)."
flowtypeMust be a valid smart order type"The smart order specified in the URL path is not recognized."
UserMust not be banned for smart orders"You are banned for smart order. Please contact support"
Trading dayMust not be market-closed day"You can't create smart orders on market-closed day"
Trading daySmart orders not allowed on special trading day"Smart orders are not allowed on special trading day"
Trading hoursMust not be after market hours"Smart orders cannot be created after market hours."
Trading hoursMust not be before 8:00 AM"Smart orders are not allowed to be created before 8:00 AM."
Trading hoursMust be within regular trading hours"You can't place a smart order outside regular trading hours"
productType (MTF)Symbol/exchange must support MTF"This symbol or exchange is not supported for MTF."
DerivativesExpiry must be allowed (F&O/CD)"The selected contract expiry is not allowed for placing smart orders. Please try again with a near expiry contract."
DerivativesStrike price must be within allowed range (F&O/CD)"The selected strike price is out of the permitted range. Please try with a strike price closer to the LTP"
Daily limitMax 100 smart orders/day"You have exceeded the maximum limit of creating 100 smart orders for the day."

Response Attributes

AttributeData TypeDescription
codeintStatus code: 200 for success; negative values indicate errors.
messagestringDescribes the response — e.g., "Request sent successfully to place smart order" or an error message.
sstring"ok" for success, "error" for failure.
idstringUnique identifier for the placed smart order (returned only on success).
Last updated on