SnapTrade
Getting Started
1) Initialize a client with your clientId and consumerKey
2) Check that the client is able to make a request to the API server
Call the API Status endpoint to make sure the API is live and that you can make
the most basic request. You should receive a response indicating the API status,
current server timestamp, and internal API minor version number.
3) Create a new user on SnapTrade
To create a secure brokerage authorization, we first need to register a test
user. Call the Register user endpoint with a userId which can be any string as
long as it's unique to a user. Upon receiving a 200 response, the user is
registered successfully and you should receive a response with a user id and a
randomly generated user secret. You can think of the user secret like a per-user
API key that provides an additional layer of security for protecting user data.
The user id and user secret need to be passed along to all SnapTrade API
endpoints that involve access to user data.
4) Get a redirect URI
SnapTrade partners need to generate a redirect URI for a user so they can
securely log in to the SnapTrade Connection portal and connect their accounts.
The redirect URI can be generated by sending a POST request to the Login
endpoint. userId and userSecret (previously generated through calling the
registerUser endpoint) have to be in the query parameters of the POST request.
The response would indicate a redirectURI to be used for login a user to the
SnapTrade portal.
5) List accounts
After connecting an account to snaptrade, you can see the account IDs by calling
list_user_accounts
.6) Get account holdings data for a user
In order to retrieve user holdings for a specific account, you can call the
Holdings endpoint by passing the clientId, timestamp, userId and list of account
numbers (accounts) to filter the holdings. In the response, you should get an
array of objects containing each account holdings data.
7) Deleting a user
Disabling all brokerage authorizations and permanently deleting all data
associated with the user
Up next
Registering Users
SnapTrade
Registering Users
1) Initialize a client with your clientId and consumerKey
2) Check that the client is able to make a request to the API server
Call the API Status endpoint to make sure the API is live and that you can make
the most basic request. You should receive a response indicating the API status,
current server timestamp, and internal API minor version number.
3) Register User
To create a secure brokerage authorization, we first need to register a test
user. Call the Register user endpoint with a userId which can be any string as
long as it's unique to a user. Upon receiving a 200 response, the user is
registered successfully and you should receive a response with a user id and a
randomly generated user secret. You can think of the user secret like a per-user
API key that provides an additional layer of security for protecting user data.
The user id and user secret need to be passed along to all SnapTrade API
endpoints that involve access to user data.
4) Login User
SnapTrade partners need to generate a redirect URI for a user so they can
securely log in to the SnapTrade Connection portal and connect their accounts.
The redirect URI can be generated by sending a POST request to the Login
endpoint. userId and userSecret (previously generated through calling the
registerUser endpoint) have to be in the query parameters of the POST request.
The response would indicate a redirectURI to be used for login a user to the
SnapTrade portal.
5) List Users
6) Deleting a user
Disabling all brokerage authorizations and permanently deleting all data
associated with the user
Go back
Getting Started
Up next
Get Account Holdings for a User
SnapTrade
Get Account Holdings for a User
1) Initialize a client with your clientId and consumerKey
2) List accounts
You can see the account IDs by calling
list_user_accounts
.3) Get account holdings data for a user
In order to retrieve user holdings for a specific account, you can call the
Holdings endpoint by passing the clientId, timestamp, userId and list of account
numbers (accounts) to filter the holdings. In the response, you should get an
array of objects containing each account holdings data.
Go back
Registering Users
Up next
Handling Users
SnapTrade
Handling Users
1) Initialize SnapTrade client, user_id
, and user_secret
2) List accounts
You can see the account IDs by calling
list_user_accounts
.3) Get account holdings data for a user
In order to retrieve user holdings for a specific account, you can call the
Holdings endpoint by passing the clientId, timestamp, userId and list of account
numbers (accounts) to filter the holdings. In the response, you should get an
array of objects containing each account holdings data.
4) Get Transactions / Historical Activities
Returns activities (transactions) for a user. Specifying start and end date is
highly recommended for automatic calls for better performance. This uses the
TransactionsAndReporting API.
5) Get Quotes
Get symbol quotes for a user, these are account and thus brokerage specific.
That means if you have a US only account, you cannot get quotes for
international exchanges. This uses the Trading API.
Go back
Get Account Holdings for a User
Up next
Placing Trades
SnapTrade
Placing Trades
1) Create user and Get redirect URL for a trading connection
2) List accounts
After connecting an account you can see the account IDs by calling
list_user_accounts
.3) Get Order Impact
Check the account has enough cash to place trades.
4) Place the order
Place the order
Alternative - Place Order without checking impact
If you don't need to check the impact of an order before placing it use
place_force_order
Go back
Handling Users