Introduction

Goodwill API which helps traders/investors to build, monitor and execute their trading requirement automatically.

API Endpoint
https://api.gwcindia.in/v1/

REST API URL

https://api.gwcindia.in/v1/{{api_name}}

HEADER STRUCTURE

Each rest call will have 2 compulsory header parameters
1. api_key
2. access_token


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/{{api_name}}' \
--header 'x-api-key: {{your_api_key}}' \
--header 'Authorization: Bearer {{your_access_token}}' \
# Param Value Description
1 x-api-key api_key user/partner api_key
2 Bearer Token access_token Bearer token authorization header

api_key is a key allocated to the Goodwill User. If you don't have a api_key, signup here. Input will be in string format.

access_token is a token received as response from Login 2FA. Input will be in string format.

SUCCESSFUL RESPONSE


{
    "status": "success",
    "data": {}
}

Each successful response rest will have parameters
1. status
2. data

ERROR RESPONSE


{
    "status": "error",
    "error_msg": "Error Message",
    "error_type": "GeneralException"
}

Each error response rest will have 3 parameters
1. status
2. error_msg
3. error_type

Login

Goodwill Login Flow






#Example
https://{{registered redirect URL}}?request_token={{request_token}}
# REQUEST RESPONSE
1 https://api.gwcindia.in/v1/login?api_key=xxx Redirects Goodwill Login page
2 After Successful Goodwill Login request_token will be passed as query string parameter to the registered redirect URL.
3 https://api.gwcindia.in/v1/login-response with Signature User Login Session Details

Login Response

Rest Properties Description
Name Login Response
Description Gives the login session details with access token
URL https://api.gwcindia.in/v1/login-response
Input YES

Input


{
    "api_key": "xxxxx",
    "request_token": "5ca9e0b42c4e94759030e850",
    "signature": "f110112a934b7a867dfe611abb41b7274e"
}
# Parameter Description
1 api_key API Key
2 request_token Received as Query String to the Redirect URL
3 signature Hash value using request_token as key
Success Response

{
   {"status":"success",
   "data":{
     "clnt_id":"GQ1A0007",
     "name":"MANOHARAN SARAVANABHAVAN",
     "email":"SARAVANAKIRAN2012@GMAIL.COM",
     "exarr":["BSE","NFO","NSE","MCX","ICEX"],
     "prarr":["BO","CNC","CO","MIS","NRML"],
     "orarr":["L","MKT","SL","SL-M"],
     "exchDetail":{"EQUITY":[{"product":["BO","CNC","CO","MIS","NRML"],"exchseg":"bse_cm","exch":"BSE"},{"product":["BO","CNC","CO","MIS","NRML"],"exchseg":"nse_cm","exch":"NSE"}],"DERIVATIVE":[{"product":["BO","CO","MIS","NRML"],"exchseg":"nse_fo","exch":"NFO"}],"COMMODITY":[{"product":["BO","CO","MIS","NRML"],"exchseg":"mcx_fo","exch":"MCX"},{"product":["BO","CO","MIS","NRML"],"exchseg":"icx_fo","exch":"ICEX"}]},
     "usersessionid":"3279379865",
     "access_token":"8a5e32e1126025fefbcefc88eb6eb9a9"}
   }    
}
# Parameter Description
1 client_id Client Unique ID
2 name Account name
3 email Email id of user
4 exarr Enabled exchange in a JSON array
5 prarr Enabled product type in a JSON array
6 orarr Enabled order type in a JSON array
7 exchDetail Exchange details JSON object
8 usersessionid User session ID(Used in web sockets)
9 access_token Access Token
Error Response

{
    "status": "error",
    "error_msg": "Invalid Signature",
    "error_type": "E"
}
# Parameter Description
1 status error
2 error_msg Error Message
3 error_type Error Type
# Error Messages Description
1 Invalid API key or API key expired Input API Key is invalid or expired
2 Invalid Signature Input Signature is invalid
3 Invalid Request Token Input Session ID and Request Token is Invalid

Signature


Example : 
API Key="xxxxx"
request_token="5ca9e0b42c4e94759030e850"
API Secret="yyyyy"
checksum='xxxxx5ca9e0b42c4e94759030e850yyyyy'
signature=hash('sha256','xxxxx5ca9e0b42c4e94759030e850yyyyy')

To make the request secure, we have implemented parameter posting with signature (i.e. SHA-256 of checksum). Signature parameter is created by hashing the value of below mentioned parameters.

i. API Key
ii. request_token
iii. API Secret

checksum=API Key + request_token + API Secret

signature=SHA-256 of checksum

'signature' parameter is mandatory and needs to be added in login-response API


Profile


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/profile' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/profile



RESPONSE ATTRIBUTES


{
    "status": "success",
    "data": {
        "client_id": "GZXXXXX",
        "name": "ESWARAN",
        "email": "username@GMAIL.COM",
        "exarr": [
            "NSE",
            "NFO",
            "CDS",
            "BSEFO",
            "MCX",
            "ICEX",
            "MCXSX",
            "BFO"
        ],
        "prarr": [
            {
                "prd": "I",
                "s_prdt_ali": "MIS",
                "exch": [
                    "NSE",
                    "NFO",
                    "BFO",
                    "CDS",
                    "MCX"
                ]
            }
        ],
        "orarr": [
            "MKT",
            "LMT",
            "SL-LMT",
            "SL-MKT"
        ],
        "exchdetail": [
            "NSE",
            "NFO",
            "CDS",
            "BSEFO",
            "MCX",
            "ICEX",
            "MCXSX",
            "BFO"
        ]
    }
}
                
Attribute Datatype Description
client_id string Client Id
name string Name of the Client
email string E-mail address of the user
exarr array Array of Exchanges
prarr array Array of Products
orarr array Array of Ordertypes

Balance


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/balance' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/balance




{
    "status": "success",
    "data": {
        "segment": "ALL",
        "bookedpnl": "1.45",
        "unbookedpnl": "0",
        "openingbalance": "2016.03",
        "credits": "0",
        "payinamt": "0.00",
        "utilizedamount": "77.04",
        "payoutamt": "0.00",
        "varmargin": "",
        "spanmargin": "",
        "realisedmtom": "1.45",
        "unrealisedmtom": "",
        "debits": "0"
    }
}
                

RESPONSE ATTRIBUTES

Attribute Datatype Description
segment string Segment type - ALL
bookedpnl string Booked profit and loss
unbookedpnl string Unbooked profit and loss
openingbalance string Opening balance or cash margin available
credits string Credits
payinamt string Pay in amount
utilizedamount string Utilized amount
payoutamt string Pay out amount
varmargin string Var margin
spanmargin string Span margin
realisedmtom string Realised mtom
unrealisedmtom string UnRealised mtom
debits string debits

Positions


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/positions' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/positions




{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "product": "MIS",
            "tsym": "IDEA-EQ",
            "token": "14366",
            "cfbuyqty": "0",
            "cfbuyavgprc": "",
            "cfsellqty": "0",
            "cfsellavgprc": "",
            "bqty": "0",
            "buyavgprc": "0.00",
            "sqty": "0",
            "sellavgprc": "0.00",
            "netqty": "0",
            "netbuyavgprc": "655.00",
            "netsellavgprc": "650.00",
            "netamt": "0",
            "ltp": "6.60",
            "bep": "",
            "realisedprofitloss": "-0.75",
            "unrealisedprofitloss": "0.00"
        }
    ]
}
                

RESPONSE ATTRIBUTES

Parameter Description
exchange Exchange name
product Product code
tsym Trading symbol
token Token of the scrip
cfbuyqty CF buy quantity
cfbuyavgprc CF net buy average price
cfsellqty CF sell quantity
cfsellavgprc CF net sell average price
bqty Buy quantity
buyavgprc Buy average price
sqty Sell quantity
sellavgprc Sell average price
netqty Net quantity
netbuyavgprc Net Buy Average price
netsellavgprc Net Sell Average price
netamt Net amount
ltp Last trade price of the scrip
bep Break-even price of the position
realisedprofitloss Realized profit loss
unrealisedprofitloss Unrealized profit loss

exitposition


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/exitposition' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/exitposition



Request example :

{   "segment":"nse_cm",
    "product":"CNC",
    "netqty":"1",
    "token": "11915",
    "tsym": "YESBANK-EQ"    
}

Response example :

{
    "status": "success",
    "data": {
        "nstordno": "23031400017243"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
segment Exchange segment name Yes
product Product Code Yes
netqty Net Quantity Yes
token Symbol token Yes
tsym Trading Symbol Yes

Holdings


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/holdings' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/holdings




{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "token": "11915",
            "tsym": "YESBANK-EQ",
            "isin": "INE528G01035",
            "holdqty": "0",
            "btst_qty": "1",
            "sellable_qty": "1",
            "average_price": "15.75",
            "ltp": "15.55",
            "pcode": "CNC",
            "coll_qty": "",
            "coll_type": ""
        }
    ]
}
                

RESPONSE ATTRIBUTES

Parameter Description
exchange Exchange name
token Token of the scrip
tsym Trading symbol
isin ISIN
holdqty Holding quantity
btst_qty BTST quantity
sellable_qty Sellable quantity
average_price Average price
ltp Last trade price of the scrip
pcode Product code
coll_qty Collateral quantity
coll_type Collateral type

OrderBook


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/orderbook' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/orderbook




{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "token": "14366",
            "tsym": "IDEA-EQ",
            "product": "CNC",
            "pricetype": "MKT",
            "validity": "DAY",
            "price": "0.00",
            "trgprc": "",
            "qty": "1",
            "dscqty": "0",
            "trantype": "S",
            "avgprc": "6.55",
            "fillshares": "1",
            "remarks": "",
            "exchordid": "1100000017705694",
            "syomorderid": "",
            "nstordno": "23031400017243",
            "orderentrytime": "13:10:32 14-03-2023",
            "exchconfrmtime": "14-03-2023 13:10:32",
            "status": "complete",
            "ordvaldate": "",
            "rejreason": ""
        }
    ]
}
                

RESPONSE ATTRIBUTES

Attributes Datatype Description
exchange string Exchange name
token string Token of the scrip
tsym string Trading symbol
product string Product Code
pricetype string Price type
validity string validity
price string Price
trgprc string Trigger price
qty string Quantity
dscqty string Disclosed quantity
trantype string Transaction type
avgprc string Average price
fillshares string Filled Quantity
remarks string Remarks
exchordid string Exchange order id
syomorderid string Syom Order ID
nstordno string Order number
orderentrytime string Order entry time
exchconfrmtime string Exchange confirmation time
status string Status of the order
ordvaldate string Order validity date
rejreason string Rejection reason

orderhistory


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/orderhistory' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/orderhistory




Request example :

{
    "nstordno": "220104000034606"
}

Response example :

{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "tsym": "IDEA-EQ",
            "product": "MIS",
            "pricetype": "MKT",
            "duration": "DAY",
            "price": "0.00",
            "trgprc": "",
            "qty": "1",
            "disclosedqty": "0",
            "trantype": "B",
            "avgprc": "6.60",
            "filledshares": "1",
            "orderusermessage": "",
            "exchordid": "1100000017915998",
            "nstordno": "23031400017379",
            "status": "complete",
            "rejectionreason": "",
            "exchtimestamp": "14-03-2023 13:13:59",
            "nestreqid": ""
        },
        {
            "exchange": "NSE",
            "tsym": "IDEA-EQ",
            "product": "MIS",
            "pricetype": "MKT",
            "duration": "DAY",
            "price": "0.00",
            "trgprc": "",
            "qty": "1",
            "disclosedqty": "0",
            "trantype": "B",
            "avgprc": "",
            "filledshares": "",
            "orderusermessage": "",
            "exchordid": "1100000017915998",
            "nstordno": "23031400017379",
            "status": "open",
            "rejectionreason": "",
            "exchtimestamp": "14-03-2023 13:13:59",
            "nestreqid": ""
        },
        {
            "exchange": "NSE",
            "tsym": "IDEA-EQ",
            "product": "MIS",
            "pricetype": "MKT",
            "duration": "DAY",
            "price": "0.00",
            "trgprc": "",
            "qty": "1",
            "disclosedqty": "0",
            "trantype": "B",
            "avgprc": "",
            "filledshares": "",
            "orderusermessage": "",
            "exchordid": "",
            "nstordno": "23031400017379",
            "status": "open",
            "rejectionreason": "",
            "exchtimestamp": "",
            "nestreqid": ""
        },
        {
            "exchange": "NSE",
            "tsym": "IDEA-EQ",
            "product": "MIS",
            "pricetype": "MKT",
            "duration": "DAY",
            "price": "0.00",
            "trgprc": "",
            "qty": "1",
            "disclosedqty": "0",
            "trantype": "B",
            "avgprc": "",
            "filledshares": "",
            "orderusermessage": "",
            "exchordid": "",
            "nstordno": "23031400017379",
            "status": "open",
            "rejectionreason": "",
            "exchtimestamp": "",
            "nestreqid": ""
        }
    ]
}
                

REQUEST PARAMETERS

Request Parameter Description Mandatory
nstordno Order Number Yes

RESPONSE ATTRIBUTES

# Parameter Description
1 exchange Exchange
2 tsym Trading symbol
3 product Product code
4 pricetype Price type
5 duration Order duration
6 price Price
7 trgprc Trigger Price
8 qty Quantity
9 disclosedqty Disclosed quantity
10 trantype Transaction type
11 avgprc Average price
12 filledshares filledShares
13 orderusermessage Order User Message
14 exchordid Exchange Order id
15 nstordno Order number
17 status Status of the order
18 rejectionreason Rejection reason
19 exchtimestamp Exchange time stamp
20 reqid Request id

tradebook


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/tradebook' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/tradebook





{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "tsym": "IDEA-EQ",
            "product": "MIS",
            "pricetype": "MKT",
            "trantype": "S",
            "qty": "1",
            "exchordid": "1100000010905576",
            "nstordno": "23031400011069",
            "exchtime": "14-03-2023 11:33:50",
            "price": "0.00"
        }
    ]
}
                

RESPONSE ATTRIBUTES

Attributes Datatype Description
exchange string Exchange
tsym string Trading Symbol
product string Product code
pricetype string Price type of the Trade
trantype string Trasaction type(B/S)
qty string Quantity
exchordid string Exchange Order ID
nstordno string Order ID
exchtime string Exchange time
price string Price

placeorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/placeorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/placeorder



Request example :

{
    "tsym": "YESBANK-EQ",
    "exchange":"NSE",
    "trantype":"B",
    "validity":"DAY",
    "pricetype":"MKT",
    "qty":"1",
    "discqty":"0",
    "price":"0",
    "trgprc":"0",            
    "product":"CNC",
    "amo":"NO"      
}

Response example :

{
    "status": "success",
    "data": {
        "nstordno": "220104000034606"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
tsym Trading Symbol Yes
exchange Exchange name Yes
trantype Transtaction Type Yes
validity Validity - It can be one of the following
DAY
IOC
Yes
pricetype It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
qty Quantity Yes
discqty Disclosed Quantity Yes
price Price Yes
trgprc Trigger Price Yes
product Product Code Yes
amo AMO - It can be one of the following
YES
NO
Yes

placecoorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/placecoorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/placecoorder



Request example :

{
    "tsym": "YESBANK-EQ",
    "exchange":"NSE",
    "trantype":"B",
    "validity":"DAY",
    "pricetype":"MKT",
    "qty":"1",
    "discqty":"0",
    "price":"0",
    "stop_price":"0",
    "amo":"NO"      
}

Response example :

{
    "status": "success",
    "data": {
        "nstordno": "220104000034607"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
tsym Trading Symbol Yes
exchange Exchange name Yes
trantype Transtaction Type Yes
validity Validity - It can be one of the following
DAY
IOC
Yes
pricetype It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
qty Quantity Yes
discqty Disclosed Quantity Yes
price Price Yes
stop_price Stop Price Yes
amo AMO - It can be one of the following
YES
NO
Yes

placeboorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/placeboorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 05b8167eed78367034cb5ed4a8c15930' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/placeboorder



Request example :

{
    "exchange":"NSE",    
    "tsym": "YESBANK-EQ",
    "trantype":"B",
    "qty":"1",
    "validity":"DAY",
    "discqty":"0",
    "price":"14",
    "squareoff":"15",
    "stoploss":"13",
    "trailing_ticks":"0",
    "pricetype":"L",            
    "trgprc":"0"
}

Response example :

{
    "status": "success",
    "data": {
        "nstordno": "220104000034606"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange name Yes
tsym Trading Symbol Yes
trantype Transtaction Type Yes
qty Quantity Yes
validity Validity - It can be one of the following
DAY
IOC
Yes
discqty Disclosed Quantity Yes
price Price Yes
squareoff Square Off Yes
stoploss Stop Loss Yes
trailing_ticks Trailing Ticks Yes
pricetype It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
trgprc Trigger Price Yes

modifyorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/modifyorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/modifyorder



Request example :

{   "exchange":"NSE",
    "tsym": "YESBANK-EQ",
    "nstordno":"23031400017379",
    "trantype":"B",
    "pricetype":"MKT",
    "price":"0",
    "qty":"1",
    "discqty":"0",
    "trgprc":"0", 
    "validity":"DAY",
    "filledqty":"1",
    "product":"CNC"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "23031400017379"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange name Yes
tsym Trading Symbol Yes
nstordno Order ID Yes
trantype Transaction type(B/S) Yes
pricetype Type of order. It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
price Price at which the order was placed Yes
qty Quantity with which the order was placed Yes
discqty Disclosed Quantity Yes
trgprc Trigger Price Yes
validity Validity Yes
filledqty Filledqty Yes
product Product Code Yes

modifyboorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/modifyboorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/modifyboorder



Request example :

{   "exchange":"NSE",
    "tsym": "BHEL-EQ",
    "nstordno":"23042400028714",
    "pricetype":"L",
    "price":"74",
    "qty":"1",
    "discqty":"0",
    "trgprc":"78",
    "validity":"DAY",
    "trailing_ticks":"0",
    "stoploss":"1",
    "squareoff":"1"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "23042400028714"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange name Yes
tsym Trading Symbol Yes
nstordno Order ID Yes
pricetype Type of order. It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
price Price at which the order was placed Yes
qty Quantity with which the order was placed Yes
discqty Disclosed Quantity Yes
trgprc Trigger Price Yes
validity Validity Yes
trailing_ticks Trailing Ticks Yes
stoploss Stoploss Yes
squareoff Squareoff Yes

modifycoorder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/modifycoorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/modifycoorder



Request example :

{   "exchange":"NSE",
    "tsym": "ZOMATO-EQ",
    "nstordno":"23042400032632",
    "pricetype":"SL-L",
    "price":"74",
    "qty":"1",
    "discqty":"0",
    "trgprc":"78",
    "validity":"DAY",
    "trailing_ticks":"0",
    "stoploss":"1"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "23042400032632"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange name Yes
tsym Trading Symbol Yes
nstordno Order ID Yes
pricetype Type of order. It can be one of the following
MKT - Market Order
L - Limit Order
SL-L - Stop Loss Limit Order
SL-M - Stop Loss Market Order
Yes
price Price at which the order was placed Yes
qty Quantity with which the order was placed Yes
discqty Disclosed Quantity Yes
trgprc Trigger Price Yes
validity Validity Yes
trailing_ticks Trailing Ticks Yes
stoploss Stoploss Yes

CancelOrder


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/cancelorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/cancelorder



Request example :

{
    "nstordno":"220106000024964"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "220106000024964"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
nstordno Order Number Yes

Exit BO Order


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/exitboorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/exitboorder



Request example :

{
    "nstordno":"220106000024964"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "success"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
nstordno Order Number Yes

Exit CO Order


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/exitcoorder' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/exitcoorder



Request example :

{
    "nstordno":"220106000024964"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "success"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
nstordno Order Number Yes

Position Conversion


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/positionconversion' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 3e81bfb2a1ef11d3bd3e9a8966d4d51e' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/positionconversion



Request example :

{
   "exchange":"NSE",
   "tsym":"IDEA-EQ",
   "qty":"1",
   "prev_product":"CNC",
   "trantype":"B",
   "new_product":"MIS"
}

Response example :

{
    "status": "success",
    "data": {
        "result": "success"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange name Yes
tsym Trading Symbol Yes
qty Quantity Yes
prev_product Previous Product Yes
trantype Transtaction Type Yes
new_product New product Yes

GetQuote


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/getquote' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 6cb7ac3a5a73831ec88ee8915bee3f2a' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/getquote



Request example :

{
    "exchange":"NSE",
    "token":"11915"
}

Response example :
{
    "status": "success",
    "data": {
        "symbol_name": "YESBANK",
        "trading_symbl": "YESBANK-EQ",
        "token": "11915",
        "company_name": "YES BANK LIMITED",
        "last_trade_time": "13:18:29",
        "last_price": "15.65",
        "change": "0.0",
        "change_per": "0.0",
        "last_quantity": "1",
        "buy_quantity": "37308286",
        "sell_quantity": "26519029",
        "volume": "119231098",
        "average_price": "15.66",
        "open": "15.70",
        "high": "15.95",
        "low": "15.45",
        "close": "15.65",
        "tick_size": "0.05",
        "multiplier": "1",
        "lot_size": "1",
        "decimalprecision": "2",
        "yearly_low_price": "12.10",
        "yearly_high_price": "24.75"
    }
}

                

QUERY PARAMETERS

Request Parameter Description Mandatory
exchange Exchange Yes
token Token Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
symbol_name string Symbol Name
trading_symbl string Trading Symbol
token string Symbol Token
company_name string Company Name
last_trade_time string Last Traded Time
last_price string Last Traded Price
change string Change Price
change_per string Change Percentage
last_quantity string Last Traded Quantity
buy_quantity string Buy Quantity
sell_quantity string Sell Quantity
volume string Volume
average_price string Average Price
open string Open
high string High
low string Low
close string Close
tick_size string Tick Size
multiplier string Multiplier
lot_size string Lot Size
decimalprecision string Decimal Precision
yearly_low_price string Yearly low price
yearly_high_price string Yearly high price

Fetch Symbol


# Here is a curl example
curl --location --request POST 'https://api.gwcindia.in/v1/fetchsymbol' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 6cb7ac3a5a73831ec88ee8915bee3f2a' \

                

To get characters you need to make a POST call to the following url :
https://api.gwcindia.in/v1/fetchsymbol



Request example :

{
    "s":"RELIANCE"
}

Response example :

{
    "status": "success",
    "data": [
        {
            "exchange": "NSE",
            "token": "2885",
            "symbol": "RELIANCE-EQ",
            "trading_symbol": "RELIANCE-EQ",
            "company_name": "RELIANCE INDUSTRIES LTD",
            "expiry_date": "",
            "expiry_date_desc": "",
            "strike_price": "",
            "lot_size": "1"
        }
    ]
}

                

QUERY PARAMETERS

Request Parameter Description Mandatory
s Search Symbol Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
exchange string Exchange
token string Symbol Token
symbol string Symbol
trading_symbol string Trading Symbol
company_name string Company Name
expiry_date string Expiry Date
expiry_date_desc string Expiry Date Description
strike_price string Strike Price
lot_size string Lot size

Logout


# Here is a curl example
curl --location --request GET 'https://api.gwcindia.in/v1/logout' \
--header 'x-api-key: 2e4c1f0ac084dd6b30fd808e016be3f0' \
--header 'Authorization: Bearer 6cb7ac3a5a73831ec88ee8915bee3f2a'

                

To get characters you need to make a GET call to the following url :
https://api.gwcindia.in/v1/logout



Result Example:

{
    "status": "success",
    "data": {
        "check": "OK"
    }
}
                

RESPONSE ATTRIBUTES

Attribute Datatype Description
check string OK / NOT_OK

Web Socket

Description

It will create a web socket connection

Web socket url :
wss://giga.gwcindia.in/NorenWSTP/

URL

wss://giga.gwcindia.in/NorenWSTP/

General Guidelines

1. As soon as connection is done, a connection request should be sent with User id and login session id.
2. All input and output messages will be in json format.
3. ATO price is sent as “42949672.95”.

Connect


REQUEST PARAMETERS

                  
Request example(To connect to websocket) :

{
      "t": "c",
      "uid": "GQ1A0007",
      "actid": "GQ1A0007",
      "source": "API",
      "susertoken": "3279379865"                
}                  
                  
               
Json Fields Possible value Description
t c ‘c’ represents connect task
uid User ID
actid Account id
source API Source should be same as login request.
susertoken User Session Token

RESPONSE PARAMETERS

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 PARAMETERS

                  
Request example :

{
      "t": "t",
      "k": "NSE|22#BSE|508123#NSE|NIFTY"     
}                  
                  
               
Json Fields Possible value Description
t t ‘t’ represents touchline task
k One or more scriplist for subscription. Example NSE|22#BSE|508123#NSE|NIFTY

RESPONSE PARAMETERS(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 touchline acknowledgement
e NSE, BSE, NFO.. Exchange name
tk 22 Scrip Token
pp 2 for NSE, BSE 4 for CDS USDINR Price precision
ts Trading Symbol
ti Tick size
ls Lot size
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
ft Feed time

RESPONSE PARAMETERS(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
ft Feed time

Unsubscribe Touchline


REQUEST PARAMETERS

                  
Request example :

{
      "t": "u",
      "k": "NSE|22#BSE|508123"     
}                  
                  
               
Json Fields Possible value Description
t u ‘u’ represents Unsubscribe Touchline
k One or more scriplist for unsubscription. Example NSE|22#BSE|508123

RESPONSE PARAMETERS

Json Fields Possible value Description
t uk ‘uk’ represents Unsubscribe Touchline acknowledgement
k One or more scriplist for unsubscription. Example NSE|22#BSE|508123

Subscribe Depth


REQUEST PARAMETERS

                  
Request example :

{
      "t": "d",
      "k": "NSE|22#BSE|508123"     
}                  
                  
               
Json Fields Possible value Description
t d ‘d’ represents depth subscription
k One or more scriplist for subscription. Example NSE|22#BSE|508123

RESPONSE PARAMETERS(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.. 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
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
ft Feed time

RESPONSE PARAMETERS(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
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
ft Feed time

Unsubscribe Depth


REQUEST PARAMETERS

                  
Request example :

{
      "t": "ud",
      "k": "NSE|22#BSE|508123"     
}                  
                  
               
Json Fields Possible value Description
t ud ‘ud’ represents Unsubscribe depth
k One or more scriplist for unsubscription. Example NSE|22#BSE|508123

RESPONSE PARAMETERS

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 PARAMETERS

                  
Request example :

{
      "t": "o",
      "actid": "GQ1A0007"     
}                  
                  
               
Json Fields Possible value Description
t o ‘o’ represents order update subscription task
actid Account id based on which order updated to be sent.

RESPONSE PARAMETERS(Subscription Acknowledgement)

Json Fields Possible value Description
t ok ‘ok’ represents order update subscription acknowledgement

RESPONSE PARAMETERS(Order Update subscription Updates)

Json Fields Possible value Description
t om ‘om’ represents touchline feed
norenordno Noren Order Number
uid User Id
actid Account ID
exch Exchange
tsym Trading symbol
prc Order Price
prd Product
status Order status (New, Replaced, Complete, Rejected etc)
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
snonum This will be present for child orders in case of cover and bracket orders, if present needs to be sent during exit
snoordt This will be present for child orders in case of cover and bracket orders, it will indicate whether the order is profit or stoploss
blprc This will be present for cover and bracket parent order. This is the differential stop loss trigger price to be entered.
bpprc This will be present for bracket parent order. This is the differential profit price to be entered.
trailprc This will be present for cover and bracket parent order. This is required if trailing ticks is to be enabled.
exch_tm This will have the exchange update time Format: dd-mm-YYYY hh:MM:SS
amo This field will be present if the order is After Market Order. Data will be “Yes”
tm TimeStamp
kidid Kid Id
sno_fillid BO Sequence Id

Unsubscribe Order Update


REQUEST PARAMETERS

                  
Request example :

{
      "t": "uo"   
}                  
                  
               
Json Fields Possible value Description
t uo ‘uo’ represents Unsubscribe Order update

RESPONSE PARAMETERS

Json Fields Possible value Description
t uok ‘uok’ represents Unsubscribe Order update acknowledgement

Appendix

Postman Collection


Download and import the postman collection from here


Exchange List


NSE - EQUITY
BSE - EQUITY
MCX - COMMODITY
NFO - DERIVATIVE
CDS - CURRENCY


Exchange Segment


nse_cm - NSE EQUITY
bse_cm - BSE EQUITY
nse_fo - NFO DERIVATIVE
mcx_fo - MCX COMMODITY


Product Codes


NRML - NORMAL
CNC - Cash and Carry
MIS - Intraday
CO - Cover order
BO - Bracket order


Order Types


L - LIMIT
MKT - Market
SL-L - Stop Loss Limit
SL-M - Stop Loss Market


Transaction Types


B - Buy
S - Sell