Doc Fundamentals
Funds Management
Market Data
Order Management
Portfolio Management
User Authentication
Access Token
Daily API Calls
Success Rate
Avg. Response Time
The API is designed to generate access token for a client with help of Request Token obtained from OAuth Login.
To generate the access token, partner/client needs to provide AppKey in the head of the payload whereas UserID and encryptionKey needs to be passed in body. The successful API call will provide the partner a Access token which is valid throughout a day. This access token can be used to call all further API's.
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/GetAccessToken
Headers
| KEY | VALUE |
|---|---|
Content-Type | application/json |
Request body
| FIELD NAME | MANDATORY | DESCRIPTION | |
|---|---|---|---|
head | keySTRING | Yes | AppKey of user or partner |
body | requestTokenSTRING | Yes | This is the token received after logging in through TOTP or OAUTH. |
EncryKeySTRING | Yes | Encryption Key of the User or Partner received along with API credentials. | |
userIDSTRING | Yes | Encryption Key of the User or Partner received along with API credentials. | |
Access Token - FAQ
The EncrypKey and UserId correspond to the partner when the client logs in through a partner and to the client when the client logs in independently.
Client keys can be find here
After successful login Partner will receive client code in response.
{
"head": {
"Key": "{{Partner/User App key}}"
},
"body": {
"RequestToken": "{{request_token}}",
"EncryKey": "{{Parter/User_encrykey}}",
"UserId": "{{Parter/User_userid}}"
}
}
Validity of Access Token
The access token generated after successful login request remains valid thought a day from the time of its generation. Token expires every day at 11:59 PM.
Response body
| FIELD NAME | VALUES | DESCRIPTION | |
|---|---|---|---|
body | AccessTokenSTRING | - | This is the access token(JWT) after successful user login. |
ClientCodeSTRING | 50012322 | The client code of the logged in user. | |
ClientNameSTRING | Mahendra | The client Name of the logged in user. | |
POAStatusSTRING | Y/N | The Power of attorney status of the logged in user. | |
ClientTypeSTRING | 1 | The client type of the logged in user. | |
CustomerTypeSTRING | BASIC | Subscription Plan client has subscribed to. | |
AllowBseCashSTRING | Y/N | Segment Activation Flags, please find the list below. | |
StatusDescriptionSTRING | 0: Success2: Invalid Inputs | It is the description of the status of the API request. | |
StatusINTEGER | 02 | It is numeric code for the status of the API request. | |
Segment Activation Flags
AllowBseCash,AllowBseDeriv,AllowBseMF,AllowMCXComm,AllowMcxSx,AllowNSECurrency,AllowNSEL,AllowNseCash,AllowNseComm,AllowNseDeriv,AllowNseMF,CommodityEnabled
{
"body": {
"AccessToken": "{{Access_Token}}",
"AllowBseCash": "Y",
"AllowBseDeriv": "Y",
"AllowBseMF": "Y",
"AllowMCXComm": "Y",
"AllowMcxSx": "N",
"AllowNSECurrency": "Y",
"AllowNSEL": "Y",
"AllowNseCash": "Y",
"AllowNseComm": "N",
"AllowNseDeriv": "Y",
"AllowNseMF": "N",
"BulkOrderAllowed": 0,
"CleareDt": "/Date(1715225400000+0530)/",
"ClientCode": "{clientCode}",
"ClientName": "{client_name}",
"ClientType": "1",
"CommodityEnabled": "Y",
"CustomerType": "BASIC",
"DPInfoAvailable": "Y",
"DemoTrial": "N",
"DirectMFCharges": 10,
"IsIDBound": 0,
"IsIDBound2": 0,
"IsOnlyMF": "N",
"IsPLM": 0,
"IsPLMDefined": 0,
"Message": "Success",
"OTPCredentialID": "",
"PGCharges": 10,
"PLMsAllowed": 0,
"POAStatus": "Y",
"PasswordChangeFlag": 0,
"PasswordChangeMessage": "",
"ReferralBenefits": 250,
"RefreshToken": "{refresh_token}",
"RunningAuthorization": 0,
"Status": 0,
"VersionChanged": 0
},
"head": {
"Status": 0,
"StatusDescription": "Success"
}
}
{
"body": {
"AccessToken": "",
"AllowBseCash": "",
"AllowBseDeriv": "",
"AllowBseMF": "",
"AllowMCXComm": "",
"AllowMcxSx": "",
"AllowNSECurrency": "",
"AllowNSEL": "",
"AllowNseCash": "",
"AllowNseComm": "",
"AllowNseDeriv": "",
"AllowNseMF": "",
"BulkOrderAllowed": 0,
"CleareDt": "/Date(1715580830932+0530)/",
"ClientCode": "",
"ClientName": "",
"ClientType": "",
"CommodityEnabled": "",
"CustomerType": "",
"DPInfoAvailable": "",
"DemoTrial": "",
"DirectMFCharges": 0,
"IsIDBound": 0,
"IsIDBound2": 0,
"IsOnlyMF": "",
"IsPLM": 0,
"IsPLMDefined": 0,
"Message": "Token Expired.",
"OTPCredentialID": "",
"PGCharges": 0,
"PLMsAllowed": 0,
"POAStatus":"
{
"body": {
"AccessToken": "",
"AllowBseCash": "",
"AllowBseDeriv": "",
"AllowBseMF": "",
"AllowMCXComm": "",
"AllowMcxSx": "",
"AllowNSECurrency": "",
"AllowNSEL": "",
"AllowNseCash": "",
"AllowNseComm": "",
"AllowNseDeriv": "",
"AllowNseMF": "",
"BulkOrderAllowed": 0,
"CleareDt": "/Date(1715258267376+0530)/",
"ClientCode": "",
"ClientName": "",
"ClientType": "",
"CommodityEnabled": "",
"CustomerType": "",
"DPInfoAvailable": "",
"DemoTrial": "",
"DirectMFCharges": 0,
"IsIDBound": 0,
"IsIDBound2": 0,
"IsOnlyMF": "",
"IsPLM": 0,
"IsPLMDefined": 0,
"Message": "Server Unable to process your request",
"OTPCredentialID": "",
"PGCharges": 0,
"PLMsAllowed": 0,
"POAStatus":"