Skip to content

Glossary & Constants


Order ID Prefixes

Prefix Meaning Used For
EQ- Equity order Standard and smart-order parent orders in the EQUITY segment.
DRV- Derivative order Standard and smart-order parent orders in the DERIVATIVE segment.
GTT- Good Till Triggered Smart order child legs (always), and smart order parents when the limit price falls outside the circuit range.

See Smart Orders (GTT) for the parent/child relationship these prefixes describe.


Core Request Enums

Field Values Used In
txn_type BUY, SELL Orders, Smart Orders, Margin
exchange NSE, BSE Orders, Smart Orders, Margin
segment EQUITY, DERIVATIVE (uppercase) Orders, Smart Orders, Margin, Order/Trade lookups
segment equity, derivative (lowercase) Portfolio Positions query parameter only
segment INDEX, EQUITY (uppercase) Option Chain query parameter only
product CNC, INTRADAY, MARGIN (uppercase) Orders, Smart Orders, Margin
product cnc, intraday, margin (lowercase) Portfolio Positions query parameter only
order_type LIMIT, MARKET (Orders); LIMIT, MARKET, TRIGGER (Smart Orders) Orders, Smart Orders
validity DAY, IOC (Orders); DAY only (Smart Orders) Orders, Smart Orders
algo_id 99999 (NSE), 9999999999999999 (BSE) Orders, Smart Orders
source equity, fno, index Instruments CSV download

segment means three different things

Watch the casing and the value set — they are not interchangeable:

  • Orders / Smart Orders / Margin / lookups: uppercase EQUITY or DERIVATIVE
  • Portfolio Positions: lowercase equity or derivative
  • Option Chain: uppercase INDEX or EQUITY — here it describes the underlying's segment, so DERIVATIVE is not a valid value even though the chain returns derivative contracts

Instrument Code Formats

Two different formats are used depending on whether you're calling REST or WebSocket:

Context Format Separator Example
REST (scrip-codes query param) SEGMENT_TOKEN underscore _ NSE_3045, NFO_51011
WebSocket (instruments array) SEGMENT:TOKEN colon : NSE:2885, NFO:51011
REST (security_id, underlying-scrip) bare token, no prefix 2885, 40000001

The bare form is used wherever the segment is already given by another parameter — security_id on the order endpoints, and underlying-scrip on the Option Chain, where segment carries that information instead.

Index tokens: take them from the instruments file for the endpoint you are calling

For underlying-scrip, NIFTY 50 is 40000001, as listed by /market/instruments?source=index. Note that the WebSocket documentation uses NIDX:26000 as its NSE index example, so the two surfaces may not share the same index token. Do not carry a token from one to the other — look it up per surface.

WebSocket segment prefixes:

Prefix Meaning
NSE: NSE Equity
BSE: BSE Equity
NFO: NSE Derivatives (F&O)
BFO: BSE Derivatives (F&O)
NIDX: NSE Index
BIDX: BSE Index

The underlying instrument identifier (SECURITY_ID / scrip code / token) is the same number in both formats — only the segment prefix and separator differ. Look up the right SECURITY_ID for a symbol via the Instruments API.


Order Status Values

The full list of order statuses (QUEUED, INITIATED, SUCCESS, CANCELLED, etc.) is maintained in one place: Orders — Order Status Types.


WebSocket Message Fields

Field Values Feed
action subscribe, unsubscribe Price Feed
action subscribe Order Updates Feed
mode ltp, quote Price Feed
mode order_update Order Updates Feed

See the WebSockets guide for full subscription payloads and response shapes.


TOTP Authentication

Field Description
mpin Your INDstocks account MPIN.
totp The current 6-digit TOTP code from your authenticator app.
x-api-key Your Client ID — a static, per-account identifier shown on the dashboard after successful TOTP setup. Sent as a header instead of Authorization, and distinct from access_token.

Limits at a glance

Rule Value
Minimum gap between token generations 1 per 60 seconds
Wrong TOTP codes before lockout 5 in a rolling 15 minutes → 15-minute lockout
Repeated lockouts 3 within 1 hour → 1-hour lockout + email alert
Time to complete TOTP setup 5 minutes
Concurrent TOTP tokens 1 — a new token invalidates the previous one
Access token validity 24 hours

See Getting Your Access Token — Method 2 and TOTP limits and lockouts.