Login

The login flow starts by navigating to the public SuperrAPI login endpoint:

https://superrtrade.stoxkart.com/login?api_key=xxx

After successful login, user gets redirected to the URL specified under MyApps. With the URL we pass auth_token & feed_token as query parameters.

Steps to generate Access Token:

  1. After logging in, you'll be redirected to a URL with a request token parameter. Save the request token.

  2. Concatenate your API key and the request token and save the result.

  3. Create an HMAC-SHA256 signature using the concatenated string and your API secret.

  // Golang Sample code
 
  const appKey = "[your API KEY]"
  const secret = "[your API SECRET]"
  const reqToken = "[the request token you received in step 2]"
  key := appKey + reqToken
  token := hmac.New(sha256.New, []byte(key))
  token.Write([]byte(secret))
  signature := hex.EncodeToString(token.Sum(nil))
  1. Send a POST request to baseURL+/auth/token with your API key, signature, and request token in the request body
// Request body
 
{
  "api_key": "[your API key]",
  "signature": "[the HMAC signature you generated in step 4]",
  "req_token": "[the request token you received in step 2]"
}
  1. Receive the access token in the response and save it.

Login flow Diagram

Authetication with Stoxkart(Login services):

You can authenticate to get Superr APIs trading access using Stoxkart Account Id. In order to login, you need a client id,password & OTP.

MethodAPIsEndpointDescription
POSTLogin/auth/loginAutheticate with Stoxkart login credential
POSTLogout/auth/logoutTo logout
GETProfile/auth/profileRetrieve the user profile

Login API

This API authenticates the client and creates a session for the client in the Host System. The session is identified by the request token in the response.

Sample Request(Body):

{
  "platform": "api",
  "data": {
    "client_id": "<your client_id>",
    "password": "<your password>"
  }
}

Sample Response:

{
  "message": "Please enter TOTP",
  "status": "success",
  "data": {
    "request_token": "4d86841c43a739e554e493d9...",
    "is_2fa_enabled": true
  }
}

Logout API

This API closes the current session in the HOST system.

Sample Request(Body):

{
  "platform": "api",
  "data": {
    "client_id": "<your client_id>"
  }
}

Sample Response:

{
  "message": "Logged out successfully",
  "status": "success"
}

Profile API

User can get their user profile data.

Sample Response:

{
  "status": "success",
  "data": {
    "client_id": "ODIN4TEST",
    "name": "Sxxxx",
    "email_id": "xxxxxxxxxxxx@smcindiaonline.com",
    "mobile_no": "8806xxxxxx",
    "exchanges": ["BSE", "NSE"],
    "products": ["DELIVERY", "MARGIN", "INTRADAY", "BRACKET_ORDER"]
  }
}