With smallcase Gateway, you can easily import the latest snapshot of a user’s stock, ETF and smallcase holdings, upon one-time user consent.
Using holdings data will help you build a holistic view of a user's equity investments.
To continue, we recommend reading following sections of the Getting Started guide:
When a user intends to import holdings, a transactionId has to be created for the SDK interaction.
Use create holdings import transaction API on your server to create and fetch a unique transactionId.
Use a relevant guest / connected auth token to initialise the gateway session.
Learn more about initialising the gateway session in respective SDK integration page.
Next, pass the holdings import transactionId (generated in step 1) to SDK's trigger transaction method. Gateway SDK will now show relevant screens (broker chooser, broker login, import authorisation, etc) to the user. Once done, the user's latest holdings snapshot is saved in the smallcase system.
Trigger transaction will respond with a connected user auth tokenconnected user auth token - `smallcaseAuthToken` (JWT) containing `smallcaseAuthId` of the broker account with which transaction is (or, should be) performed.
If such JWT is used to initialise Gateway session, SDK restricts user to allow transaction from related broker account only.
Read more - https://developers.gateway.smallcase.com/discuss/61ef6d38d2a7c4000f6346be.
You can decode the JWT and get smallcaseAuthIdsmallcaseAuthId - It is an unique identifier for broker account with which user has logged in. Learn more - https://developers.gateway.smallcase.com/discuss/61ef6d38d2a7c4000f6346be of the linked broker account.
More in the next step.
Optionally, you can register a holdings import webhook for your gateway.
If done, every time a user import their holdings on the client-side, smallcase Gateway systems will hit your registered webhook with the user's holdings data, transactionId, smallcaseAuthId. The data should be saved against the relevant user in your systems on every webhook hit.
On getting success confirmation from the trigger transaction method, you can fetch relevant holdings of the user from your server.
Fetch holdings API should be called from your server by passing relevant connected user auth tokenconnected user auth token - `smallcaseAuthToken` (JWT) containing `smallcaseAuthId` of the broker account with which transaction is (or, should be) performed. If such JWT is used to initialise Gateway session, SDK restricts user to allow transaction from related broker account only. Read more - https://developers.gateway.smallcase.com/discuss/61ef6d38d2a7c4000f6346be (recall: SDK shares this in step 3.1).
Your server can simply pull holdings data (recall: this data was saved in the database at step 3.2).
broker support: 5Paisa, Aliceblue, Angel Broking, Groww, IIFL, Motilal Oswal, Trustline, Upstox & Zerodha
session-based holdings refresh: Most brokers (all except Zerodha) require client-side broker login to update the holdings data (i.e. latest snapshot). Hence, a HOLDINGS_IMPORT transaction has to be triggered via SDK to refresh the user's holdings, each time user places an order directly from their broker's terminal.
session-less holdings refresh: For supported brokers (Zerodha), directly calling fetch user holdings API will ensure that holdings snapshot is updated on-the-fly. The user will still have to authorise holdings for the first time.
Updated 3 months ago