Infinn API Documentation
Order and Trades

Place Order

POST/NorenWClientAPI/PlaceOrder

Authorization token is required. Enter your access_token from GenAcsTok above.

"Use proxy" sends this request through this website's server, which never logs request or response bodies. Infinn sees the docs server's IP, not yours. Turn it off to send directly from your browser instead.

jData fields

Values are sent as a JSON string in the jData form field.

Logged in User Id

  • Example: YOUR_USER_ID
  • Where to get it: The ID you log in with at trade.infinn.in (User ID = Client ID). Also returned as uid by GenAcsTok.

Login users account ID

  • Example: YOUR_USER_ID
  • Where to get it: Same as User ID for individual accounts. Returned by GenAcsTok / UserDetails.

Exchange (Select from ‘exarr’ Array provided in User Details response)

  • Example: NSE
  • Where to get it: 'exarr' array in the UserDetails response.
  • Allowed: NSE, NFO, BSE, MCX, CDS, NCX, BFO, BCD

Unique id of contract on which order to be placed. (use url encoding to avoid special char error for symbols like M&M)

  • Example: RELIANCE-EQ
  • Where to get it: SearchScrip reply, or the TradingSymbol column of the exchange symbol file.

Order Quantity

  • Example: 1
  • Where to get it: Quantity in units (for F&O a multiple of the lot size).

Order Price (if prctyp = 'MKT/ SL-MKT' then the price will be '0')

  • Example: 1000
  • Where to get it: Your limit price. Use "0" for MKT / SL-MKT orders.

Only to be sent in case of SL-LMT / SL-MKT order.

  • Example: 995
  • Where to get it: Trigger price, only for SL-LMT / SL-MKT orders.

Disclosed quantity (Max 10% for NSE, and 50% for MCX)

C-Delivery, M-Margin, H-Cover Order, I-Intraday, B-Bracket order, F-MTF, S-Special, P-Special2

  • Example: C
  • Allowed: C = Delivery, M = Margin, H = Cover, I = Intraday, B = Bracket, F = MTF, S = Special, P = Special2

B -> BUY, S -> SELL

  • Example: B
  • Allowed: B = buy, S = sell

LMT / MKT / SL-LMT / SL-MKT / DS / 2L / 3L

  • Example: LMT
  • Allowed: LMT, MKT, SL-LMT, SL-MKT, DS, 2L, 3L

Market order protection percentage. Applicable only for MKT orders in BSE/BFO/BCS and MCX segments.

Retention type (Show options as per allowed exchanges)

  • Example: DAY
  • Allowed: DAY, EOS, IOC

Any tag by user to mark order.

  • Example: my-order-tag
  • Where to get it: Any tag you choose to mark the order.

Used to generate exchange info fields.

  • Example: API
  • Allowed: MOB, WEB, TT, API

Book Profit Price applicable only if product is selected as B (Bracket order)

Book loss Price applicable only if product is selected as H and B (High Leverage and Bracket order)

Trailing Price applicable only if product is selected as H and B (High Leverage and Bracket order)

External remarks

Cli Order Id

Channel

User Agent

App Install Id

The message "Invalid AMO" will be displayed if the "amo" field is not sent with a "Yes" value. If amo is not required, do not send this field.

Trading symbol of second leg, mandatory for price type 2L and 3L

Transaction type of second leg, mandatory for price type 2L and 3L

Quantity for second leg, mandatory for price type 2L and 3L

Price for second leg, mandatory for price type 2L and 3L

Trading symbol of third leg, mandatory for price type 3L

Transaction type of third leg, mandatory for price type 3L

Quantity for third leg, mandatory for price type 3L

Price for third leg, mandatory for price type 3L

Instrument Name

Client IP address

Cautionary message

Authorization Token

Required for all API calls. Use the access_token from the GenAcsTok response as a Bearer token.

⚠ When "Use proxy" is on, this token is sent through this website's server on its way to Infinn. It is never logged here, but if you would rather it never leave your browser, turn off "Use proxy" above or use the ready code with your own client instead.

Request to be POSTed to url : /NorenWClientAPI/PlaceOrder

Request Details
Parameter NamePossible valueDescription
jData*Should send json object with fields in below list
Authorization*Bearer <access_token>access_token from GenAcsTok response. Required for all API calls.
Json FieldsPossible valueDescription
uid*Logged in User Id
actid*Login users account ID
exch*NSE / NFO / BSE / MCX / CDS / NCX / BFO / BCDExchange (Select from ‘exarr’ Array provided in User Details response)
tsym*Unique id of contract on which order to be placed. (use url encoding to avoid special char error for symbols like M&M)
qty*Order Quantity
prc*Order Price (if prctyp = 'MKT/ SL-MKT' then the price will be '0')
trgprcOnly to be sent in case of SL-LMT / SL-MKT order.
dscqtyDisclosed quantity (Max 10% for NSE, and 50% for MCX)
prd*C / M / H / I / B / F / S / PC-Delivery, M-Margin, H-Cover Order, I-Intraday, B-Bracket order, F-MTF, S-Special, P-Special2
trantype*B / SB -> BUY, S -> SELL
prctyp*LMT / MKT / SL-LMT / SL-MKT / DS / 2L / 3L
mkt_protectionMarket order protection percentage. Applicable only for MKT orders in BSE/BFO/BCS and MCX segments.
ret*DAY / EOS / IOCRetention type (Show options as per allowed exchanges)
remarksAny tag by user to mark order.
ordersourceMOB / WEB / TT / APIUsed to generate exchange info fields.
bpprcBook Profit Price applicable only if product is selected as B (Bracket order)
blprcBook loss Price applicable only if product is selected as H and B (High Leverage and Bracket order)
trailprcTrailing Price applicable only if product is selected as H and B (High Leverage and Bracket order)
ext_remarksExternal remarks
cl_ord_idCli Order Id
channelChannel
usr_agentUser Agent
app_inst_idApp Install Id
amoYesThe message "Invalid AMO" will be displayed if the "amo" field is not sent with a "Yes" value. If amo is not required, do not send this field.
tsym2Trading symbol of second leg, mandatory for price type 2L and 3L
trantype2Transaction type of second leg, mandatory for price type 2L and 3L
qty2Quantity for second leg, mandatory for price type 2L and 3L
prc2Price for second leg, mandatory for price type 2L and 3L
tsym3Trading symbol of third leg, mandatory for price type 3L
trantype3Transaction type of third leg, mandatory for price type 3L
qty3Quantity for third leg, mandatory for price type 3L
prc3Price for third leg, mandatory for price type 3L
instnameInstrument Name
ipaddrClient IP address
cau_msgCautionary message
Example
curl https://apitest.kambala.co.in/NorenWClientAPI/PlaceOrder \
    -d "jData={\"uid\":\"VIDYA\", \"actid\":\"CLIENT1\", \"exch\":\"NSE\", \"tsym\":\"ACC-EQ\", \"qty\":\"50\", \"price\":\"1400\", \"prd\":\"H\", \"trantype\":\"B\", \"prctyp\":\"LMT\", \"ret\":\"DAY\"}"
Response Details

Response data will be in json format with below fields:

Json FieldsPossible valueDescription
statOk or Not_OkPlace order success or failure indication.
request_timeResponse received time.
norenordnoIt will be present only on successful Order placement to OMS.
emsgThis will be present only if Order placement fails
Sample Success Response
{
    "request_time": "10:48:03 20-05-2020",
    "stat": "Ok",
    "norenordno": "20052000000017"
}
Sample Failure Response
{
    "stat": "Not_Ok",
    "request_time": "20:40:01 19-05-2020",
    "emsg": "Error Occurred : 2 \"invalid input\""
}

</details>

<details>
<summary><strong>Ready code — single order</strong></summary>

Default values are filled in. Change only the access token and user ID, then run it.

```python
import json, requests

# ---- Change only what you need ----
ACCESS_TOKEN = "PASTE_ACCESS_TOKEN_HERE"
UID = "YOUR_USER_ID"  # e.g. IN517

order = {
    "uid":      UID,
    "actid":    UID,
    "exch":     "NSE",
    "tsym":     "RELIANCE-EQ",   # trading symbol
    "qty":      "1",
    "prc":      "1000",          # "0" for market order
    "prctyp":   "LMT",           # LMT / MKT / SL-LMT / SL-MKT
    "trantype": "B",             # B = buy, S = sell
    "prd":      "C",             # C = CNC, I = MIS, M = NRML
    "ret":      "DAY",
}
# ------------------------------------

response = requests.post(
    "https://api.infinn.in/NorenWClientAPI/PlaceOrder",
    headers={"Content-Type": "text/plain", "Authorization": f"Bearer {ACCESS_TOKEN}"},
    data="jData=" + json.dumps(order),
)
print(response.json())  # {"stat":"Ok","norenordno":"..."}
Ready code — Multi-Order (several orders together)

Checks the margin for all orders together with GetBasketMargin (first order on top, the rest in basketlists), then places each order with PlaceOrder.

import json, requests

# ---- Change only what you need ----
ACCESS_TOKEN = "PASTE_ACCESS_TOKEN_HERE"
UID = "YOUR_USER_ID"  # e.g. IN517

orders = [
    {"exch": "NSE", "tsym": "RELIANCE-EQ", "qty": "1", "prc": "1000", "prctyp": "LMT", "trantype": "B", "prd": "C"},
    {"exch": "NSE", "tsym": "SBIN-EQ",     "qty": "1", "prc": "500",  "prctyp": "LMT", "trantype": "B", "prd": "C"},
    {"exch": "NSE", "tsym": "INFY-EQ",     "qty": "1", "prc": "1200", "prctyp": "LMT", "trantype": "B", "prd": "C"},
]
# ------------------------------------

URL = "https://api.infinn.in/NorenWClientAPI/"
HEADERS = {"Content-Type": "text/plain", "Authorization": f"Bearer {ACCESS_TOKEN}"}

# 1. Margin for all orders together (first order on top, the rest in basketlists)
margin = requests.post(URL + "GetBasketMargin", headers=HEADERS,
                       data="jData=" + json.dumps({"uid": UID, "actid": UID, **orders[0],
                                                   "basketlists": orders[1:]})).json()
print("Basket margin:", margin)

# 2. Place every order
for o in orders:
    r = requests.post(URL + "PlaceOrder", headers=HEADERS,
                      data="jData=" + json.dumps({"uid": UID, "actid": UID, **o, "ret": "DAY"})).json()
    print(o["tsym"], "->", r)
Ready code — multi-leg order (2L / 3L)

Two or three legs are sent as one order. 2L / 3L must be enabled on the account. The allowed order types are listed in orarr from User Details.

import json, requests

# ---- Change only what you need ----
ACCESS_TOKEN = "PASTE_ACCESS_TOKEN_HERE"
UID = "YOUR_USER_ID"  # e.g. IN517

order = {
    "uid": UID, "actid": UID, "exch": "NFO", "prd": "M", "ret": "DAY",
    "prctyp": "2L",                     # 2L = two legs, 3L = three legs

    # leg 1
    "tsym": "LEG1_SYMBOL",  "trantype": "B",  "qty": "75",  "prc": "100",
    # leg 2
    "tsym2": "LEG2_SYMBOL", "trantype2": "S", "qty2": "75", "prc2": "80",
    # leg 3 (only for 3L)
    # "tsym3": "LEG3_SYMBOL", "trantype3": "B", "qty3": "75", "prc3": "60",
}
# ------------------------------------

response = requests.post(
    "https://api.infinn.in/NorenWClientAPI/PlaceOrder",
    headers={"Content-Type": "text/plain", "Authorization": f"Bearer {ACCESS_TOKEN}"},
    data="jData=" + json.dumps(order),
)
print(response.json())
FieldMeaning
prctyp2L for two legs, 3L for three legs
tsym trantype qty prcLeg 1
tsym2 trantype2 qty2 prc2Leg 2
tsym3 trantype3 qty3 prc3Leg 3 (only for 3L)
curl --request POST \
  --url 'https://api.infinn.in/NorenWClientAPI/PlaceOrder' \
  --header 'Authorization: Bearer PASTE_ACCESS_TOKEN_HERE' \
  --header 'Content-Type: text/plain' \
  --data 'jData={"uid":"YOUR_USER_ID","actid":"YOUR_USER_ID","exch":"NSE","tsym":"RELIANCE-EQ","qty":"1","prc":"1000","prd":"C","trantype":"B","prctyp":"LMT","ret":"DAY"}'
Response will appear here after sending a request