0% found this document useful (0 votes)
396 views83 pages

Shoonya Api

The document provides a comprehensive overview of the Finvasia API, detailing various functionalities including user authentication, order management, market information, and alerts. It includes specific API endpoints for actions such as login, logout, password management, and trading operations, along with sample request and response formats. Additionally, it outlines SDKs available for Python, .Net, and Node JS, as well as an AMI broker plugin.

Uploaded by

tapanhaznew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
396 views83 pages

Shoonya Api

The document provides a comprehensive overview of the Finvasia API, detailing various functionalities including user authentication, order management, market information, and alerts. It includes specific API endpoints for actions such as login, logout, password management, and trading operations, along with sample request and response formats. Additionally, it outlines SDKs available for Python, .Net, and Node JS, as well as an AMI broker plugin.

Uploaded by

tapanhaznew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 83

Back to API

 Last Updated: - 21st Dec, 2023

 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

 AMI broker plugin


 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\"}"

Sample Success Response :

{
"request_time": "20:18:47 19-05-2020",
"stat": "Ok",
"susertoken": "3b97f4c67762259a9ded6dbd7bfafe2787e662b3870422ddd343a59895f423a0",
"lastaccesstime": "1589899727"
}

Sample Failure Response :

{
"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"
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Logout Success Or failure status
Json Fields Possible value Description
request_time - It will be present only on successful logout.
emsg - This will be present only if Logout fails.
Sample Success Response:

{
"request_time":"10:52:56 28-05-2020",
"stat":"Ok"
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Password reset is Success Or failure status
request_time - Response received time.
This will be present only if password reset fails. (“Invalid User or User
emsg -
Details”)
Sample Success Response:

{
"request_time":"10:20:04 27-05-2020",
"stat":"Ok",
“dmag”:”Password Change Success. Your new password will expire in 15”
}

Sample Failure Response:

{
"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"
}

Sample Failure Response:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"

Set Device Pin


Request to be POSTed to uri : /NorenWClientTP/SetPin
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
imei* - Imei or device unique fingerprint
source* - Access type (API)
dpin* - New pin in plain text
Response Details :
Response data will be in json format with below fields.

Json Fields Possible value Description


stat Ok or Not_Ok If Pin setting is Success Or failure status
request_time - This will be present only if password change succeeds.
emsg - This will be present only if password change fails
Sample Success Response:

{
"request_time":"17:01:45 27-05-2020",
"stat":"Ok",
"susertoken":"b0856b3f6c4bac657417fc95de3e2060567b8bd80665e0a8ab82bbde5c434936",
"lastaccesstime":"1590579105"
}

Sample Failure Response:

{
"request_time":"11:19:56 28-05-2020",
"stat":"Not_Ok",
"emsg":"Invalid Input : Mpin Invalid"
}

Login with Device Pin


Request to be POSTed to uri :/NorenWClientTP/PinAuth

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.

Json Fields Possible value Description


stat Ok or Not_Ok If Pin setting is Success Or failure status
request_time - This will be present only if password change succeeds.
One time Token to be sent to BackOffice or third party
hstk -
link
emsg Y This will be present only if password change fails

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"
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok User details success or failure indication.
actid - Account ID
creatdte - Creation date
creattme - Creation time
m_num - Mobile Number
email - Email ID
pan - PAN
addr - Address
addroffice - Office address
addrcity - City
addrstate - State
bankdetails - Array Object, details given below.
dp_acct_num - Array Object, details given below.
addrstate - State
request_time - It will be present only in a successful response.
emsg - This will be present only in case of errors.
bankdetails Obj format :
Json Fields Possible value Description
bankn - Bank name
acctnum - Account number
dp_acct_num Obj format :
Json Fields Possible value Description
dpnum - Dp account number
Sample Success Response:

"request_time":"14:59:43 27-05-2020",
"stat":"Ok"

Sample Failure Response:


{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"

Save FCM token


Request to be POSTed to uri : /NorenWClientTP/SaveFMCToken

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.

Json Fields Possible value Description


stat Ok or Not_Ok If save FCM token is Success Or failure status
request_time - This will be present only if password change succeeds.
emsg - This will be present only if save token fails
Sample Success Response:

{
"request_time": "12:34:52 21-05-2020",
"values": [
"default",
"WL"
],
"stat": "Ok"
}

Sample Failure Response:

{
"stat": "Not_Ok",
"emsg": "Session Expired : Invalid Session Key"
}

Get WatchList Names


Request to be POSTed to uri : /NorenWClientTP/MWList
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.

Json Fields Possible value Description


stat Ok or Not_Ok MWList success or failure indication.
values - Watch List names as a json array of strings.
request_time- It will be present only in a successful response.
This will be present only in case of errors or No WatchLists are set
emsg -
yet.
Sample Success Response:

{
"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"
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Market watch success or failure indication.
values - Array of json objects. (object fields given in below table)
request_time - It will be present only in a successful response.
This will be present only in case of errors. That is :
emsg - 1) Invalid Input : Invalid WatchList Name
2) Session Expired
Json Fields of object in values Array Possible value Description
exch NSE, BSE, NFO ... Exchange
tsym - Trading symbol of the scrip (contract)
token - Token of the scrip (contract)
pp - Price precision
ti - Tick size
ls - Lot size
Sample Success Response:

{
"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"
}
]
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Market watch success or failure indication.
values - Array of json objects. (object fields given in below table)
request_time - It will be present only in a successful response.
This will be present only in case of errors. That is :
emsg - 1) Invalid Input
2) Session Expired
Json Fields of object in values Array Possible value Description
exch NSE, BSE, NFO ... Exchange
tsym - Trading symbol of the scrip (contract)
token - Token of the scrip (contract)
pp - Price precision
ti - Tick size
ls - Lot size
Sample Success Response:

{
"request_time": "13:50:40 21-05-2020",
"stat": "Ok"

Sample Failure Response:

"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Add Scrip to Watch List


Request to be POSTed to uri : /NorenWClientTP/AddMultiScripsToMW

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.

Json Fields Possible value Description


stat Ok or Not_Ok Watch list update success or failure indication.
request_time - It will be present only in a successful response.
This will be present only in case of errors. That is :
emsg - 1) Invalid Input
2) Session Expired
Sample Success Response:

{
"request_time": "13:50:40 21-05-2020",
"stat": "Ok"

Sample Failure Response:

"stat":"Not_Ok",
emsg":"Invalid Input : Missing uid or wlname or scrips."
}

Delete Scrip to Watch List


Request to be POSTed to uri : /NorenWClientTP/DeleteMultiMWScrips

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.

Json Fields Possible value Description


stat Ok or Not_Ok Watch list update success or failure indication.
request_time - It will be present only in a successful response.
This will be present only in case of errors. That is :
emsg - 1) Invalid Input
2) Session Expired
Sample Success Response:
{
request_time": "17:43:38 31-10-2020",
"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",
"prcftr_d": "(1 / 1 ) * (1 / 1)",
"trdunt": "ACC.BO",
"delunt": "ACC",
"token": "22",
"varmrg": "40.00"

Sample Failure Response:

{
"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

Get Security Info


Request to be POSTed to uri : /NorenWClientTP/GetSecurityInfo

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"

Sample Failure Response:

{
"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.

Json Fields Possible value Description


request_time - It will be present only in a successful response.
stat 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
isin - ISIN
ti - Tick Size
ls - Lot Size
pp - Price precision
mult - Multiplier
uc - Upper circuit limitlc
lc - Lower circuit limit
prcftr_d - Price factor ((GN / GD) * (PN/PD))
token - Token
lp - LTP
o - Open Price
h - Day High Price
i - Day Low Price
v - Volume
ltq - Last trade quantity
ltt - Last trade time
bp1 - Best Buy Price 1
Json Fields Possible value Description
sp1 - Best Sell Price 1
bp2 - Best Buy Price 2
sp2 - Best Sell Price 2
bp3 - Best Buy Price 3
sp3 - Best Sell Price 3
bp4 - Best Buy Price 4
sp4 - Best Sell Price 4
bp5 - Best Buy Price 5
sp5 - Best Sell Price 5
bq1 - Best Buy Quantity 1
sq1 - Best Sell Quantity 1
bq2 - Best Buy Quantity 2
sq2 - Best Sell Quantity 2
bq3 - Best Buy Quantity 3
sq3 - Best Sell Quantity 3
bq4 - Best Buy Quantity 4
sq4 - Best Sell Quantity 4
bq5 - Best Buy Quantity 5
sq5 - Best Sell Quantity 5
bo1 - Best Buy Quantity 1
so1 - Best Sell Quantity 1
bo2 - Best Buy Quantity 2
so2 - Best Sell Quantity 2
bo3 - Best Buy Quantity 3
so3 - Best Sell Quantity 3
bo4 - Best Buy Quantity 4
so4 - Best Sell Quantity 4
bo5 - Best Buy Quantity 5
so5 - Best Sell Quantity 5
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\""
}

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.

Json Fields Possible value Description


stat Ok or Not_Ok Place order success or failure indication.
request_time Ok or Not_Ok Place order success or failure indication.
stat - Response received time.
norenordno - It will be present only on successful Order placement to OMS.
emsg - This will be present only if Order placement fails
Sample Success Response:

{
"request_time":"14:14:08 26-05-2020",
"stat":"Ok",
"result":"20052600000103"
}

Sample Failure Response:

{
"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.

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
exch* - Exchange
norenordno
- Noren order number, which needs to be modified
*
LMT / MKT / SL-
prctyp This can be modified.
MKT / SL-LMT
prc - Modified / New price
Modified / New Quantity
Quantity to Fill / Order Qty - This is the total qty to be filled for the
qty - order. Its Open Qty/Pending Qty plus Filled Shares (cumulative for the
order) for the order.
* Please do not send only the pending qty in this field
Unque id of contract on which order was placed. Can’t be modified,
tsym* - must be the same as that of original order. (use url encoding to avoid
special char error for symbols like M&M)
ret DAY / IOC / EOS New Retention type of the order
trgprc - New trigger price in case of SL-MKT or SL-LMT
uid* - User id of the logged in user.
Book Profit Price applicable only if product is selected as B (Bracket
bpprc -
order )
Book loss Price applicable only if product is selected as H and B (High
blprc -
Leverage and Bracket order )
Trailing Price applicable only if product is selected as H and B (High
trailprc -
Leverage and Bracket order )
Response Details :
Response data will be in json format with below fields.

Json Fields Possible value Description


stat Ok or Not_Ok Modify order success or failure indication.
result - Noren Order number of the order modified.
request_time - Response received time.
emsg - This will be present only if Order modification fails
Sample Success Response:

{
"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.

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
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.
result - Noren Order number of the canceled order.
request_time - Response received time.
emsg - This will be present only if Order cancelation fails

Exit SNO Order


Request to be POSTed to uri : /NorenWClientTP/ExitSNOOrder

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.

Json Fields Possible value Description


stat Ok or Not_Ok Place order success or failure indication.
request_time - Response received time.
remarks - This field will be available only on success.
cash - Total credits available for order
marginused - Total margin used.
emsg - This will be present only if Order placement fails.
Basket Margin
Request to be POSTed to uri : /NorenWClientTP/GetBasketMargin

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.

Json Fields Possible value Description


stat Ok or Not_Ok Place order success or failure indication.
request_time - Response received time.
remarks - This field will contain rejection reason.
marginused - Total margin used.
marginusedtrade - Margin used after trade.
emsg - This will be present only if Order placement fails.
Sample Success Response:

{
“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”
}

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Order book success or failure indication.
exch - Exchange Segment
tsym - Trading symbol / contract on which order is placed.
norenordno - Noren Order Number
prc - Order Price
qty - Order Quantity
prd - Display product alias name, using prarr returned in user details.
status - Order status
trantype B/S Transaction type of the order
prctyp LMT / MKT Price type
fillshares - Total Traded Quantity of this order
avgprc - Average trade price of total traded quantity
rejreason - If order is rejected, reason in text form
exchordid - Exchange Order Number
cancelqty - Canceled quantity for order which is in status cancelled.
remarks - Any message Entered during order entry.
dscqty - Order disclosed quantity.
trgprc - Order trigger price
DAY / IOC /
ret Order validity
EOS
uid - -
actid - -
Book Profit Price applicable only if product is selected as B (Bracket
bpprc -
order )
Book loss Price applicable only if product is selected as H and B (High
blprc -
Leverage and Bracket order )
trailprc - Trailing Price applicable only if product is selected as H and B (High
Json Fields Possible value Description
Leverage and Bracket order )
amo - Yes / No
pp - Price precision
ti - Tick size
ls - Lot size
token - Contract Token
norentm - -
ordenttm - -
exch_tm - -
snoordt - 0 for profit leg and 1 for stoploss leg
This field will be present for product H and B; and only if it is profit/sl
snonum -
order.
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Order book failure indication.
request_time - Response received time.
emsg - Error message
Sample Success Output:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Order book success or failure indication.
exch - Exchange Segment
tsym - Trading symbol / contract on which order is placed.
norenordno - Noren Order Number
prc - Order Price
qty - Order Quantity
status - Order status
rpt - Report Type (fill/complete etc)
trantype B/S Transaction type of the order
prctyp LMT / MKT Price type
fillshares - Total Traded Quantity of this order
avgprc - Average trade price of total traded quantity
rejreason - If order is rejected, reason in text form
exchordid - Exchange Order Number
cancelqty - Canceled quantity for order which is in status cancelled.
remarks - Any message Entered during order entry.
dscqty - Order disclosed quantity.
trgprc - Order trigger price
DAY / IOC /
ret Order validity
EOS
uid - -
actid - -
Book Profit Price applicable only if product is selected as B (Bracket
bpprc -
order )
Book loss Price applicable only if product is selected as H and B (High
blprc -
Leverage and Bracket order )
Trailing Price applicable only if product is selected as H and B (High
trailprc -
Leverage and Bracket order )
amo - Yes / No
pp - Price precision
Json Fields Possible value Description
ti - Tick size
ls - Lot size
token - Contract Token
norentm - -
ordenttm - -
exch_tm - -
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Order book failure indication.
request_time - Response received time.
emsg - Error message
Example:

curl https://api.shoonya.com/NorenWClientTP/SingleOrdStatus \
-d "jData={\"uid\":\"VIDYA\"}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”

Sample Success Output:

[
{
"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).

Json Fields Possible value Description


stat Ok or Not_Ok Order book success or failure indication.
exch - Exchange Segment
tsym - Trading symbol / contract on which order is placed.
norenordno - Noren Order Number
prc - Order Price
qty - Order Quantity
prd - Display product alias name, using prarr returned in user details.
s_prdt_ali - Product display name
status - Order status
rpt - Report Type (fill/complete etc)
trantype B/S Transaction type of the order
prctyp LMT / MKT Price type
fillshares - Total Traded Quantity of this order
avgprc - Average trade price of total traded quantity
rejreason - If order is rejected, reason in text form
exchordid - Exchange Order Number.
cancelqty - Canceled quantity for order which is in status cancelled.
remarks - Any message Entered during order entry.
dscqty - Order disclosed quantity.
trgprc - Order trigger price
DAY / IOC /
ret Order validity
EOS
Book Profit Price applicable only if product is selected as B (Bracket
uid -
order )
Book loss Price applicable only if product is selected as H and B (High
actid -
Leverage and Bracket order )
Json Fields Possible value Description
Book Profit Price applicable only if product is selected as B (Bracket
bpprc -
order )
Book loss Price applicable only if product is selected as H and B (High
blprc -
Leverage and Bracket order )
Trailing Price applicable only if product is selected as H and B (High
trailprc -
Leverage and Bracket order )
amo - Yes / No
pp - Price precision
ti - Tick size
ls - Lot size
token - Contract Token
norentm - -
ordenttm - -
exch_tm - Format: dd-mm-YYYY hh:MM:SS
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Order book failure indication.
request_time - Response received time.
emsg - Error message
Example:

curl https://api.shoonya.com/NorenWClientTP/TradeBook \
-d "jData={\"uid\":\"VIDYA\", \“actid\”:\”DEMO1\”}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR

Sample Success Output:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Order book success or failure indication.
exch - Exchange Segment
tsym - Trading symbol / contract on which order is placed.
norenordno - Noren Order Number
qty - Order Quantity
prd - Display product alias name, using prarr returned in user details.
trantype B/S Transaction type of the order
prctyp LMT / MKT Price type
fillshares - Total Traded Quantity of this order
avgprc - Average trade price of total traded quantity
Json Fields Possible value Description
exchordid - Exchange Order Number
remarks - Any message Entered during order entry.
dscqty - Order disclosed quantity.
ret DAY / IOC / EOS Order validity
uid - -
actid - -
pp - Price precision
ti - Tick size
ls - Lot size
cstFrm - Custom Firm
fltm - Fill Time
flid - Fill ID
flqty - Fill Qty
flprc - Fill Price
ordersource - Order Source
token - Token
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Order book failure indication.
request_time - Response received time.
emsg - Error message
Example:

curl https://api.shoonya.com/NorenWClientTP/PositionBook \
-d "jData={\"uid\":\"VIDYA\", \”actid\”:\”ACCT_1\”}“ \
-d “jKey=GHUDWU53H32MTHPA536Q32WR”

Sample Success Output:

{
"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"
}

Sample Failure Output:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Order book success or failure indication.
exch - Exchange Segment
tsym - Trading symbol / contract on which order is placed.
token - Contract token
uid - td>
actid - Account Id
prd - Product name to be shown.
netqty - Net Position quantity
Json Fields Possible value Description
netavgprc - Net position average price
daybuyqty - Day Buy Quantity
daysellqty - Day Sell Quantity
daybuyavgprc - Day Buy average price
daysellavgprc - Day buy average price
daybuyamt - Day Buy Amount
daysellamt - Day Sell Amount
cfbuyqty - Carry Forward Buy Quantity
cforgavgprc - Original Avg Price
cfsellqty - Carry Forward Sell Quantity
cfbuyavgprc - Carry Forward Buy average price
cfsellavgprc - Carry Forward Buy average price
cfbuyamt - Carry Forward Buy Amount
cfsellamt - Carry Forward Sell Amount
lp - LTP
rpnl - RealizedPNL
UnrealizedMTOM. (Can be recalculated in LTP update :
urmtom -
= netqty * (lp from web socket - netavgprc) * prcftr
bep - Break even price
openbuyqty - -
opensellqty - -
openbuyamt - -
opensellamt - -
openbuyavgprc - -
opensellavgprc - -
mult - -
pp - -
prcftr - gn*pn/(gd*pd).
ti - Tick size
ls - Lot size
request_time - This will be present only in a failure response.
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Position book request failure indication.
request_time - Response received time.
emsg - Error message
Sample Success Response:

"request_time":"10:52:12 02-06-2020",
"stat":"Ok"
}

Sample Failure Response:


{
"stat":"Not_Ok",
"emsg":"Invalid Input : Invalid Position Type"

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.

Json Fields Possible Description


stat Ok or Not_Ok Position conversion success or failure indication.
exch - This will be present only if Position conversion fails.
Sample Success Output:

"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"

Sample Failure Output:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Holding request success or failure indication.
exch_tsym - Array of objects exch_tsym objects as defined below.
holdqty - Holding quantity
dpqty - DP Holding quantity
npoadqty - Non Poa display quantity
colqty - Collateral quantity
benqty - Beneficiary quantity
unplgdqty - Unpledged quantity
brkcolqty - Broker Collateral
Json Fields Possible value Description
btstqty - BTST quantity
btstcolqty - BTST Collateral quantity
usedqty - Holding used today
upldprc - Average price uploaded along with holdings
Notes: Valuation : btstqty + holdqty + brkcolqty + unplgdqty + benqty + Max(npoadqty, dpqty) - usedqty
Salable: btstqty + holdqty + unplgdqty + benqty + dpqty - usedqty

Json Fields of object in values Array Possible value Description


exch NSE, BSE, NFO ... Exchange
tsym - Trading symbol of the scrip (contract)
token - Token of the scrip (contract)
pp - Price precision
ti - Tick size
ls - Lot size
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Position book request failure indication.
request_time - Response received time.
emsg - Error message
pp - Price precision
ti - Tick size
ls - Lot size
Sample Success Output:

{
"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"
}

Sample Failure Output:

{
"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”
}

Sample Failure Output:

{
"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.

Json Fields Possible value Description


stat - alert success or failure indication.
request_time- This will be present only in a successful response.
al_id - Alert Id
This will be present only in case of errors.
emsg - That is : 1) Invalid Input
2) Session Expired
Sample Success Output:
{
"request_time":"15:03:33 08-04-2021",
"stat":"Oi delete success",
“al_id”:”21040800000008”
}

Sample Failure Output:

{
"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.

Json Fields Possible value Description


stat - alert success or failure indication.
request_time- This will be present only in a successful response.
al_id - Alert Id
This will be present only in case of errors.
emsg - That is : 1) Invalid Input
2) Session Expired
Sample Success Output:

{
"request_time":"16:36:42 08-04-2021",
"stat":"Oi Replaced",
“al_id”:”21040800000013”
}

Sample Failure Output:

{
"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.

Json Fields Possible value Description


uid* - User id of the logged in user.
tsym* - Trading symbol
exch* - Exchange Segment
ai_t* - Alert Type, should be original alert type, can’t be modified.
al_id - Alert ID
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.

Json Fields Possible value Description


stat - alert success or failure indication.
request_time- This will be present only in a successful response.
al_id - Alert Id
This will be present only in case of errors.
emsg - That is : 1) Invalid Input
2) Session Expired
Sample Success Output:

{
"Stat":"ok",
“ai_t”:”LTP_A”,
“al_id”:”21040800000008”,
“tsym”:”ACC-EQ”,
“exch”:”NSE”
“token”:”22”,
“remarks”:”test”,
“validity”:”DAY”,
“d”:”95000.00”
}

Sample Failure Output:


{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Pending Alert


Request to be POSTed to uri : /NorenWClientTP/GetPendingAlert

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 - 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
d - Data to be compared with LTP
This will be present only in case of errors.
emsg - That is : 1) Invalid Input
2) Session Expired
Sample Success Output:

{
"stat":"Ok",
"request_time":"04062021121503",
"ai_ts":
[
{"ai_t":"ATP"},
{"ai_t":"LTP"},
{"ai_t":"Perc. Change"}
]
}

Sample Failure Output:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Enabled Alert Types


Request to be POSTed to uri : /NorenWClientTP/GetEnabledAlertTypes

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 - alert success or failure indication.
request_time - This will be present only in a successful response.
ai_ts - Array of alert types
Sample Success Output:

{
"request_time":"10:02:06 15-04-2021",
"stat":"Oi created",
"Al_id":"21041500000010"
}

Sample Failure Output:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Place GTT Order


Request to be POSTed to uri : /NorenWClientTP/PlaceGTTOrder

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"
}

Sample Failure Output:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Cancel GTT Order


Request to be POSTed to uri : /NorenWClientTP/CancelGTTOrder

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.

Json Fields Possible value Description


stat - GTT order success or failure indication.
request_time - This will be present only in a successful response.
al_id - Alert Id
This will be present only in case of errors. That is :
emsg - 1) Invalid Input
2) Session Expired
Sample Success Output:

{
"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"
}

Sample Failure Output:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Pending GTT Order


Request to be POSTed to uri : /NorenWClientTP/GetPendingGTTOrder

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"}
]
}

Sample Failure Output:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Enabled GTTs


Request to be POSTed to uri : /NorenWClientTP/GetEnabledGTTs

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.

Json Fields Possible value Description


t tk ‘tk’ represents connect acknowledgement
e NSE, BSE, NFO, BFO .. Exchange name
tk 22 Scrip Token
2 for NSE, BSE
pp Price precision
4 for CDS USDINR
ts - Trading Symbol
ti - Tick size
ls - Lot size
lp - LTP
pc - Percentage change
Json Fields Possible value Description
v - volume
o - Open price
h - High price
I - Low price
c - Close price
ap - Average trade price
oi - Open interest
poi - Previous day closing Open Interest
toi - Total open interest for underlying
bq1 - Best Buy Quantity 1
bp1 - Best Buy Price 1
sq1 - Best Sell Quantity 1
sp1 - Best Sell Price 1
TouchLine subscription Updates :
Accept for t, e, and tk other fields may / may not be present.

Json Fields Possible value Description


t tf ‘tf’ represents touchline feed
e NSE, BSE, NFO .. Exchange name
tk 22 Scrip Token
lp - LTP
pc - Percentage change
v - volume
o - Open price
h - High price
l - Low price
c - Close price
ap - Average trade price
oi - Open interest
poi - Previous day closing Open Interest
toi - Total open interest for underlying
bq1 - Best Buy Quantity 1
bp1 - Best Buy Price 1
sq1 - Best Sell Quantity 1
sp1 - Best Sell Price 1

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.

Json Fields Possible value Description


t dk ‘dk’ represents depth acknowledgement
e NSE, BSE, NFO, BFO .. Exchange name
tk 22 Scrip Token
lp - LTP
Json Fields Possible value Description
pc - Percentage change
v - volume
o - Open price
h - High price
l - Low price
c - Close price
ap - Average trade price
ltt - Last trade time
ltq - Last trade quantity
tbq - Total Buy Quantity
tsq - Total Sell Quantity
bq1 - Best Buy Quantity 1
bq2 - Best Buy Quantity 2
bq3 - Best Buy Quantity 3
bq4 - Best Buy Quantity 4
bq5 - Best Buy Quantity 5
bp1 - Best Buy Price 1
bp2 - Best Buy Price 2
bp3 - Best Buy Price 3
bp4 - Best Buy Price 4
bp5 - Best Buy Price 5
bo1 - Best Buy Orders 1
bo2 - Best Buy Orders 2
bo3 - Best Buy Orders 3
bo4 - Best Buy Orders 4
bo5 - Best Buy Orders 5
sq1 - Best Sell Quantity 1
sq2 - Best Sell Quantity 2
sq3 - Best Sell Quantity 3
sq4 - Best Sell Quantity 4
sq5 - Best Sell Quantity 5
sp1 - Best Sell Price 1
sp2 - Best Sell Price 2
sp3 - Best Sell Price 3
sp4 - Best Sell Price 4
sp5 - Best Sell Price 5
so1 - Best Sell Orders 1
so2 - Best Sell Orders 2
so3 - Best Sell Orders 3
so4 - Best Sell Orders 4
so5 - Best Sell Orders 5
lc - Lower Circuit Limit
uc - Upper Circuit Limit
52h - 52 week high low in other exchanges, Life time high low in mcx
52l - 52 week high low in other exchanges, Life time high low in mcx
oi - Open interest
Json Fields Possible value Description
poi - Previous day closing Open Interest
toi - Total open interest for underlying
Depth subscription Updates :
Json Fields Possible value Description
t df ‘df’ represents depth feed
e NSE, BSE, NFO .. Exchange name
tk 22 Scrip Token
lp - LTP
pc - Percentage change
v - volume
o - Open price
h - High price
l - Low price
c - Close price
ap - Average trade price
ltt - Last trade time
ltq - Last trade quantity
tbq - Total Buy Quantity
tsq - Total Sell Quantity
bq1 - Best Buy Quantity 1
bq2 - Best Buy Quantity 2
bq3 - Best Buy Quantity 3
bq4 - Best Buy Quantity 4
bq5 - Best Buy Quantity 5
bp1 - Best Buy Price 1
bp2 - Best Buy Price 2
bp3 - Best Buy Price 3
bp4 - Best Buy Price 4
bp5 - Best Buy Price 5
bo1 - Best Buy Orders 1
bo2 - Best Buy Orders 2
bo3 - Best Buy Orders 3
bo4 - Best Buy Orders 4
bo5 - Best Buy Orders 5
sq1 - Best Sell Quantity 1
sq2 - Best Sell Quantity 2
sq3 - Best Sell Quantity 3
sq4 - Best Sell Quantity 4
sq5 - Best Sell Quantity 5
sp1 - Best Sell Price 1
sp2 - Best Sell Price 2
sp3 - Best Sell Price 3
sp4 - Best Sell Price 4
sp5 - Best Sell Price 5
so1 - Best Sell Orders 1
Json Fields Possible value Description
so2 - Best Sell Orders 2
so3 - Best Sell Orders 3
so4 - Best Sell Orders 4
so5 - Best Sell Orders 5
lc - Lower Circuit Limit
uc - Upper Circuit Limit
52h - 52 week high low in other exchanges, Life time high low in mcx
52l - 52 week high low in other exchanges, Life time high low in mcx
oi - Open interest
poi - Previous day closing Open Interest
toi - Total open interest for underlying

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

Subscribe Order Update


Request :
Json Fields Possible value Description
t o ‘o’ represents order update subscription task
actid - Account id based on which order updated to be sent.
Subscription Acknowledgement:
Possible
Json Fields Description
value
t ok ‘ok’ represents order update subscription acknowledgement
t om ‘om’ represents touchline feed
norenordno - Noren Order Number
uid - User Id
actid - Account ID
exch - Exchange
tsym - Trading symbol
qty - Order quantity
prc - Order Price
prd - Product
status - Order status (New, Replaced, Complete, Rejected etc)
Possible
Json Fields Description
value
reporttype - Order event for which this message is sent out. (Fill, Rejected, Canceled)
trantype - Order transaction type, buy or sell
prctyp - Order price type (LMT, MKT, SL-LMT, SL-MKT)
ret - Order retention type (DAY, EOS, IOC,...)
fillshares - Total Filled shares for this order
avgprc - Average fill price
fltm - Fill Time(present only when reporttype is Fill)
flid - Fill ID (present only when reporttype is Fill)
flqty - Fill Qty(present only when reporttype is Fill)
flprc - Fill Price(present only when reporttype is Fill)
rejreason - Order rejection reason, if rejected
exchordid - Exchange Order ID
cancelqty - Canceled quantity, in case of canceled order
remarks - User added tag, while placing order
dscqty - Disclosed quantity
trgprc - Trigger price for SL orders
This will be present for child orders in case of cover and bracket orders, if
snonum -
present needs to be sent during exit
This will be present for child orders in case of cover and bracket orders, it will
snoordt -
indicate whether the order is profit or stoploss
This will be present for cover and bracket parent order. This is the differential
blprc -
stop loss trigger price to be entered.
This will be present for bracket parent order. This is the differential profit price
bpprc -
to be entered.
This will be present for cover and bracket parent order. This is required if
trailprc -
trailing ticks is to be enabled.
exch_tm - This will have the exchange update time

Unsubscribe Order Update


Request :
Json Fields Possible value Description
t ud ‘uo’ represents Unsubscribe Order update
t uok ‘uok’ represents Unsubscribe Order update acknowledgement

Get API Key


Following Steps are needed to be followed for API key generation -:
login to prism.shoonya.com

Click on API key Button available on the top right.

Click on the API Key then click at generate & Copy it from there.

You can paste the API Key in your software.


Symbol Master
NSE - Capital Market
https://api.shoonya.com/NSE_symbols.txt.zip

NSE - Equity Derivatives


https://api.shoonya.com/NFO_symbols.txt.zip

NSE - Currency Derivatives


https://api.shoonya.com/CDS_symbols.txt.zip

MCX - Commodity
https://api.shoonya.com/MCX_symbols.txt.zip

BSE - Capital Market


https://api.shoonya.com/BSE_symbols.txt.zip

BSE - Equity Derivative Segment


https://api.shoonya.com/BFO_symbols.txt.zip

NCDEX - Commodity
https://api.shoonya.com/NCX_symbols.txt.zip

Rate Limit
Timeframe Rate Limit
Per Second 20
Per Minute 200

Get Quote Limit


Timeframe Get Quote Limit
Per Second 10
Per Minute 200
Example:

jData={"uid":""}&jKey=552636ffd5d8f659235e4af6dab0bccd
cd5915d26ca07a074a4912e506ea960f

Sample Success Response:

{
"values": [
"NIFTY2",
"NIFTY50"
]
}

Get list of predefined MWs


Request to be POSTed to uri : /NorenWClientTP/PreDefinedMWList

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.

Json Fields Possible value Description


values - Watch List names as a json array of strings.
Example:

jData={"uid":"","wlname":"NIFTY50"}&jKey=552636ffd5d8f659235e4af6dab0bccdcd
5915d26ca07a074a4912e506ea960f

Sample Success Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok Market watch success or failure indication.
values Ok or Not_Ok Array of json objects. (object fields given in below table)
Response Details :
Response data will be in json format with below fields.

Json Fields of object in values Array Possible value Description


exch NSE, BSE,NFO ... Exchange
tsym - Trading symbol of the scrip (contract)
token - Token of the scrip (contract)
pp - Price precision
ti - Tick size
ls - Lot size
Sample Output:

{
"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"
},
]
}

Get Index List


Request to be POSTed to uri : /NorenWClientTP/GetIndexList

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.

Json Fields Possible value Description


stat Ok or Not_Ok TopListNames success or failure indication.
values - Array Of Basket, Criteria pair.
request_time - This will be present only in a successful response.
emsg - This will be present only in case of errors.
Basket, Criteria pair Object :
Json Fields Possible value Description
idxname - Index Name
token - Index token used to subscribe
Sample Success Response:

{
"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"
}

Get Top List Names


Request to be POSTed to uri : /NorenWClientTP/TopListName

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.

Json Fields Possible value Description


stat Ok or Not_Ok TopListNames success or failure indication.
values - Array Of Basket, Criteria pair.
request_time - This will be present only in a successful response.
emsg - This will be present only in case of errors.
Basket, Criteria pair Object :
Json Fields Possible value Description
bskt - Basket name
crt - criteria
Sample Success Response:

[
{
"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"
}
]
}
]

Sample Failure Response:

{
"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.

Json Fields Possible value Description


stat Ok or Not_Ok TopList success or failure indication.
values - Array of top / bottom contracts object
request_time - This will be present only in a successful response.
emsg - This will be present only in case of errors.
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
Sample Success Response:

[
{
"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"
}
]

Sample Failure Response:

{
"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

Json Fields Possible value Description


stat Not_Ok TPData failure indication.
emsg - This will be present only in case of errors
Response data will be in json format in case for success.

Json Fields Possible value Description


stat Ok TPData success indication.
time DD/MM/CCYY hh:mm:ss
into Interval open
inth Interval high
intl Interval low
intc Interval close
intvwap Interval vwap
intv Interval volume
v volume
intoi Interval io change
oi oi

Get Option Chain


Request to be POSTed to uri : /NorenWClientTP/GetOptionChain

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

Json Fields Possible value Description


stat Ok or Not_Ok Market watch success or failure indication.
values Array of json objects. (object fields given in below table)
This will be present only in case of errors.
emsg That is: 1) ) Invalid Input
2) Session Expired
Json Fields of object in values Array Possible value Description
exch CDS, NFO ... Exchange
tsym Trading symbol of the scrip (contract)
token Token of the scrip (contract)
optt Option Type
strprc Strike price
pp Price precision
ti Tick size
ls Lot size
Example:

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.

Json Fields Possible value Description


stat Ok Whi Exch Msg success or failure indication.
exchmsg It will be present only in a successful response.
exchtm Exchange Time
Response data will be in json format with below fields in case of failure:

Json Fields Possible value Description


stat Not_Ok Order book failure indication.
request_time Response received time.
emsg Error message
Sample Success Response:

[
{
"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"
}
]

Get Broker Msg


Request to be POSTed to uri : /NorenWClientTP/GetBrokerMsg

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.

Json Fields Possible value Description


stat Ok or Not_Ok Market watch success or failure indication.
span Span value
expo Exposure margin
span_trade Span value ignoring input fields buyqty, sellqty
expo_trade Exposure margin ignoring input fields buyqty, sellqty
Sample Success Response:
{
"stat":"Ok",
"Request_time":"10052021152900",
"trd_date":
[
{
"trd_date":"28-04-2021"
},
{
"trd_date":"29-04-2021"
},
{
"trd_date":"30-04-2021"
}
]
}

Sample Failure Response:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get UnSettled Trading date:


Request to be POSTed to uri : /NorenWClientTP/GetUnStledTradingDate

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 success or failure indication.
request_time This will be present only in a successful response.
trd_date Array of objects ( trade date as defined below)
Sample Success Response:

{
"request_time":"15:52:26 10-05-2021",
"stat":"Ok",
"actid":"FA12345",
"payout":"21200.20"
}

Sample Failure Response:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Max Payout Amount:


Request to be POSTed to uri : /NorenWClientTP/GetMaxPayoutAmount

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.

Json Fields Possible value Description


stat success or failure indication.
request_time This will be present only in a successful response
actid Account id
payout Maximum payout amount
Sample Success Response:

{
"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"
}

Get Content Basket:


Request to be POSTed to uri : /NorenWClientTP/GetContentBasket

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.

Json Fields Possible value Description


stat success or failure indication.
request_time This will be present only in a successful response
basketlists Array of baskets
Sample Success Response:

[
{
"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"
}
]

Sample Failure Response:

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}

Get Content list:


Request to be POSTed to uri : /NorenWClientTP/GetContentList

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.

Json Fields Possible value Description


stat success or failure indication.
request_time This will be present only in a successful response
tsym Trading symbol
lp LTP
Json Fields Possible value Description
c Close price
h High price
l Low price
ap Average trade price
V Volume
ltt Last trade time
pc Percentage change

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

Common HTTP error codes


Code Error Description
400 Missing or bad request parameters or values
403 Session expired or invalidate. Must relogin
404 Request resource was not found
Code Error Description
Request method (GET, POST etc.) is not allowed on the requested
405
endpoint
410 The requested resource is gone permanently
429 Too many requests to the API (rate limiting)
500 Something unexpected went wrong
502 The backend OMS is down and the API is unable to communicate with it
503 Service unavailable; the API is down
503 Gateway timeout; the API is unreachable
Chat with us, powered by LiveChat

You might also like