- Installation & Usage
- Getting Started
- Reference
snaptrade.accountInformation.getAllUserHoldings
snaptrade.accountInformation.getUserAccountBalance
snaptrade.accountInformation.getUserAccountDetails
snaptrade.accountInformation.getUserAccountOrders
snaptrade.accountInformation.getUserAccountPositions
snaptrade.accountInformation.getUserHoldings
snaptrade.accountInformation.listUserAccounts
snaptrade.accountInformation.updateUserAccount
snaptrade.apiStatus.check
snaptrade.authentication.deleteSnapTradeUser
snaptrade.authentication.listSnapTradeUsers
snaptrade.authentication.loginSnapTradeUser
snaptrade.authentication.registerSnapTradeUser
snaptrade.authentication.resetSnapTradeUserSecret
snaptrade.connections.detailBrokerageAuthorization
snaptrade.connections.disableBrokerageAuthorization
snaptrade.connections.listBrokerageAuthorizations
snaptrade.connections.refreshBrokerageAuthorization
snaptrade.connections.removeBrokerageAuthorization
snaptrade.connections.sessionEvents
snaptrade.options.getOptionStrategy
snaptrade.options.getOptionsChain
snaptrade.options.getOptionsStrategyQuote
snaptrade.options.listOptionHoldings
snaptrade.options.placeOptionStrategy
snaptrade.referenceData.getCurrencyExchangeRatePair
snaptrade.referenceData.getPartnerInfo
snaptrade.referenceData.getSecurityTypes
snaptrade.referenceData.getStockExchanges
snaptrade.referenceData.getSymbols
snaptrade.referenceData.getSymbolsByTicker
snaptrade.referenceData.listAllBrokerageAuthorizationType
snaptrade.referenceData.listAllBrokerages
snaptrade.referenceData.listAllCurrencies
snaptrade.referenceData.listAllCurrenciesRates
snaptrade.referenceData.symbolSearchUserAccount
snaptrade.trading.cancelUserAccountOrder
snaptrade.trading.getOrderImpact
snaptrade.trading.getUserAccountQuotes
snaptrade.trading.placeForceOrder
snaptrade.trading.placeOrder
snaptrade.transactionsAndReporting.getActivities
snaptrade.transactionsAndReporting.getReportingCustomRange
This library requires PHP ^7.0
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/passiv/snaptrade-php-7-sdk.git"
}
],
"require": {
"konfig/snaptrade-php-7-sdk": "2.0.43"
}
}
Then run composer install
Download the files and include autoload.php
:
<?php
require_once('/path/to/snaptrade-php-7-sdk/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$snaptrade = new \SnapTrade\Client(
getenv("SNAPTRADE_CONSUMER_KEY"),
getenv("SNAPTRADE_CLIENT_ID")
);
$result = $snaptrade->accountInformation->getAllUserHoldings(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
Deprecated, please use the account-specific holdings endpoint instead.
List all accounts for the user, plus balances, positions, and orders for each account.
$result = $snaptrade->accountInformation->getAllUserHoldings(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).
/holdings
GET
π Back to Table of Contents
Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade allows holding multiple currencies in the same account.
The data returned here is cached. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->getUserAccountBalance(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
/accounts/{accountId}/balances
GET
π Back to Table of Contents
Returns account detail known to SnapTrade for the specified account.
The data returned here is always cached and refreshed once a day. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->getUserAccountDetails(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
/accounts/{accountId}
GET
π Back to Table of Contents
Returns a list of recent orders in the specified account.
The data returned here is cached. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->getUserAccountOrders(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"all",
30
);
defaults value is set to "all"
Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
/accounts/{accountId}/orders
GET
π Back to Table of Contents
Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the options endpoint.
The data returned here is cached. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->getUserAccountPositions(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
/accounts/{accountId}/positions
GET
π Back to Table of Contents
Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained balances, positions and orders endpoints. The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.
The data returned here is cached. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->getUserHoldings(
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
/accounts/{accountId}/holdings
GET
π Back to Table of Contents
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
The data returned here is always cached and refreshed once a day. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->accountInformation->listUserAccounts(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
/accounts
GET
π Back to Table of Contents
Updates various properties of a specified account.
$result = $snaptrade->accountInformation->updateUserAccount(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"accountId_example"
);
The ID of the account to update.
/accounts/{accountId}
PUT
π Back to Table of Contents
Check whether the API is operational and verify timestamps.
$result = $snaptrade->apiStatus->check();
/
GET
π Back to Table of Contents
Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a USER_DELETED
webhook will be sent.
$result = $snaptrade->authentication->deleteSnapTradeUser(
"snaptrade-user-123"
);
/snapTrade/deleteUser
DELETE
π Back to Table of Contents
Returns a list of all registered user IDs. Please note that the response is not currently paginated.
$result = $snaptrade->authentication->listSnapTradeUsers();
string[]
/snapTrade/listUsers
GET
π Back to Table of Contents
Authenticates a SnapTrade user and returns the Connection Portal URL used for connecting brokerage accounts. Please check this guide for how to integrate the Connection Portal into your app.
Please note that the returned URL expires in 5 minutes.
$result = $snaptrade->authentication->loginSnapTradeUser(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"ALPACA",
True,
"https://snaptrade.com",
"8b5f262d-4bb9-365d-888a-202bd3b15fa1",
"read",
"v3"
);
Slug of the brokerage to connect the user to. See the integrations page for a list of supported brokerages and their slugs.
When set to true
, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the guide on ways to integrate the connection portal for more information.
URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the guide on ways to integrate the connection portal for more information.
The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the guide on fixing broken connections for more information.
Sets whether the connection should be read-only or trade-enabled.
Sets the version of the connection portal to render.
AuthenticationLoginSnapTradeUser200Response
/snapTrade/login
POST
π Back to Table of Contents
Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
$result = $snaptrade->authentication->registerSnapTradeUser(
"snaptrade-user-123"
);
SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
/snapTrade/registerUser
POST
π Back to Table of Contents
Rotates the secret for a SnapTrade user. You might use this if userSecret
is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
$result = $snaptrade->authentication->resetSnapTradeUserSecret(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.
/snapTrade/resetUserSecret
POST
π Back to Table of Contents
Returns a single connection for the specified ID.
$result = $snaptrade->connections->detailBrokerageAuthorization(
"87b24961-b51e-4db8-9226-f198f6518a89",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
/authorizations/{authorizationId}
GET
π Back to Table of Contents
Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN
webhook for the connection.
Please contact us in order to use this endpoint as it is disabled by default.
$result = $snaptrade->connections->disableBrokerageAuthorization(
"87b24961-b51e-4db8-9226-f198f6518a89",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
BrokerageAuthorizationDisabledConfirmation
/authorizations/{authorizationId}/disable
POST
π Back to Table of Contents
Returns a list of all connections for the specified user. Note that Connection
and Brokerage Authorization
are interchangeable, but the term Connection
is preferred and used in the doc for consistency.
A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
$result = $snaptrade->connections->listBrokerageAuthorizations(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
/authorizations
GET
π Back to Table of Contents
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED
webhook will be sent once the sync completes for each account under the connection.
Please contact support for access as this endpoint is not enabled by default.
$result = $snaptrade->connections->refreshBrokerageAuthorization(
"87b24961-b51e-4db8-9226-f198f6518a89",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
BrokerageAuthorizationRefreshConfirmation
/authorizations/{authorizationId}/refresh
POST
π Back to Table of Contents
Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
$snaptrade->connections->removeBrokerageAuthorization(
"87b24961-b51e-4db8-9226-f198f6518a89",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61"
);
void (empty response body)
/authorizations/{authorizationId}
DELETE
π Back to Table of Contents
Returns a list of session events associated with a user.
$result = $snaptrade->connections->sessionEvents(
"SNAPTRADETEST",
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2"
);
Optional comma separated list of user IDs used to filter the request on specific users
Optional comma separated list of session IDs used to filter the request on specific users
ConnectionsSessionEvents200ResponseInner
/sessionEvents
GET
π Back to Table of Contents
Creates an option strategy object that will be used to place an option strategy order.
$result = $snaptrade->options->getOptionStrategy(
"2bcd7cc3-e922-4976-bce1-9858296801c3",
[
[
"action" => "BUY_TO_OPEN",
"option_symbol_id" => "SPY220819P00200000",
"quantity" => 1,
]
],
"CUSTOM",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"accountId_example"
);
legs: OptionLeg
[]
The ID of the account to create the option strategy object in.
/accounts/{accountId}/optionStrategy
POST
π Back to Table of Contents
Returns the option chain for the specified symbol in the specified account.
$result = $snaptrade->options->getOptionsChain(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"accountId_example",
"symbol_example"
);
The ID of the account to get the options chain from.
Universal symbol ID if symbol
/accounts/{accountId}/optionsChain
GET
π Back to Table of Contents
Returns a Strategy Quotes object which has latest market data of the specified option strategy.
$result = $snaptrade->options->getOptionsStrategyQuote(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"accountId_example",
"2bcd7cc3-e922-4976-bce1-9858296801c3"
);
The ID of the account the strategy will be placed in.
Option strategy id obtained from response when creating option strategy object
/accounts/{accountId}/optionStrategy/{optionStrategyId}
GET
π Back to Table of Contents
Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the positions endpoint.
The data returned here is cached. How long the data is cached for varies by brokerage. Check the brokerage integrations doc and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->options->listOptionHoldings(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631"
);
/accounts/{accountId}/options
GET
π Back to Table of Contents
Places the option strategy order and returns the order record received from the brokerage.
$result = $snaptrade->options->placeOptionStrategy(
"Market",
"FOK",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"2bcd7cc3-e922-4976-bce1-9858296801c3",
"2bcd7cc3-e922-4976-bce1-9858296801c3",
31.33
);
The ID of the account to execute the strategy in.
Option strategy id obtained from response when creating option strategy object
Trade Price if limit or stop limit order
/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute
POST
π Back to Table of Contents
Returns an Exchange Rate Pair object for the specified Currency Pair.
$result = $snaptrade->referenceData->getCurrencyExchangeRatePair(
"currencyPair_example"
);
A currency pair based on currency code for example, {CAD-USD}
/currencies/rates/{currencyPair}
GET
π Back to Table of Contents
Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
$result = $snaptrade->referenceData->getPartnerInfo();
/snapTrade/partners
GET
π Back to Table of Contents
Return all available security types supported by SnapTrade.
$result = $snaptrade->referenceData->getSecurityTypes();
/securityTypes
GET
π Back to Table of Contents
Returns a list of all supported Exchanges.
$result = $snaptrade->referenceData->getStockExchanges();
/exchanges
GET
π Back to Table of Contents
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
$result = $snaptrade->referenceData->getSymbols(
"AAPL"
);
The search query for symbols.
/symbols
POST
π Back to Table of Contents
Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the Yahoo Finance ticker format(click on "Yahoo Finance Market Coverage and Data Delays"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
$result = $snaptrade->referenceData->getSymbolsByTicker(
"query_example"
);
The ticker or Universal Symbol ID to look up the symbol with.
/symbols/{query}
GET
π Back to Table of Contents
Returns a list of all defined Brokerage authorization Type objects.
$result = $snaptrade->referenceData->listAllBrokerageAuthorizationType(
"QUESTRADE,ALPACA"
);
Comma separated value of brokerage slugs
BrokerageAuthorizationTypeReadOnly
/brokerageAuthorizationTypes
GET
π Back to Table of Contents
Returns a list of all defined Brokerage objects.
$result = $snaptrade->referenceData->listAllBrokerages();
/brokerages
GET
π Back to Table of Contents
Returns a list of all defined Currency objects.
$result = $snaptrade->referenceData->listAllCurrencies();
/currencies
GET
π Back to Table of Contents
Returns a list of all Exchange Rate Pairs for all supported Currencies.
$result = $snaptrade->referenceData->listAllCurrenciesRates();
/currencies/rates
GET
π Back to Table of Contents
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
The search results are further limited to the symbols supported by the brokerage for which the account is under.
$result = $snaptrade->referenceData->symbolSearchUserAccount(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"AAPL"
);
The search query for symbols.
/accounts/{accountId}/symbols
POST
π Back to Table of Contents
Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
$result = $snaptrade->trading->cancelUserAccountOrder(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"66a033fa-da74-4fcf-b527-feefdec9257e"
);
Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
/accounts/{accountId}/orders/cancel
POST
π Back to Table of Contents
Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a Trade
object and the ID of the object can be used to place the order with the brokerage using the place checked order endpoint. Please note that the Trade
object returned expires after 5 minutes. Any order placed using an expired Trade
will be rejected.
$result = $snaptrade->trading->getOrderImpact(
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"BUY",
"2bcd7cc3-e922-4976-bce1-9858296801c3",
"Market",
"FOK",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
31.33,
31.33,
10.5,
None
);
Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
The limit price for Limit
and StopLimit
orders.
The price at which a stop order is triggered for Stop
and StopLimit
orders.
units: float
notional_value: ManualTradeFormNotionalValue
/trade/impact
POST
π Back to Table of Contents
Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
$result = $snaptrade->trading->getUserAccountQuotes(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"symbols_example",
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
True
);
List of Universal Symbol IDs or tickers to get quotes for.
Should be set to True
if symbols
are comprised of tickers. Defaults to False
if not provided.
/accounts/{accountId}/quotes
GET
π Back to Table of Contents
Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the check order impact endpoint.
It's recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the manual refresh endpoint for this.
$result = $snaptrade->trading->placeForceOrder(
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
"BUY",
"2bcd7cc3-e922-4976-bce1-9858296801c3",
"Market",
"FOK",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
31.33,
31.33,
10.5,
None
);
Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
The limit price for Limit
and StopLimit
orders.
The price at which a stop order is triggered for Stop
and StopLimit
orders.
units: float
notional_value: ManualTradeFormNotionalValue
/trade/place
POST
π Back to Table of Contents
Places the previously checked order with the brokerage. The tradeId
is obtained from the check order impact endpoint. If you prefer to place the order without checking for impact first, you can use the place order endpoint.
It's recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the manual refresh endpoint for this.
$result = $snaptrade->trading->placeOrder(
"139e307a-82f7-4402-b39e-4da7baa87758",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
True
);
Obtained from calling the check order impact endpoint
Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING
as we will not wait to check on the status before responding to the request.
/trade/{tradeId}
POST
π Back to Table of Contents
Returns all historical transactions for the specified user and filtering criteria. It's recommended to use startDate
and endDate
to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the trade_date
field if you need them in a specific order.
The data returned here is always cached and refreshed once a day. If you need real-time data, please use the manual refresh endpoint.
$result = $snaptrade->transactionsAndReporting->getActivities(
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"2022-01-24",
"2022-01-24",
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
"BUY,SELL,DIVIDEND"
);
The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on trade_date
.
The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on trade_date
.
Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The brokerageAuthorizations
parameter takes precedence over this parameter.
Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the accounts
parameter.
Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY
- Asset bought. - SELL
- Asset sold. - DIVIDEND
- Dividend payout. - CONTRIBUTION
- Cash contribution. - WITHDRAWAL
- Cash withdrawal. - REI
- Dividend reinvestment. - INTEREST
- Interest deposited into the account. - FEE
- Fee withdrawn from the account.
/activities
GET
π Back to Table of Contents
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
$result = $snaptrade->transactionsAndReporting->getReportingCustomRange(
"2022-01-24",
"2022-01-24",
"snaptrade-user-123",
"adf2aa34-8219-40f7-a6b3-60156985cc61",
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
True,
"monthly"
);
Optional comma separated list of account IDs used to filter the request on specific accounts
Optional, increases frequency of data points for the total value and contribution charts if set to true
Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
/performance/custom
GET
π Back to Table of Contents
This PHP package is automatically generated by Konfig