On this page

The reference uses these words constantly and the API specification nowhere defines them. Each entry gives the plain meaning first, then the fields that carry it.

Instrument, symbol and token

An instrument is any one thing you can trade: a share, a futures contract, an option contract, an index.

Every instrument has two identifiers in this API, and you need both.

"Reliance"what a human typesSearchScripor the symbol master filetsym"RELIANCE-EQ"token"2885"Ordersuse tsymQuotes & feeduse tokenOrders are placed by symbol. Prices are subscribed by token. You need both.
Figure 1. Orders are placed by trading symbol. Prices are subscribed by numeric token. Resolving a name gives you both at once.
CodeExchange
NSENational Stock Exchange - cash / equity
NFONSE equity derivatives (futures & options)
BSEBombay Stock Exchange - cash / equity
BFOBSE equity derivatives
CDSNSE currency derivatives
MCXMulti Commodity Exchange
NCXNSE commodity
Verified values you can test with

Checked against the live NSE symbol master on 2026‑10‑08: RELIANCE-EQ is token 2885 (tick size 0.10); SBIN-EQ is 3045 (tick 0.05); INFY-EQ is 1594; ACC-EQ is 22. Nifty 50 is 26000 and Nifty Bank is 26009.

Full detail on the files these come from: instruments and the symbol master.

Order, trade, position, holding

These four are routinely confused, and they mean quite different things.

The difference that matters most

Buy a share today and sell it today, and you never had a holding - only a position that opened and closed.

Buy it today and keep it, and after settlement it becomes a holding: it is in your demat account, it is yours, and it no longer appears as a position.

The two live at different endpoints for that reason. A portfolio screen needs both. Worked example

Product: how a position is treated

The prd field decides what happens to a position at the end of the day and how much margin it requires.

prdMeaning
CDelivery - shares settle into your demat account (CNC)
IIntraday - must be squared off the same day (MIS)
MMargin - carry-forward derivatives position (NRML)
HCover order - entry plus a compulsory stop-loss
BBracket order - entry plus a stop-loss and a target
SSpecial
PSpecial2
Do not hard-code this list

Which products an account may use, and on which exchanges, is per account. The prarr array from User Details is authoritative. It also gives you s_prdt_ali, the display name to show the user - show "Delivery", send C.

Order type: how the price is decided

prctypMeaning
LMTLimit - fills at your price or better
MKTMarket - fills immediately at whatever the market offers
SL-LMTStop-loss limit - becomes a limit order once trgprc is hit
SL-MKTStop-loss market - becomes a market order once trgprc is hit
DSDisclosed quantity order
2LTwo-leg order - both legs sent together
3LThree-leg order - all three legs sent together
Limit or market, in one line each

Limit - "buy at 1000 or better, and wait if you have to." You control the price, not whether it happens.

Market - "buy now, whatever the price is." You control whether it happens, not the price.

Stop-loss - "do nothing until the price reaches 950, then act." Used to limit a loss.

Validity: how long an order waits

retMeaning
DAYValid for the rest of today's session
IOCImmediate or cancel - fill what you can now, cancel the rest
EOSEnd of session

Which values an exchange accepts differs:

ExchangePermitted ret values
NSEDAY, IOC
BSEEOS, DAY, IOC
NFODAY, IOC
CDSDAY, IOC
NCXDAY, IOC
BFOEOS, DAY, IOC

Margin

Margin is money set aside while a position is open. It is not a fee - you get it back when the position closes - but while it is held you cannot use it for anything else.

Why margin exists

Some trades let you take on far more exposure than your cash would buy outright. A futures contract worth ₹10 lakh might need only ₹1 lakh up front.

The ₹1 lakh is margin: a deposit proving you can cover losses. If the trade moves against you far enough, the broker needs more. If you have not got it, the position is closed for you.

Three endpoints deal with margin, and they answer different questions:

The arithmetic is set out on margin, MTM and P&L.

Mark-to-market and P&L

Realised profit is locked in: you closed the position and the money is yours. The field is rpnl.

Unrealised profit is on paper: the position is still open and the number moves with every tick. The field is urmtom.

MTM and P&L are two different numbers

Both use the same formula but a different reference price. Mark-to-market measures against netavgprc, the average price you traded at. Profit and loss measures against netupldprc, the uploaded price - falling back to netavgprc when that is zero.

Showing one and labelling it the other is a real and common bug. The full arithmetic

Lot size and tick size

Lot size

(

ls

,

LotSize

)

Derivatives trade in fixed bundles. If the lot size is 500, you may buy 500 or 1000, never 600. Equities have a lot size of 1.

Tick size

(

ti

,

TickSize

)

The smallest price step allowed. RELIANCE-EQ ticks in 0.10, so 1402.30 is valid and 1402.33 is rejected.

Both cause rejections that look like nothing

A quantity that is not a multiple of the lot size, or a price that is not a multiple of the tick size, is refused with the unhelpful Error Occurred : 2 "invalid input". Validate both before sending. Each instrument's values are in the symbol master.

Circuit limits

Exchanges cap how far a price may move in one day. The ceiling is the upper circuit (uc), the floor the lower circuit (lc). An order priced outside the band is rejected - with, unusually, a genuinely informative message:

A real rejreason from the API specification
RED:RULE:{Check circuit limit including square off order}
Current:INR 2,400.00 LowerCircuit:INR 1,590.05 UpperCircuit:INR 1,943.35
:NSE.ACC-EQ for C-IN001 [DEFAULT]

Show that text to the user as-is. Replacing it with "order failed" throws away everything useful in it.

GTT and alerts

Both watch a price. The difference is what happens when it is reached.

Market depth

The depth is the queue of unmatched orders waiting on both sides. Infinn publishes five levels each way: price, quantity and number of orders.

One level of each side, from a real depth message
{
"bp1": "1156.00",  "bq1": "4",    "bo1": "2",
"sp1": "1156.50",  "sq1": "10",   "so1": "3"
}

b is buy, s is sell; p price, q quantity, o order count; the digit is the level. The gap between bp1 and sp1 is the spread. The depth feed

Next

Esc
↑↓ navigate↵ openEsc close/ to search