Broker Account Opening

Offer seamless demat account opening experience to your users

Users can open an account with a broker of their choice: 5Paisa, Kotak & Zerodha.

To trigger the Account opening flow, trigger the relevant signup method of Gateway SDK.

Steps

1. Triggering SDK method

Learn more about signup method in respective SDK doc:

2. Save lead ID from SDK response

On close of Gateway's account opening flow (aka leadgen flow), the SDK will return the following data —

{
    "leadId": null,
    "status": "[INITIALIZED/DETAILS_REGISTER/BROKER_REGISTER]"
}
{
    "leadId": "612e1fc94d261b4aed130cb8",
    "status": "[SUBMITTED/COMPLETED]"
}
{
    "leadId": "612e1fc94d261b4aed130cb8",
    "status": "Account opened"
}

Status description

Status

Description

INITIALIZED

User dropped off before entering phone number.

VERIFICATION

User dropped off before verifying mobile OTP.

DETAILS_REGISTER

User dropped off right after verifying mobile OTP
(but before filling more details - name & email).

BROKER_REGISTER

User dropped off after entering personal details
(but before choosing a broker).

SUBMITTED / PROCESSING

User successfully submitted the lead. Account opening is in process.

Account opened

lead successfully opened a demat account.

The leadId is shared if a user submits the broker of their choice (gateway flow complete). The same can be saved in your database for the related user.

3. Fetch details using Lead status API

To check for the lead's account opening status, use the following lead status gateway API -

curl --location --request GET 'https://gatewayapi.smallcase.com/v1/<YOUR_GATEWAYNAME>/engine/leadStatus?leadId=612e1fc94d261b4aed130cb8' \
--header 'x-gateway-secret: <YOUR_GATEWAY_API_SECRET>' \
--header 'x-gateway-authtoken: <GUEST_AUTH_TOKEN>'

Sample responses

{
    "success": true,
    "errors": null,
    "data": {
        "leadId": "61cf1d56092bd30ed468feb8",
        "leadCreationDate": "2021-12-31T15:10:14.608Z",
        "status": "Account opened",
        "accCreatedDate": "2021-12-20T18:00:00.000Z",
        "stage": "Completed",
        "leadJourneyStatus": "COMPLETED",
        "leadAccepted": true
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadId": "61b339be29cc994a591a55bc",
        "leadCreationDate": "2021-12-10T11:27:58.613Z",
        "status": "PROCESSING",
        "stage": "E-SIGN VERIFIED",
        "leadJourneyStatus": "PROCESSING",
        "leadAccepted": true
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadId": "623087e3849671cfba579b54",
        "leadCreationDate": "2022-03-15T12:34:43.607Z",
        "status": "PROCESSING",
        "stage": "Submitted",
        "lead_journey_status": "LEAD ACCEPTED BY BROKER",
        "lead_accepted": true
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadId": "58ecb4847b081b6cf331a219",
        "leadCreationDate": "2020-11-02T08:27:26.357Z",
        "status": "PROCESSING",
        "leadJourneyStatus": "LEAD REJECTED BY BROKER",
        "leadAccepted": false
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadJourneyStatus": "[ONLY MOBILE NO ENTERED/ONLY MOBILE VERIFIED/ONLY MOBILE VERIFIED]"
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadJourneyStatus": "LEAD DETAILS NOT AVAILABLE FOR YOU"
    }
}
{
    "success": true,
    "errors": null,
    "data": {
        "leadJourneyStatus": "LEAD DETAILS DOES NOT EXIST"
    }
}

📘

Notes

  1. The signup flow requires initialising a Gateway session (either guest or connected auth token) before calling the signup method.

  2. For "Account opened" status, accCreatedDate is not always available.

  3. For "PROCESSING" status, the stage key is not always available. We highly recommend against using the same since it is not in a standardised format.

👍

Try it out

https://www.smartinvesting.io/signup

FAQs

1. Is there webhook support for leads? No, we do not support webhook for lead updates at the moment.
2. Should we use API secret in the x-gateway-secret header? Yes, the share API secret has to be used for using any of the Gateway APIs.
3. Is there a way to hide certain brokers from account opening flow? We are working on this feature and will keep all integration partners posted on the same.

Did this page help you?