logo
SnapTrade

Getting Started

1) Initialize a client with your clientId and consumerKey

You can get your clientId and consumerKey by contacting api@snaptrade.com

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 includes a redirectURI to be used to login a user to the connection 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.

The ID of the account to pull holdings for

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

You can get your clientId and consumerKey by contacting api@snaptrade.com

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 includes a redirectURI to be used to login a user to the connection 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

You can get your clientId and consumerKey by contacting api@snaptrade.com

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.

The ID of the account to pull holdings for. The available values are pulled from the 'List User Accounts' step.
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.

The ID of the account to pull holdings for. The available values are pulled from the 'List User Accounts' step.

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.

Optional comma seperated list of account IDs used to filter the request on specific accounts
Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
Optional comma seperated list of types to filter activities by

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.

List of universal_symbol_id or tickers to get quotes for
The ID of the account to get quotes
Should be set to True if providing tickers
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

You can get your clientId and consumerKey by contacting api@snaptrade.com

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.

The ID of the account to pull holdings for.

4) Place the order

Place the order

The ID of the trade created at the previous step.

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

The ID of the account to pull holdings for.
Go back
Handling Users