Shoonya Api
Shoonya Api
Introduction
Get API Key
Login and User Details
Login
Logout
Forgot Password
Change Password
Set Device Pin
Login with Device Pin
Get HS Token
Validate HS Token
User Details
Client Details
Watch Lists
Get WatchList Names
Get WatchList
Search Scrips
Add Scrip to Watch List
Delete Scrip to Watch List
Get Security Info
Get Quotes
Get list of predefined MWs
Get list of predefined MW scrips
Order and Trades
Place Order
Modify Order
Cancel Order
Exit SNO Order
Order Margin
Basket Margin
Order Book
Single Order History
Single Order Status
Trade Book
Positions Book
Product Conversion
Holdings and Limits
Holdings
Limits
Market Info
Get Index List
Get Top List Names
Get Top List
Get Time Price Data (Chart data)
Get Option Chain
Exch Msg
Get Broker Msg
Span Calculator
Alerts
Set Alert
Cancel Alert
Modify Alert
Get Pending Alert
Get Enabled Alert Types
GTT Orders
Place GTT Order
Cancel GTT Order
Get Pending GTT Order
Get Enabled GTTs
Get UnSettled Trading date
Web Socket API
Connect
Subscribe Touchline
Unsubscribe Touchline
Subscribe Depth
Unsubscribe Depth
Subscribe Order Update
Unsubscribe Order Update
Annexure
Alert Type
Exceptions & Errors
Symbol Master
Rate Limit
Get Quote Limit
Python (SDK)
Repository
Documentation
.Net (SDK)
Repository
Documentation
Node JS (SDK)
Repository
Documentation
V 1.0.0
Introduction
Finvasia is a solution oriented firm indulged in serving financial organizations with innovative products
and services. We understand the new challenges and obstacles which are continuously arising for
businesses with rapid advances in technology and environment, they could only be tackled with efficient
and effective approaches. We have expertise in building high throughput, low latency distributed
applications that can support a large concurrent user base.
Noren OMS solution is built keeping in mind the large and diverse Indian broking industry. Few of the
prominent coverages are Order Execution, Algo Trading, Exchange connectivity and Risk Mitigation.
Our team strives to serve ever changing requirements with agility and personal touch. Noren OMS is
continuously being tested for stability, high scalability and low latency in mind.
Example:
curl https://api.shoonya.com/NorenWClientTP/QuickAuth \
-d "jData={ \"apkversion\": \"1.0.0\", \"uid\": \"User Id of the login
user\", \"pwd\": \"s3cur3Id\", \"factor2\":
\"OTP or TOTP as entered by the
user.\", \"imei\": \"134243434\", \"source\": \"API\", \"vc\": \"Client Code_U\",
\"appkey\": \"Sha256 of uid|api_key\"}"
{
"request_time": "20:18:47 19-05-2020",
"stat": "Ok",
"susertoken": "3b97f4c67762259a9ded6dbd7bfafe2787e662b3870422ddd343a59895f423a0",
"lastaccesstime": "1589899727"
}
{
"request_time": "20:32:14 19-05-2020",
"stat": "Not_Ok",
"emsg": "Invalid Input : Wrong Password"
}
Login
Request to be POSTed to uri : /NorenWClientTP/QuickAuth
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
Possible
Json Fields Description
value
apkversion
- Application version
*
uid* - User Id of the login user
pwd* - Sha256 of the user entered password.
factor2* - OTP or TOTP as entered by the user.
vc* - Vendor code provided by noren team, along with connection URLs
appkey* - Sha256 of uid|api_key
imei* - Send mac if users logs in for desktop, imei is from mobile
Optional field, Value must be in below format: iOS - iosInfo.utsname.machine -
addldivinf - iosInfo.systemVersion Android - androidInfo.model - androidInfo.version
examples: iOS - iPhone 8.0 - 9.0 Android - Moto G - 9 PKQ1.181203.01
ipaddr - Optional field
source API -
Response Details
Response data will be in json format with below fields.
Possible
Json Fields Description
value
Ok or
stat Login Success Or failure status
Not_Ok
It will be present only on login success. tdis data to be sent in subsequent
susertoken -
requests in jKey field and web socket connection while connecting.
lastaccesstime - It will be present only on login success.
If Y Mandatory password reset to be enforced. Otherwise the field will be
spasswordreset Y
absent.
exarr - Json array of strings with enabled exchange names
uname - User name
prarr - Json array of Product Obj with enabled products, as defined below.
actid - Account id
email - Email Id
brkname - Broker id
This will be present only if Login fails. (Redirect to force change password
if message is
emsg -
“Invalid Input : Password Expired” or “Invalid
Input : Change Password”)
Sample Success Response:
{
"stat":"Ok",
"request_time":"10:43:41 28-05-2020"
}
{
"stat":"Not_Ok",
"emsg":"Server Timeout : "
}
Logout
Request to be POSTed to uri : /NorenWClientTP/Logout
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User Id of the login user
Response Details :
Response data will be in json format with below fields.
{
"request_time":"10:52:56 28-05-2020",
"stat":"Ok"
}
{
"request_time":"17:42:13 26-05-2020",
"stat":"Not_Ok",
"emsg":"Error Occurred : Wrong user id or user details"
}
Forgot Password
Request to be POSTed to uri : /NorenWClientTP/ForgotPassword
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
Json Fields Possible value Description
uid* - User Id
pan* - Pan of the user
dob* - Date of birth
Response Details :
Response data will be in json format with below fields.
{
"request_time":"10:20:04 27-05-2020",
"stat":"Ok",
“dmag”:”Password Change Success. Your new password will expire in 15”
}
{
"request_time":"10:21:09 27-05-2020",
"stat":"Not_Ok",
"emsg":"Error Occurred : Password already used"
}
Change Password
Request to be POSTed to uri : /NorenWClientTP/Changepwd
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
Json Fields Possible value Description
uid* - User Id
oldpwd* - Sha256 of old password
pwd* - New password in plain text
Response Details :
Response data will be in json format with below fields.
Possible
Json Fields Description
value
Ok or
stat Password reset is Success Or failure status
Not_Ok
request_tim
- Response received time.
e
This will be present only in case of success. Number of days to expiry will be
dmsg -
present in same.
emsg - This will be present only if password change fails
Sample Success Response:
{
"request_time":"14:59:43 27-05-2020",
"stat":"Ok"
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
{
"request_time":"17:01:45 27-05-2020",
"stat":"Ok",
"susertoken":"b0856b3f6c4bac657417fc95de3e2060567b8bd80665e0a8ab82bbde5c434936",
"lastaccesstime":"1590579105"
}
{
"request_time":"11:19:56 28-05-2020",
"stat":"Not_Ok",
"emsg":"Invalid Input : Mpin Invalid"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
Json Fields Possible value Description
uid* - User Id
imei* - Imei or device unique fingerprint
source* - Access type (API)
dpin* - sha256 of entered device pin
vc* - Vendor code provided by noren team, along with connection URLs
Parameter Name Possible value Description
appkey* - Sha256 of uid|vendor_key
apkversion* - Application version number
ipaddr* - global Ip of internet access
Response Details :
Response data will be in json format with below fields.
Possible
Json Fields Description
value
Ok or
stat Login Success Or failure status
Not_Ok
It will be present only on login success. This data to be sent in subsequent
susertoken -
requests in jKey field and web socket connection while connecting.
lastaccesstime - It will be present only on login success.
If Y Mandatory password reset to be enforced. Otherwise the field will be
spasswordreset Y
absent.
Get HS Token
Request to be POSTed to uri : /NorenWClientTP/GetHsToken
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User Id
Response Details :
Response data will be in json format with below fields.
Validate HS Token
Request to be POSTed to uri : /NorenWClientTP/ValidateHsToken
(To be used only from server, Call this url from Browser / Client Side APKs)
Request Details :
Parameter Name Possible value Description
LoginId* - Send sLoginId received from Initiator site
token* - Key Obtained on login success.0
Response Details :
Response data will be in plain text format TRUE if Token is valid and FALSE for invalid User Id or
Token.
External Integration (Backoffice Url..etc) Flow:
Trading site will call the third party url on user clicking the specified link (eg:Back Office login)
Trading site will pass the User id , Token and Client ID to the the third party ur
Third Party application/web server will make a server call to our web server using this “Validate
HS Token” Url.
If Trading site web server says ok then Third party application will provide access to the
user/client
Sample Success Response:
{
"request_time": "20:20:04 19-05-2020",
"prarr": [
{ “prd”:"C",
“s_prdt_ali” : “Delivery”,
“exch” : [“NSE”, “BSE”]
},
{ “prd”:"I",
“s_prdt_ali” : “Intraday”,
“exch” : [“NSE”, “BSE”, “NFO”, "BFO"]
},
, { “prd”:"H",
“s_prdt_ali” : “High Leverage”,
“exch” : [“NSE”, “BSE”, “NFO”, "BFO"]
},
{ “prd”:"B",
“s_prdt_ali” : “Bracket Order”,
“exch” : [“NSE”, “BSE”, “NFO”, "BFO"]
}
],
"exarr": [
"NSE",
"NFO",
"BFO"
],
"orarr": [
"MKT",
"LMT",
"SL-LMT",
"SL-MKT",
"DS",
"2L",
"3L",
"4L"
],
"brkname": "VIDYA",
"brnchid": "VIDDU",
"email": "[email protected]",
"actid": "GURURAJ",
"uprev": "INVESTOR",
"stat": "Ok"
}
{
"stat": "Not_Ok",
"emsg": "Session Expired : Invalid Session Key"
}
User Details
Request to be POSTed to uri : /NorenWClientTP/UserDetails
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged In User Id
Response Details :
Response data will be in json format with below fields.
Possible
Json Fields Description
value
Ok or
stat User details success or failure indication.
Not_Ok
exarr - Json array of strings with enabled exchange names
orarr - Json array of strings with enabled price types for user
prarr - Json array of Product Obj with enabled products, as defined below.
brkname - Broker id
brnchid - Broker id
email - -
actid - -
m_num - Mobile Number
Always it will be an INVESTOR, other types of user not allowed to login
uprev -
using this API.
request_tim
- It will be present only in a successful response.
e
emsg - This will be present only in case of errors.
Product Obj format :
Json Fields Possible value Description
prd - Product name
s_prdt_ali - Product display name
exch - Json array of strings with enabled, allowed exchange names
Client Details
Request to be POSTed to uri : /NorenWClientTP/ClientDetails
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged In User Id
actid* - Login users account ID
brkname* - Login users broker ID
Response Details :
Response data will be in json format with below fields.
"request_time":"14:59:43 27-05-2020",
"stat":"Ok"
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User Id
fcmtkn* - FCM token collected from device
Response Details :
Response data will be in json format with below fields.
{
"request_time": "12:34:52 21-05-2020",
"values": [
"default",
"WL"
],
"stat": "Ok"
}
{
"stat": "Not_Ok",
"emsg": "Session Expired : Invalid Session Key"
}
{
"request_time": "13:25:17 21-05-2020",
"values": [
{
"exch": "BSE",
"token": "972889",
"tsym": "915PTCIF27"
},
{
"exch": "NSE",
"token": "13",
"tsym": "ABB-EQ"
},
{
"exch": "NSE",
"token": "22",
"tsym": "ACC-EQ"
}
],
"stat": "Ok"
}
{
"stat":"Not_Ok",
"emsg":"Invalid Input : Missing uid or wlname."
}
Get WatchList
Request to be POSTed to uri : /NorenWClientTP/MarketWatch
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
wlname* - Name of the Watchlist, for which scrip list is required.
Response Details :
Response data will be in json format with below fields.
{
"stat": "Ok",
"values": [
{
"exch": "NSE",
"token": "18069",
"tsym": "REL100NAV-EQ"
},
{
"exch": "NSE",
"token": "24225",
"tsym": "RELAXO-EQ"
},
{
"exch": "NSE",
"token": "4327",
"tsym": "RELAXOFOOT-EQ"
},
{
"exch": "NSE",
"token": "18068",
"tsym": "RELBANKNAV-EQ"
},
{
"exch": "NSE",
"token": "2882",
"tsym": "RELCAPITAL-EQ"
},
{
"exch": "NSE",
"token": "18070",
"tsym": "RELCONSNAV-EQ"
},
{
"exch": "NSE",
"token": "18071",
"tsym": "RELDIVNAV-EQ"
},
{
"exch": "NSE",
"token": "18072",
"tsym": "RELGOLDNAV-EQ"
},
{
"exch": "NSE",
"token": "2885",
"tsym": "RELIANCE-EQ"
},
{
"exch": "NSE",
"token": "15068",
"tsym": "RELIGARE-EQ"
},
{
"exch": "NSE",
"token": "553",
"tsym": "RELINFRA-EQ"
},
{
"exch": "NSE",
"token": "18074",
"tsym": "RELNV20NAV-EQ"
}
]
}
{
"stat":"Not_Ok",
"emsg":"No Data : "
}
Search Scrips
Request to be POSTed to uri : /NorenWClientTP/SearchScrip
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
stext* - Search Text
Parameter Name Possible value Description
exch - Exchange (Select from ‘exarr’ Array provided in User Details response)
Response Details :
Response data will be in json format with below fields.
{
"request_time": "13:50:40 21-05-2020",
"stat": "Ok"
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
wlname* - Name of the Watchlist, for which scrip list is required.
scrips - List of scrips, example format NSE|22#BSE|506734
Response Details :
Response data will be in json format with below fields.
{
"request_time": "13:50:40 21-05-2020",
"stat": "Ok"
"stat":"Not_Ok",
emsg":"Invalid Input : Missing uid or wlname or scrips."
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
wlname* - Name of the Watchlist, for which scrip list is required.
scrips - List of scrips, example format NSE|22#BSE|506734
Response Details :
Response data will be in json format with below fields.
{
"stat":"Not_Ok",
"request_time":"10:50:54 10-12-2020",
"emsg":"Error Occurred : 5 \"no data\""
}
Example:
jData={"uid":"", "exch":"NSE",
"token":"22"}&jKey=c180c60ec8f7870490ec27f4accdba179a149a5e5b1d503a0682d8b72acb24
b3
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch - Exchange
token - Contract Token
Response Details :
Response data will have below fields.
Json Fields Possible value Description
request_time Ok or Not_Ok Market watch success or failure indication.
exch NSE, BSE, NFO ... Exchange
tsym - Trading Symbol
cname - Company Name
symnam - Symbol Name
seg - Segment
exd - Expiry Date
instname - Intrument Name
strprc - Strike Price
optt - Option Type
isin - ISIN
ti - Tick Size
ls - Lot Size
pp - Price precision
mult - Multiplier
gp_nd - gn/gd * pn/pd
prcunt - Price Units
prcqqty - Price Quote Qty
trdunt - Trade Units
delunt - Delivery Units
frzqty - Freeze Qty
gsmind - scripupdate Gsm Ind
elmbmrg - Elm Buy Margin
elmsmrg - Elm Sell Margin
addbmrg - Additional Long Margin
addsmrg - Additional Short Margin
splbmrg - Special Long Margin
splsmrg - Special Short Margin
delmrg - Delivery Margin
tenmrg - Tender Margin
tenstrd - Tender Start Date
tenendd - Tender End Eate
exestrd - Exercise Start Date
exeendd - Exercise End Date
elmmrg - Elm Margin
varmrg - Var Margin
expmrg - Exposure Margin
token - Contract Token
prcftr_d - ((GN / GD) * (PN/PD))
Sample Success Response:
{
"request_time":"12:05:21 18-05-2021",
"stat":"Ok"
,"exch":"NSE",
"tsym":"ACC-EQ",
"cname":"ACC LIMITED",
"symname":"ACC",
"seg":"EQT",
"instname":"EQ",
"isin":"INE012A01025",
"pp":"2",
"ls":"1",
"ti":"0.05",
"mult":"1",
"uc":"2093.95",
"lc":"1713.25",
"prcftr_d":"(1 / 1 ) * (1 / 1)",
"token":"22",
"lp":"0.00",
"h":"0.00",
"l":"0.00",
"v":"0",
"ltq":"0",
"ltt":"05:30:00",
"bp1":"2000.00",
"sp1":"0.00",
"bp2":"0.00",
"sp2":"0.00",
"bp3":"0.00",
"sp3":"0.00",
"bp4":"0.00",
"sp4":"0.00",
"bp5":"0.00",
"sp5":"0.00",
"bq1":"2",
"sq1":"0",
"bq2":"0",
"sq2":"0",
"bq3":"0",
"sq3":"0",
"bq4":"0",
"sq4":"0",
"bq5":"0",
"sq5":"0",
"bo1":"2",
"so1":"0",
"bo2":"0",
"so2":"0",
"bo3":"0",
"so3":"0",
"bo4":"0",
"so4":"0",
"bo5":"0",
"So5":"0"
{
"stat":"Not_Ok",
"request_time":"10:50:54 10-12-2020",
"emsg":"Error Occurred : 5 \"no data\""
}
Example:
Data={"uid":"", "exch":"NSE",
"token":"22"}&jKey=4c258343e010b21851856cadb188e0adc24e173cfbf945e7beda7bc045f745
48
Get Quotes
Request to be POSTed to uri : /NorenWClientTP/GetQuotes
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch - Exchange
token - Contract Token
Response Details :
Response data will have below fields.
{
"request_time": "10:48:03 20-05-2020",
"stat": "Ok",
"norenordno": "20052000000017"
}
{
"stat": "Not_Ok",
"request_time": "20:40:01 19-05-2020",
"emsg": "Error Occurred : 2 \"invalid input\""
}
Example:
curl https://api.shoonya.com/NorenWClientTP/PlaceOrder \
-d
"jData={\"uid\":\"VIDYA\", \"actid\":\"CLIENT1\", \"exch\":\"NSE\", \"tsym\":\"ACC-
EQ\",
\"qty\":\"50\", \"price\":\"1400\", \"prd\":\"H\", \"trantype\":\"B\", \"prctyp\":\"L
MT\", \"ret\":\"DAY\"}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”
Place Order
Request to be POSTed to uri : /NorenWClientTP/PlaceOrder
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Login users account ID
Exchange (Select from ‘exarr’ Array provided in
exch* NSE / NFO / CDS / MCX / BSE / BFO
User Details response)
RELIANCE-EQ /
Unique id of contract on which order to be placed.
L&TFH29SEP22P97 /
(Use the Results from Search Script to get the
tsym* USDINR25NOV22C76 /
trading symbol & use url encoding to avoid special
CRUDEOIL16NOV22P5400 /
char error for symbols like M&M)
WHIRLPOOL
RELIANCE-EQ:-1 / NIFTY:-50 /
qty* Order Quantity
BANKNIFTY:-25
prc* - Order Price
trgprc* - Only to be sent in case of SL / SL-M order.
Disclosed quantity (Max 10% for NSE, and 50%
dscqty* -
for MCX)
Product name (Select from ‘prarr’ Array provided
in User Details response, and if same is allowed
for selected, exchange. Show product display
prd* C/M/I/B/H name, for user to select, and send corresponding
prd in API call) "C" For CNC, "M" FOR NRML,
"I" FOR MIS, "B" FOR BRACKET ORDER, "H"
FOR COVER ORDER
trantype* B / S B -> BUY, S -> SELL
LMT / MKT / SL-LMT / SL-MKT /
prctyp* -
DS / 2L / 3L
Retention type (Show options as per allowed
ret* DAY / EOS / IOC
exchanges)
remarks - Any tag by user to mark order.
ordersource MOB / WEB / TT Used to generate exchange info fields.
Book Profit Price applicable only if product is
bpprc -
selected as B (Bracket order )
Book loss Price applicable only if product is
blprc -
selected as H and B (High Leverage and Bracket
Parameter Name Possible value Description
order )
Trailing Price applicable only if product is
trailprc - selected as H and B (High Leverage and Bracket
order )
Yes , If not sent, of Not “Yes”, will be treated as
amo -
Regular order.
Trading symbol of second leg, mandatory for price
tsym2 - type 2L and 3L (use url encoding to avoid special
char error for symbols like M&M)
Transaction type of second leg, mandatory for
trantype2 -
price type 2L and 3L
Quantity for second leg, mandatory for price type
qty2 -
2L and 3L
Price for second leg, mandatory for price type 2L
prc2 -
and 3L
Trading symbol of third leg, mandatory for price
tsym3 - type 3L (use url encoding to avoid special char
error for symbols like M&M)
Transaction type of third leg, mandatory for price
trantype3 -
type 3L
qty3 - Quantity for third leg, mandatory for price type 3L
prc3 - Price for third leg, mandatory for price type 3L
Response Details :
Response data will be in json format with below fields.
{
"request_time":"14:14:08 26-05-2020",
"stat":"Ok",
"result":"20052600000103"
}
{
"request_time":"16:03:29 28-05-2020",
"stat":"Not_Ok",
"emsg":"Rejected : ORA:Order not found"
}
Modify Order
Request to be POSTed to uri : /NorenWClientTP/ModifyOrder
Request Details :
Note: If order status is not ("status": "OPEN" or "TRIGGER_PENDING") user can't modify/cancel the
order.
{
"request_time":"14:14:10 26-05-2020",
"stat":"Ok",
"result":"20052600000103"
}
Sample Failure Response:
{
"request_time":"16:01:48 28-05-2020",
"stat":"Not_Ok",
"emsg":"Rejected : ORA:Order not found to Cancel"
}
Cancel Order
Request to be POSTed to uri : /NorenWClientTP/CancelOrder
Request Details :
Note: If order status is not ("status": "OPEN" or "TRIGGER_PENDING") user can't modify/cancel the
order.
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
norenordno* - Noren order number, which needs to be modified
prd* H/B Allowed for only H and B products (Cover order and bracket order)
uid* - User id of the logged in user.
Response Details :
Response data will be in json format with below fields.
Json Fields Possible value Description
stat Ok or Not_Ok Cancel order success or failure indication.
dmsg - Display message, (will be present only in case of success).
request_time - Response received time.
emsg - This will be present only if Order cancelation fails
Order Margin
Request to be POSTed to uri : /NorenWClientTP/GetOrderMargin
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
actid* - Login users account ID
NSE / NFO / BSE
exch* Exchange (Select from ‘exarr’ Array provided in User Details response)
/ MCX / BFO
Unique id of contract on which order to be placed. (use url encoding to
tsym* -
avoid special char error for symbols like M&M)
qty* - Order Quantity
prc* - Order Price
trgprc - Only to be sent in case of SL / SL-M order.
Product name (Select from ‘prarr’ Array provided in User Details
prd* C/M/H response, and if same is allowed for selected, exchange. Show product
display name, for user to select, and send corresponding prd in API call)
trantype* B / S B -> BUY, S -> SELL
LMT / MKT / SL-
prctyp* -
LMT / SL-MKT
blprc - Optional field. Application only for modify order, open order quantity
fillshares - Optional field. Application only for modify order, quantity already filled.
rorgprc - Optional field. Application only for modify order, open order price
Optional field. Application only for modify order, open order trigger
orgtrgprc -
price
norenordno - Optional field. Application only for H or B order modification
snonum - Optional field. Application only for H or B order modification
Response Details :
Response data will be in json format with below fields.
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Login users account ID
NSE / NFO / BSE
exch* Exchange (Select from ‘exarr’ Array provided in User Details response)
/ MCX / BFO
Unique id of contract on which order to be placed. (use url encoding to
tsym* -
avoid special char error for symbols like M&M)
qty* - Order Quantity
prc* - Order Price
trgprc - Only to be sent in case of SL / SL-M order.
Product name (Select from ‘prarr’ Array provided in User Details
prd* C/M/H response, and if same is allowed for selected, exchange. Show product
display name, for user to select, and send corresponding prd in API call)
trantype* B / S B -> BUY, S -> SELL
LMT / MKT / SL-
prctyp* Login
LMT / SL-MKT
Book loss Price applicable only if product is selected as H and B (High
blprc -
Leverage and Bracket order )
rorgqty - Optional field. Application only for modify order, open order quantity
fillshares - Optional field. Application only for modify order, quantity already filled.
rorgprc - Optional field. Application only for modify order, open order price
Optional field. Application only for modify order, open order trigger
orgtrgprc* -
price
norenordno - Optional field. Application only for H or B order modification
snonum - Optional field. Application only for H or B order modification
basketlists* - Optional field. Array of json objects. (object fields given in below table)
Json Fields of
object in values Possible value Description
Array
NSE / NFO / Unique id of contract on which order to be placed. (use url encoding
exch*
BSE / MCX to avoid special char error for symbols like M&M)
qty* - Order Quantity
prc* - Order Price
trgprc - Only to be sent in case of SL / SL-M order.
Product name (Select from ‘prarr’ Array provided in User Details
response, and if same is allowed for selected, exchange. Show
prd* C/M/H
product display name, for user to select, and send corresponding prd
in API call)
trantype* B/S B -> BUY, S -> SELL
LMT / MKT /
prctyp* SL-LMT / SL- -
MKT
Response data will be in json format with below fields.
{
“stat” : “Ok”,
“exch” : “NSE” ,
“tsym” : “ACC-EQ” ,
“norenordno” : “20062500000001223”,
“prc” : “127230”,
“qty” : “100”,
“prd” : “C”,
“status”: “Open”,
“trantype” : “B”,
“prctyp” : ”LMT”,
“fillshares” : “0”,
“avgprc” : “0”,
“exchordid” : “250620000000343421”,
“uid” : “VIDYA”,
“actid” : “CLIENT1”,
“ret” : “DAY”,
“amo” : “Yes”
},
{
“stat” : “Ok”,
“exch” : “NSE” ,
“tsym” : “ABB-EQ” ,
“norenordno” : “20062500000002543”,
“prc” : “127830”,
“qty” : “50”,
“prd” : “C”,
“status”: “REJECT”,
“trantype” : “B”,
“prctyp” : ”LMT”,
“fillshares” : “0”,
“avgprc” : “0”,
“rejreason” : “Insufficient funds”
“uid” : “VIDYA”,
“actid” : “CLIENT1”,
“ret” : “DAY”,
“amo” : “No”
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Example:
curl https://api.shoonya.com/NorenWClientTP/OrderBook \
-d "jData={\"uid\":\"VIDYA\"}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”
Order Book
Request to be POSTed to uri : /NorenWClientTP/OrderBook
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
prd H / M / ... Product name
Response Details :
Response data will be in json Array of objects with below fields in case of success.
{
"stat": "Ok",
"norenordno": "20121300065716",
"uid": "DEMO1",
"actid": "DEMO1",
"exch": "NSE",
"tsym": "ACCELYA-EQ",
"qty": "180",
"trantype": "B",
"prctyp": "LMT",
"ret": "DAY",
"token": "7053",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"avgprc": "800.00",
"dscqty": "0",
"prd": "M",
"status": "COMPLETE",
"rpt": "Fill",
"fillshares": "180",
"norentm": "19:59:32 13-12-2020",
"exch_tm": "00:00:00 01-01-1980",
"remarks": "WC TEST Order",
"exchordid": "6858"
},
{
"stat": "Ok",
"norenordno": "20121300065716",
"uid": "DEMO1",
"actid": "DEMO1",
"exch": "NSE",
"tsym": "ACCELYA-EQ",
"qty": "180",
"trantype": "B",
"prctyp": "LMT",
"ret": "DAY",
"token": "7053",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"dscqty": "0",
"prd": "M",
"status": "OPEN",
"rpt": "New",
"norentm": "19:59:32 13-12-2020",
"exch_tm": "00:00:00 01-01-1980",
"remarks": "WC TEST Order",
"exchordid": "6858"
},
{
"stat": "Ok",
"norenordno": "20121300065716",
"uid": "DEMO1",
"actid": "DEMO1",
"exch": "NSE",
"tsym": "ACCELYA-EQ",
"qty": "180",
"trantype": "B",
"prctyp": "LMT",
"ret": "DAY",
"token": "7053",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"dscqty": "0",
"prd": "M",
"status": "PENDING",
"rpt": "PendingNew",
"norentm": "19:59:32 13-12-2020",
"remarks": "WC TEST Order"
},
{
"stat": "Ok",
"norenordno": "20121300065716",
"uid": "DEMO1",
"actid": "DEMO1",
"exch": "NSE",
"tsym": "ACCELYA-EQ",
"qty": "180",
"trantype": "B",
"prctyp": "LMT",
"ret": "DAY",
"token": "7053",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"prd": "M",
"status": "PENDING",
"rpt": "NewAck",
"norentm": "19:59:32 13-12-2020",
"remarks": "WC TEST Order"
}
Example:
curl https://api.shoonya.com/NorenWClientTP/SingleOrdHist \
-d "jData={\"uid\":\"VIDYA\"}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”
Single Order History
Request to be POSTed to uri : /NorenWClientTP/SingleOrdHist
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
norenordno* H / M / ... Noren Order Number
Response Details :
Response data will be in json Array of objects with below fields in case of success.
curl https://api.shoonya.com/NorenWClientTP/SingleOrdStatus \
-d "jData={\"uid\":\"VIDYA\"}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”
[
{
"stat": "Ok",
"norenordno": "23072300000001",
"kidid": "1",
"uid": "TESTINV",
"src_uid": "",
"actid": "TESTINV",
"exch": "NSE",
"tsym": "ACC-EQ",
"qty": "250",
"trantype": "S",
"prctyp": "LMT",
"ret": "DAY",
"rejby": "RED",
"pan": "AAAAA1234A",
"ordersource": "WEB",
"token": "22",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "2400.00",
"dscqty": "0",
"s_prdt_ali": "Regular",
"prd": "M",
"status": "REJECTED",
"st_intrn": "REJECTED",
"rpt": "Rejected",
"ordenttm": "1690107153",
"norentm": "15:42:33 23-07-2023",
"remarks": "WC TEST Order",
"rejreason": "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-TESTINV [DEFAULT]",
"introp_exch": "EQT"
}
]
Single Order Status
Request to be POSTed to uri : /NorenWClientTP/SingleOrdStatus
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
norenordno* - Noren Order Number
actid* - Account id for which order was placed.
exch* - Exchange on which order was placed.
Response Details :
Response data will be in json Array of objects with below fields in case of success (but only 1 object will
be there in json array, unlike single order history, this is kept to help easy migration from single order
history to single order status, where user is only interested in the status).
curl https://api.shoonya.com/NorenWClientTP/TradeBook \
-d "jData={\"uid\":\"VIDYA\", \“actid\”:\”DEMO1\”}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR
{
"stat": "Ok",
"norenordno": "20121300065715",
"uid": "GURURAJ",
"actid": "GURURAJ",
"exch": "NSE",
"prctyp": "LMT",
"ret": "DAY",
"prd": "M",
"flid": "102",
"fltm": "01-01-1980 00:00:00",
"trantype": "S",
"tsym": "ACCELYA-EQ",
"qty": "180",
"token": "7053",
"fillshares": "180",
"flqty": "180",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"flprc": "800.00",
"norentm": "19:59:32 13-12-2020",
"exch_tm": "00:00:00 01-01-1980",
"remarks": "WC TEST Order",
"exchordid": "6857"
},
{
"stat": "Ok",
"norenordno": "20121300065716",
"uid": "GURURAJ",
"actid": "GURURAJ",
"exch": "NSE",
"prctyp": "LMT",
"ret": "DAY",
"prd": "M",
"flid": "101",
"fltm": "01-01-1980 00:00:00",
"trantype": "B",
"tsym": "ACCELYA-EQ",
"qty": "180",
"token": "7053",
"fillshares": "180",
"flqty": "180",
"pp": "2",
"ls": "1",
"ti": "0.05",
"prc": "800.00",
"flprc": "800.00",
"norentm": "19:59:32 13-12-2020",
"exch_tm": "00:00:00 01-01-1980",
"remarks": "WC TEST Order",
"exchordid": "6858"
}
Trade Book
Request to be POSTed to uri : /NorenWClientTP/TradeBook
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Account Id of logged in user
Response Details :
Response data will be in json Array of objects with below fields in case of success.
curl https://api.shoonya.com/NorenWClientTP/PositionBook \
-d "jData={\"uid\":\"VIDYA\", \”actid\”:\”ACCT_1\”}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”
{
"stat":"Ok",
"uid":"POORNA",
"actid":"POORNA",
"exch":"NSE",
"tsym":"ACC-EQ",
"prarr":"C",
"pp":"2",
"ls":"1",
"ti":"5.00",
"mult":"1",
"prcftr":"1.000000",
"daybuyqty":"2",
"daysellqty":"2",
"daybuyamt":"2610.00",
"daybuyavgprc":"1305.00",
"daysellamt":"2610.00",
"daysellavgprc":"1305.00",
"cfbuyqty":"0",
"cfsellqty":"0",
"cfbuyamt":"0.00",
"cfbuyavgprc":"0.00",
"cfsellamt":"0.00",
"cfsellavgprc":"0.00",
"openbuyqty":"0",
"opensellqty":"23",
"openbuyamt":"0.00",
"openbuyavgprc":"0.00",
"opensellamt":"30015.00",
"opensellavgprc":"1305.00",
"netqty":"0",
"netavgprc":"0.00",
"lp":"0.00",
"urmtom":"0.00",
"rpnl":"0.00",
"cforgavgprc":"0.00"
}
{
"stat":"Not_Ok",
"request_time":"14:14:11 26-05-2020",
"emsg":"Error Occurred : 5 \"no data\""
}
Positions Book
Request to be POSTed to uri : /NorenWClientTP/PositionBook
Warning Note: This endpoint should be strictly used as a single call for fetching m2m without a while
loop. For live m2m tracking please use the web socket feed for fetching real time prices and computing
the m2m.
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Account Id of logged in user
Response Details :
Response data will be in json Array of objects with below fields in case of success.
"request_time":"10:52:12 02-06-2020",
"stat":"Ok"
}
Product Conversion
Request to be POSTed to uri : /NorenWClientTP/ProductConversion
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
NSE / NFO /
exch* Exchange
BSE / MCX / BFO
Unique id of contract on which order was placed. Can’t be modified,
tsym* - must be the same as url encoding to avoid special char error for symbols
like M&M)
qty* - Quantity to be converted.
uid* - User id of the logged in user.
actid* - Account id
prd* - Product to which the user wants to convert position.
prevprd* - Original product of the position.
trantype* - Transaction type
postype* Day / CF Converting Day or Carry forward position
ordersource
MOB For Logging
*
Response Details :
Response data will be in json format with below fields.
"stat":"Ok",
"exch_tsym":[
{
"exch":"NSE",
"token":"13",
"tsym":"ABB-EQ"
}
],
"holdqty":"2000000",
"colqty":"200",
"btstqty":"0",
"btstcolqty":"0",
"usedqty":"0",
"upldprc" : "1800.00"
},
{
"stat":"Ok",
"exch_tsym":[
{
"exch":"NSE",
"token":"22",
"tsym":"ACC-EQ"
}
],
"holdqty":"2000000",
"colqty":"200",
"btstqty":"0",
"btstcolqty":"0",
"usedqty":"0",
"upldprc" : "1400.00"
{
"stat":"Not_Ok",
"emsg":"Invalid Input : Missing uid or actid or prd."
}
Holdings
Request to be POSTed to uri : /NorenWClientTP/Holdings
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Account id of the logged in user.
prd* - Product name
Response Details :
Response data will be in json Array of objects with below fields in case of success.
{
"request_time":"18:07:31 29-05-2020",
"stat":"Ok",
"cash":"1500000000000000.00",
"payin":"0.00",
"payout":"0.00",
"brkcollamt":"0.00",
"unclearedcash":"0.00",
"daycash":"0.00",
"turnoverlmt":"50000000000000.00",
"pendordvallmt":"2000000000000000.00",
"turnover":"3915000.00",
"pendordval":"2871000.00",
"marginused":"3945540.00",
"mtomcurper":"0.00",
"urmtom":"30540.00",
"grexpo":"3915000.00",
"uzpnl_e_i":"15270.00",
"uzpnl_e_m":"61080.00",
"uzpnl_e_c":"-45810.00"
}
{
"stat":"Not_Ok",
"emsg":"Server Timeout : "
}
Limits
Request to be POSTed to uri : /NorenWClientTP/Limits
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
actid* - Account id of the logged in user.
prd - Product name
seg CM / FO / FX Segment
exch - Exchange
Response Details :
Response data will be in json format with below fields.
Possible
Json Fields Description
value
Ok or
stat Limits request success or failure indication.
Not_Ok
actid - Account id
prd - Product name
seg CM / FO / FX Segment
exch - Exchange
------Cash Primary Fields-------
cash - Cash Margin available
payin - Total Amount transferred using Payins today
payout - Total amount requested for withdrawal today
---Cash Additional Fields-----
brkcollamt - Prevalued Collateral Amount
unclearedcash - Uncleared Cash (Payin through cheques)
Additional leverage amount / Amount added to handle system errors
daycash -
- by broker.
----Margin Utilized-----
marginused - Total margin / fund used today
mtomcurper - Mtom current percentage
----Margin Used components----
cbu - CAC Buy used
csc - CAC Sell Credits
rpnl - Current realized PNL
unmtom - Current unrealized mtom
marprt - Covered Product margins
span - Span used
expo - Exposure margin
premium - Premium used
Possible
Json Fields Description
value
varelm - Var Elm Margin
grexpo - Gross Exposure
greexpo_d - Gross Exposure derivative
scripbskmar - Scrip basket margin
addscripbskmrg - Additional scrip basket margin
brokerage - Brokerage amount
collateral - Collateral calculated based on uploaded holdings
grcoll - Valuation of uploaded holding pre haircut
Valuation of uploaded holding pre haircut
turnoverlmt - -
pendordvallmt - -
-------Additional Risk Indicators------
turnover - Turnover
pendordval - Pending Order value
------Margin used detailed breakup fields----
rzpnl_e_i - Current realized PNL (Equity Intraday)
rzpnl_e_m - Current realized PNL (Equity Margin)
rzpnl_e_c - Current realized PNL (Equity Cash n Carry)
rzpnl_d_i - Current realized PNL (Derivative Intraday)
rzpnl_d_m - Current realized PNL (Derivative Margin)
rzpnl_f_i - Current realized PNL (FX Intraday)
rzpnl_f_m - Current realized PNL (FX Margin)
rzpnl_c_i - Current realized PNL (Commodity Intraday)
rzpnl_c_m - Current realized PNL (Commodity Margin)
uzpnl_e_i - Current unrealized MTOM (Equity Intraday)
uzpnl_e_m - Current unrealized MTOM (Equity Margin)
uzpnl_e_c - Current unrealized MTOM (Equity Cash n Carry)
uzpnl_d_i - Current unrealized MTOM (Derivative Intraday)
uzpnl_d_m - Current unrealized MTOM (Derivative Margin)
uzpnl_f_i - Current unrealized MTOM (FX Intraday)
uzpnl_f_m - Current unrealized MTOM (FX Margin)
uzpnl_c_i - Current unrealized MTOM (Commodity Intraday)
uzpnl_c_m - Current unrealized MTOM (Commodity Margin)
span_d_i - Span Margin (Derivative Intraday)
span_d_m - Span Margin (Derivative Margin)
span_f_i - Span Margin (FX Intraday)
span_f_m - Span Margin (FX Margin)
span_c_i - Span Margin (Commodity Intraday)
span_c_m - Span Margin (Commodity Margin)
expo_d_i - Exposure Margin (Derivative Intraday)
expo_d_m - Exposure Margin (Derivative Margin)
expo_f_i - Exposure Margin (FX Intraday)
expo_f_m - Exposure Margin (FX Margin)
expo_c_i - Exposure Margin (Commodity Intraday)
expo_c_m - Exposure Margin (Commodity Margin)
Possible
Json Fields Description
value
premium_d_i - Option premium (Derivative Intraday)
premium_d_m - Option premium (Derivative Margin)
premium_f_i - Option premium (FX Intraday)
premium_f_m - Option premium (FX Margin)
premium_c_i - Option premium (Commodity Intraday)
premium_c_m - Option premium (Commodity Margin)
varelm_e_i - Var Elm (Equity Intraday)
varelm_e_m - Var Elm (Equity Margin)
varelm_e_c - Var Elm (Equity Cash n Carry)
marprt_e_h - Covered Product margins (Equity High leverage)
marprt_e_b - Covered Product margins (Equity Bracket Order)
marprt_d_h - Covered Product margins (Derivative High leverage)
marprt_d_b - Covered Product margins (Derivative Bracket Order)
marprt_f_h - Covered Product margins (FX High leverage)
marprt_f_b - Covered Product margins (FX Bracket Order)
marprt_c_h - Covered Product margins (Commodity High leverage)
marprt_c_b - Covered Product margins (Commodity Bracket Order)
scripbskmar_e_i - Scrip basket margin (Equity Intraday)
scripbskmar_e_m - Scrip basket margin (Equity Margin)
scripbskmar_e_c - Scrip basket margin (Equity Cash n Carry)
addscripbskmrg_d_i - Additional scrip basket margin (Derivative Intraday)
addscripbskmrg_d_
- Additional scrip basket margin (Derivative Margin)
m
addscripbskmrg_f_i - Additional scrip basket margin (FX Intraday)
addscripbskmrg_f_m - Additional scrip basket margin (FX Margin)
addscripbskmrg_c_i - Additional scrip basket margin (Commodity Intraday)
addscripbskmrg_ - Additional scrip basket margin (Commodity Margin)
c_m - -
brkage_e_i - Brokerage (Equity Intraday)
brkage_e_m - Brokerage (Equity Margin)
brkage_e_c - Brokerage (Equity CAC)
brkage_e_h - Brokerage (Equity High Leverage)
brkage_e_b - Brokerage (Equity Bracket Order)
brkage_d_i - Brokerage (Derivative Intraday)
brkage_d_m - Brokerage (Derivative Margin)
brkage_d_h - Brokerage (Derivative High Leverage)
brkage_d_b - Brokerage (Derivative Bracket Order)
brkage_f_i - Brokerage (FX Intraday)
brkage_f_m - Brokerage (FX Margin)
brkage_f_h - Brokerage (FX High Leverage)
brkage_f_b - Brokerage (FX Bracket Order)
brkage_c_i - Brokerage (Commodity Intraday)
brkage_c_m - Brokerage (Commodity Margin)
brkage_c_h - Brokerage (Commodity High Leverage)
brkage_c_b - Brokerage (Commodity Bracket Order)
Possible
Json Fields Description
value
peak_mar - Peak margin used by the client
request_time - This will be present only in a successful response.
emsg - This will be present only in a failure response.
Sample Success Output:
{
"request_time":"11:22:26 08-04-2021",
"stat":"Oi created",
“al_id”:”21040800000004”
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Set Alert
Request to be POSTed to uri : /NorenWClientTP/SetAlert
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
tsym* - Trading symbol
exch* - Exchange Segment
ai_t* - Alert type
validity* DAY or GTT Validity
d - Data to be compared with LTP
remarks* - Any message Entered during order entry.
Response Details :
Response data will have below fields.
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Cancel Alert
Request to be POSTed to uri : /NorenWClientTP/CancelAlert
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
ai_t* - Alert ID
Response Details :
Response data will have below fields.
{
"request_time":"16:36:42 08-04-2021",
"stat":"Oi Replaced",
“al_id”:”21040800000013”
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Modify Alert
Request to be POSTed to uri : /NorenWClientTP/ModifyAlert
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
ai_t* - Alert ID
Response Details :
Response data will have below fields.
{
"Stat":"ok",
“ai_t”:”LTP_A”,
“al_id”:”21040800000008”,
“tsym”:”ACC-EQ”,
“exch”:”NSE”
“token”:”22”,
“remarks”:”test”,
“validity”:”DAY”,
“d”:”95000.00”
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
Response Details :
Response data will have below fields.
{
"stat":"Ok",
"request_time":"04062021121503",
"ai_ts":
[
{"ai_t":"ATP"},
{"ai_t":"LTP"},
{"ai_t":"Perc. Change"}
]
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - User id of the logged in user.
Response Details :
Response data will have below fields.
{
"request_time":"10:02:06 15-04-2021",
"stat":"Oi created",
"Al_id":"21041500000010"
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json
Possible value Description
Fields
uid* - User id of the logged in user.
tsym* - Trading symbol
exch* - Exchange Segment
ai_t* - Alert type
validity* DAY or GTT validity
d - Data to be compared with LTP
remarks* - Any message Entered during order entry.
trantype* B / S B -> BUY, S -> SELL
LMT / MKT / SL-LMT / SL-MKT / DS /
prctyp* -
2L / 3L
prd* C/M/H Product name
Retention type (Show options as per allowed
ret* DAY / EOS / IOC
exchanges)
actid* - Login users account ID
qty* - Order Quantity
prc* - Order Price
Disclosed quantity (Max 10% for NSE, and 50%
dscqty -
for MCX)
Response Details :
Response data will have below fields.
Possible
Json Fields Description
value
stat - GTT order success or failure indication.
This will be present only in a successful
request_time -
response.
al_id - Alert Id
This will be present only in case of errors.
That is :
1) Invalid Input
2) Session Expired
Sample Success Output:
{
"request_time":"12:20:01 15-04-2021",
"stat":"Oi delete success",
"Al_id":"21041500000013"
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid - User id of the logged in user.
al_id* - Alert Id
Response Details :
Response data will have below fields.
{
"stat":"Ok",
"ai_t":"LTP_A",
"Al_id":"21041500000002",
"tsym":"ACC-EQ",
"exch":"NSE",
"Token":"22",
"Remarks":"test",
"validity":"DAY",
"actid":"MOHINI",
"trantype":"B",
"prctyp":"LMT",
"Qty":1,
"Prc":"1305.00",
"C":"C",
"prd":"C",
"ordersource":"MOB",
"d":"1900.00"
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid - User id of the logged in user.
Response Details :
Response data will have below fields.
Json
Possible value Description
Fields
stat - alert success or failure indication.
ai_t - Alert type
al_id - Alert Id
tsym - Trading symbol
exch - Exchange Segment
token - Contract token
remarks* - Any message Entered during order entry.
validity DAY or GTT validity
Json
Possible value Description
Fields
d - Data to be compared with LTP
trantype B/S B -> BUY, S -> SELL
LMT / MKT / SL-LMT / SL-MKT / DS /
prctyp -
2L / 3L
prd C/M/H Product name
Retention type (Show options as per allowed
ret DAY / EOS / IOC
exchanges)
actid - Login users account ID
qty - Order Quantity
prc - Order Price
This will be present only in case of errors. That
is :
emsg -
1) Invalid Input
2) Session Expired
Sample Success Output:
{
"stat":"Ok",
"request_time":"04062021121503",
"ai_ts":
[
{"ai_t":"ATP"},
{"ai_t":"LTP"}
]
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid - User id of the logged in user.
Response Details :
Response data will have below fields.
Json Fields Possible value Description
stat - GTT order success or failure indication.
request_time - This will be present only in a successful response.
ai_ts - Array of alert types
Connect
Request to be POSTed to uri: wss://api.shoonya.com/NorenWSTP/
Request :
Json Fields Possible value Description
t c ‘c’ represents connect task
uid - User ID
actid - Account id
source WEB / MOB Source should be same as login request.
susertoken - User Session Token
Response :
Json Fields Possible value Description
t ck ‘ck’ represents connect acknowledgement
uid - User ID
s - Ok or Not_Ok(in case of invalid user id or session id)
Subscribe Touchline
Request :
Possible
Json Fields Description
value
t t ‘t’ represents touchline task
One or more scriplist for subscription. Example NSE|22#BSE|508123#NSE|
k -
NIFTY
Subscription Acknowledgement :
Number of Acknowledgements for a single subscription will be the same as the number of scrips
mentioned in the key (k) field.
Unsubscribe Touchline
Request :
Json Fields Possible value Description
t u ‘u’ represents Unsubscribe Touchline
k - One or more scriplist for unsubscription. Example NSE|22#BSE|508123
Response :
Json Fields Possible value Description
t uk ‘uk’ represents Unsubscribe Touchline acknowledgement
k - One or more scriplist for unsubscription. Example NSE|22#BSE|508123
Sample Message:
{
"t": "df",
"e": "NSE",
"tk": "22",
"o": "1166.00",
"h": "1179.00",
"l": "1145.35",
"c": "1152.65",
"ap": "1159.74",
"v": "819881",
"tbq": "120952",
"tsq": "131730",
"bp1": "1156.00",
"sp1": "1156.50",
"bp2": "1155.80",
"sp2": "1156.55",
"bp3": "1155.75",
"sp3": "1156.65",
"bp4": "1155.70",
"sp4": "1156.70",
"bp5": "1155.65",
"sp5": "1156.75",
"bq1": "4",
"sq1": "10",
"bq2": "67",
"sq2": "63",
"bq3": "83",
"sq3": "1",
"bq4": "139",
"sq4": "53",
"bq5": "393",
"sq5": "94"
}
Subscribe Depth
Request :
Json Fields Possible value Description
t d ‘d’ represents depth subscription
k - One or more scriplist for subscription. Example NSE|22#BSE|508123
Subscription Depth Acknowledgement :
Number of Acknowledgements for a single subscription will be the same as the number of scrips
mentioned in the key (k) field.
Unsubscribe Depth
Request :
Json Fields Possible value Description
t ud ‘ud’ represents Unsubscribe depth
k - One or more scriplist for unsubscription. Example NSE|22#BSE|508123
Response :
Json Fields Possible value Description
t udk ‘udk’ represents unsubscribe depth acknowledgement
k - One or more scriplist for unsubscription. Example NSE|22#BSE|508123
Click on the API Key then click at generate & Copy it from there.
MCX - Commodity
https://api.shoonya.com/MCX_symbols.txt.zip
NCDEX - Commodity
https://api.shoonya.com/NCX_symbols.txt.zip
Rate Limit
Timeframe Rate Limit
Per Second 20
Per Minute 200
jData={"uid":""}&jKey=552636ffd5d8f659235e4af6dab0bccd
cd5915d26ca07a074a4912e506ea960f
{
"values": [
"NIFTY2",
"NIFTY50"
]
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
wlname* - Name of the Watchlist, for which scrip list is required.
Response Details :
Response data will be in json format with below fields.
jData={"uid":"","wlname":"NIFTY50"}&jKey=552636ffd5d8f659235e4af6dab0bccdcd
5915d26ca07a074a4912e506ea960f
{
"stat": "Ok",
"values": [
{
"exch": "NSE",
"token": "15083",
"tsym": "ADANIPORTS-EQ",
"pp": "2",
"ls": "1",
"ti": "0.05"
},
{
"exch": "NSE",
"token": "236",
"tsym": "ASIANPAINT-EQ",
"pp": "2",
"ls": "1",
"ti": "0.05"
},
{
"exch": "NSE",
"token": "5900",
"tsym": "AXISBANK-EQ",
"pp": "2",
"ls": "1",
"ti": "0.05"
},
{
"exch": "NSE",
"token": "16669",
"tsym": "BAJAJ-AUTO-EQ",
"pp": "2",
"ls": "1",
"ti": "0.05"
},
{
"exch": "NSE",
"token": "16675",
"tsym": "BAJAJFINSV-EQ",
"pp": "2",
"ls": "1",
"ti": "0.05"
},
{
"exch": "NSE",
"token": "317",
"tsym": "BAJFINANCE-EQ",
"pp": "2","
ls": "1",
"ti": "0.05"
},
....
]
}
Get list of predefined MW scrips
Request to be POSTed to uri : /NorenWClientTP/PreDefinedMW
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
wlname* - Name of the Watchlist, for which scrip list is required.
Response Details :
Response data will be in json format with below fields.
{
"request_time": "20:12:29 13-12-2020",
"values": [
{
"idxname": "HangSeng BeES-NAV",
"token": "26016"
},
{
"idxname": "India VIX",
"token": "26017"
},
{
"idxname": "Nifty 50",
"token": "26000"
},
{
"idxname": "Nifty IT",
"token": "26008"
},
{
"idxname": "Nifty Next 50",
"token": "26013"
},
{
"idxname": "Nifty Bank",
"token": "26009"
},
{
"idxname": "Nifty 500",
"token": "26004"
},
{
"idxname": "Nifty 100",
"token": "26012"
},
{
"idxname": "Nifty Midcap 50",
"token": "26014"
},
{
"idxname": "Nifty Realty",
"token": "26018"
},
]
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
Parameter Name Possible value Description
exch* - Exchange
Response Details :
Response data will be in json format with below fields.
{
"request_time":"13:08:22 03-06-2020",
"values":[
{
"bskt":"NSEBL",
"crt":"VOLUME"
},
{
"bskt":"NSEBL",
"crt":"LTP"
},
{
"bskt":"NSEBL",
"crt":"VALUE"
},
{
"bskt":"NSEEQ",
"crt":"VOLUME"
},
{
"bskt":"NSEEQ",
"crt":"LTP"
},
{
"bskt":"NSEEQ",
"crt":"VALUE”
},
{
"bskt":"NSEALL",
"crt":"VOLUME"
},
{
"bskt":"NSEALL",
"crt":"LTP"
},
{
"bskt":"NSEALL",
"crt":"VALUE"
}
]
}
Sample Failure Response:
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch* - Exchange
Response Details :
Response data will be in json format with below fields.
[
{
"stat":"Ok",
"request_time":"15:44:45 03-06-2020",
"values":[
{
"tsym":"AIRAN-EQ",
"lp":"950.00",
"c":"915.00",
"v":"42705",
"value":"40185405.00",
"oi":"0",
"Pc":"3.83"
},
{
"tsym":"SHRENIK-EQ",
"lp":"1850.00",
"c":"1785.00",
"v":"206846",
"value":"368806418.00",
"oi":"0",
"Pc":"3.64”
},
{
"tsym":"REMSONSIND-EQ",
"lp":"6000.00",
"c":"5795.00",
"v":"3948",
"value":"22752324.00",
"Oi":"0",
"pc":"3.54"
},
{
"tsym":"AXISNIFTY-EQ",
"lp":"106700.00",
"c":"103301.00",
"v":"422",
"value":"43825544.00",
"oi":"0",
"Pc":"3.29"
}
]
}
]
{
"stat":"Not_Ok",
"emsg":"Invalid Input : Missing uid or exch or bskt or tb or crt"
}
Get Top List
Request to be POSTed to uri : /NorenWClientTP/TopList
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch* - Exchange
tb* T or B Top or Bottom
bskt* - Basket name
crt* - criteria
Response Details :
Response data will be in json format with below fields.
[
{
"stat":"Ok",
"time":"02-06-2020 15:46:23",
"into":"0.00",
"inth":"0.00",
"intl":"0.00",
"intc":"0.00",
"intvwap":"0.00",
"intv":"0",
"intoi":"0",
"v":"980515",
"oi":"128702"
},
{
"stat":"Ok",
"time":"02-06-2020 15:45:23",
"into":"0.00",
"inth":"0.00",
"intl":"0.00",
"intc":"0.00",
"intvwap":"0.00",
"intv":"0",
"intoi":"0",
"v":"980515",
"oi":"128702"
}, {
"stat":"Ok",
"time":"02-06-2020 15:44:23",
"into":"0.00",
"inth":"0.00",
"intl":"0.00",
"intc":"0.00",
"intvwap":"0.00",
"intv":"0",
"intoi":"0",
"v":"980515",
"oi":"128702"
},{
"stat":"Ok",
"time":"02-06-2020 15:43:23",
"into":"1287.00",
"inth":"1287.00",
"intl":"0.00",
"intc":"1287.00",
"intvwap":"128702.00",
"intv":"4",
"intoi":"128702",
"v":"980515",
"oi":"128702"
},{
"stat":"Ok",
"time":"02-06-2020 15:42:23",
"into":"0.00",
"inth":"0.00",
"intl":"0.00",
"intc":"0.00",
"intvwap":"0.00",
"intv":"0",
"intoi":"0",
"v":"980511",
"oi":"128702"
}
]
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Get Time Price Data (Chart data)
Request to be POSTed to uri : /NorenWClientTP/TPSeries
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch* - Exchange
token* - -
st - Start time (seconds since 1 jan 1970)
et - End Time (seconds since 1 jan 1970)
Response Details :
Response data will be in json format in case for failure
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Possible
Description
Fields value
uid* - Logged in User Id
tsym* Trading symbol of any of the option or future. Option chain for that underlying
will be returned. (use url encoding to avoid special char error for symbols like
Parameter Name Possible value Description
M&M)
Exchange (UI need to check if exchange in NFO / CDS / MCX / or any other
exch*
exchange which has options, if not don't allow)
strprc* Mid price for option chain selection
Number of strike to return on one side of the mid price for PUT and CALL.
cnt* (example cnt is 4, total 16 contracts will be returned, if cnt is is 5 total 20 contract
will be returned)
Response Details :
Response data will be in json format in case for failure
curl https://api.shoonya.com/NorenWClientTP/ExchMsg \
-d "jData={\"uid\":\"VIDYA\"}“ \
-d “jKey=NSE”
Exch Msg
Request to be POSTed to uri : /NorenWClientTP/ExchMsg
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
exch* Exchange (Select from ‘exarr’ Array provided in User Details response)
Response Details :
Response data will be in json format with below fields in case of success.
[
{
"stat": "Ok",
"norentm": "02-05-1975 08:48:52",
"msgtyp": "Admin Message",
"dmsg": "Test Msg All Message Recovery2"
},
{
"stat": "Ok",
"norentm": "02-05-1975 08:48:52",
"msgtyp": "Admin Message",
"dmsg": "Test Msg All Message Recovery2"
}
]
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* Key Obtained on login success.
Json Fields Possible value Description
uid* - Logged in User Id
Response Details :
Response data will be in json format with below fields in case of success.
Json Possible
Description
Fields value
stat Ok Broker Msg success or failure indication
This will be present only in case of success. Number of days to expiry will be
dmsg
present in same.
Json Possible
Description
Fields value
norentm Noren Time
top / bottom contracts object :
Json Fields Possible value Description
tsym - Trading symbol
lp - LTP
c - Previous Close price
v - volume
value - Total traded value
oi - Open interest
pc - LTP percentage change
Span Calculator
Request to be POSTed to uri : /NorenWClientTP/SpanCalc
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
Json Fields Possible value Description
Any Account id, preferably actual account id if sending from post login
actid*
screen
pos* Array of json objects. (object fields given in below table)
Json Fields of object in values
Possible value Description
Array
exch NFO, CDS, MCX, BFO ... Exchange
FUTSTK, FUTIDX, OPTSTK,
instname Instrument name
FUTCUR...
symname USDINR, ACC, ABB, NIFTY.. Symbol name
exd 2020-10-29 YYYY-MM-DD format
optt CE, PE Option Type
strprc 11900.00, 71.0025 Strike price
buyqty Buy Open Quantity
sellqty Sell Open Quantity
netqty Net traded quantity
Response Details :
Response data will be in json format with below fields.
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* User id of the logged in user.
Response Details :
Response data will have below fields.
{
"request_time":"15:52:26 10-05-2021",
"stat":"Ok",
"actid":"FA12345",
"payout":"21200.20"
}
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* User id of the logged in user.
actid* Login users account ID.
Response Details :
Response data will have below fields.
{
"request_time":"18:51:38 25-06-2021",
"stat":"Ok",
"basketlists":
[
{"basket":"NSEEQ"},
{"basket":"BSEEQ"},
{"basket":"A"}
]
}
Sample Failure Response:
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* User id of the logged in user.
exch* Exchange name
Response Details :
Response data will have below fields.
[
{
"request_time":"18:51:38 25-06-2021",
"stat":"Ok",
"tsym":"AUROPHARMA-EQ",
"lp":"1450.00",
"c":"0.00",
"h":"0.00",
"l":"0.00",
"ap":"0.00",
"v":"0",
"ltt":"05:30:00",
"Pc":"0.00"
},
{
"request_time":"18:51:38 25-06-2021",
"stat":"Ok",
"tsym":"3IINFOTECH-EQ",
"lp":"1.10",
"c":"0.90",
"h":"1.15",
"l":"1.10",
"ap":"0.98",
"v":"20",
"ltt":"05:31:40",
"Pc":"0.00"
}
]
{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}
Request Details :
Parameter Name Possible value Description
jData* - Should send json object with fields in below list
jKey* - Key Obtained on login success.
Json Fields Possible value Description
uid* User id of the logged in user.
exch* Exchange name
UpperCircuit
LowerCircuit
OpenHigh
condition_name* condition list
OpenLow
HighBreak
LowBreak
basket Basket name
Response Details :
Response data will have below fields.
Alert Type
Transformation and
Alert Criteria Condition Alert type
data validations
depending on scrip 'pp' from search results allow 2/4
LTP > LTP_A
precision
depending on scrip 'pp' from search results allow 2/4
LTP < LTP_B
precision
Change % > CH_PER_A Upto 2 decimals allowed
Change % < CH_PER_B Upto 2 decimals allowed
Average Trade price depending on scrip 'pp' from search results allow 2/4
> ATP_A
of day precision
Average Trade price depending on scrip 'pp' from search results allow 2/4
< ATP_B
of day precision
LTP vs 52week LTP_A_52HI
> No input data
high GH
LTP vs 52week LTP_B_52LO
< No input data
high W
Volume > VOLUME_A Non decimal number
Non decimal number, allow only for derivative
Open Interest > OI_A
contracts
Non decimal number, allow only for derivative
Open Interest < OI_B
contracts
Non decimal number, this will work only for NSE
Total Open Interest > TOI_A
symbols which are FO listed.
Non decimal number, this will work only for NSE
Total Open Interest < TOI_B
symbols which are FO listed.
Both > and depending on scrip 'pp' from search results allow 2/4
LTP LMT_BOS_O
< precision
Note:All alert types with _O appended will work for GTT order types. Example: to set GTT order when
LTP goes above 1,000, set alert type as LTP_A_O