Skip to content

Introduction

Image

Nidhi API 1.0 is a collection of fast, high performing, low complexity and easy to understand trading APIs for you to build state of the art financial platforms for trading, investment, wealth generation & execute algo based strategies.

It is a set of REST-like APIs that provide integration with our trading eco system. You can place, execute, modify Orders, manage Portfolio, access live Market data, listen to Order status stream, view funds and balances and innovate much more in the Capital Market space with our Open APIs.

Nidhi APIs offer resource-based URLs that accept JSON or form-encoded requests. The response is returned as JSON-encoded by using Standard HTTP response codes unless explicitly stated otherwise. The service calls are platform independent. To Jumpstart your development, toolkits are available in several Programming languages. Please click here.

Login

For Partners

Once the partner is onboarded through offline channel, nidhi team will share Partner credentials for Login. When the nidhi user, login to the partner’s application, the consent flow server-to-server and the partner gets the consent id. Partner has to put credentials in header. Thereafter, the partner starts browser based login flow. nidhi user login using nidhi credentials (email/phone/password/pin). Login flow terminates with redirection to partner server with token id. Finally, the partner shall fetch the user details and access token.

STEP 1: https://auth.nidhi.co/partner/generate-consent

Partner need to add partner_id & partner_secret in the header. The response of this flow will have consent-id. Use this consent-id for the next browser based flow.

STEP 2: https://auth.nidhi.co/consent-login?consentId=<consentId>

This flow will terminate on a partner's server with URL ?tokenid=. Use this token-id in the next GET call.

STEP 3: https://auth.nidhi.co/partner/consume-consent?tokenId=<token-Id>

In this step, you need to add partner_id & partner_secret in header again. This flow will end with end user details like ClientId, UCC, PoA status etc..

For Individual Traders

Individual traders can directly get their Access Token from web.nidhi.co,subject to eligibility. The eligibility criteria to get Access Token is minimum 25 trading orders executed in the last 30days and this is inclusive of Futures, Options, Commodity, Currency & Equity-Intraday. Here's how to get your Access Token:

  • Login to web.nidhi.co
  • Click on My Profile and navigate to 'nidhiHQ Trading APIs and Access'

Structure

All GET and DELETE request parameters go as query parameters, and POST and PUT parameters as form-encoded. User has to input an access token in the header for every request.

curl --request POST \
--url https://api.nidhi.co/orders \
--header 'Content-Type: application/json' \
--header 'access-token: JWT' \
--data '{Request JSON}'

Errors

Error responses come with the error code and message generated internally by the system. The sample structure of error response is shown below.

{
    "errorCode": "",
    "httpStatus": "",
    "internalErrorCode": "",
    "internalErrorMessage": ""
}