konfig/snaptrade-php-7-sdk

Connect brokerage accounts to your app for live positions and trading

v2.0.13 2024-04-18 04:23 UTC

README

Visit SnapTrade

SnapTrade

Connect brokerage accounts to your app for live positions and trading

Packagist More Info

Table of Contents

Installation & Usage

Requirements

This library requires PHP ^7.0

Composer

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.13"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/snaptrade-php-7-sdk/vendor/autoload.php');

Getting Started

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(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631"
);

Reference

snaptrade.accountInformation.getAllUserHoldings

List all accounts for the user, plus balances, positions, and orders for each account.

🛠️ Usage

$result = $snaptrade->accountInformation->getAllUserHoldings(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631"
);

⚙️ Parameters

user_id: string
user_secret: string
brokerage_authorizations: string

Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations).

🔄 Return

AccountHoldings

🌐 Endpoint

/holdings GET

🔙 Back to Table of Contents

snaptrade.accountInformation.getUserAccountBalance

A list of account balances for the specified account (one per currency that the account holds).

🛠️ Usage

$result = $snaptrade->accountInformation->getUserAccountBalance(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to get balances.

🔄 Return

Balance

🌐 Endpoint

/accounts/{accountId}/balances GET

🔙 Back to Table of Contents

snaptrade.accountInformation.getUserAccountDetails

Return details of a specific investment account

🛠️ Usage

$result = $snaptrade->accountInformation->getUserAccountDetails(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to get detail of.

🔄 Return

Account

🌐 Endpoint

/accounts/{accountId} GET

🔙 Back to Table of Contents

snaptrade.accountInformation.getUserAccountOrders

Fetch all recent orders from a user's account.

🛠️ Usage

$result = $snaptrade->accountInformation->getUserAccountOrders(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631", 
    "all", 
    30
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to get orders.

state: string

defaults value is set to "all"

days: int

Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.

🔄 Return

AccountOrderRecord

🌐 Endpoint

/accounts/{accountId}/orders GET

🔙 Back to Table of Contents

snaptrade.accountInformation.getUserAccountPositions

List account positions

🛠️ Usage

$result = $snaptrade->accountInformation->getUserAccountPositions(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to get positions.

🔄 Return

Position

🌐 Endpoint

/accounts/{accountId}/positions GET

🔙 Back to Table of Contents

snaptrade.accountInformation.getUserHoldings

List balances, positions and orders for the specified account

🛠️ Usage

$result = $snaptrade->accountInformation->getUserHoldings(
    "917c8734-8470-4a3e-a18f-57c3f2ee6631", 
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

account_id: string

The ID of the account to fetch holdings for.

user_id: string
user_secret: string

🔄 Return

AccountHoldingsAccount

🌐 Endpoint

/accounts/{accountId}/holdings GET

🔙 Back to Table of Contents

snaptrade.accountInformation.listUserAccounts

List accounts

🛠️ Usage

$result = $snaptrade->accountInformation->listUserAccounts(
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

user_id: string
user_secret: string

🔄 Return

Account

🌐 Endpoint

/accounts GET

🔙 Back to Table of Contents

snaptrade.accountInformation.updateUserAccount

Update details of an investment account

🛠️ Usage

$result = $snaptrade->accountInformation->updateUserAccount(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "accountId_example"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to update.

🔄 Return

Account

🌐 Endpoint

/accounts/{accountId} PUT

🔙 Back to Table of Contents

snaptrade.apiStatus.check

Check whether the API is operational and verify timestamps.

🛠️ Usage

$result = $snaptrade->apiStatus->check();

🔄 Return

Status

🌐 Endpoint

/ GET

🔙 Back to Table of Contents

snaptrade.authentication.deleteSnapTradeUser

Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.

🛠️ Usage

$result = $snaptrade->authentication->deleteSnapTradeUser(
    "John.doe@snaptrade.com"
);

⚙️ Parameters

user_id: string

🔄 Return

DeleteUserResponse

🌐 Endpoint

/snapTrade/deleteUser DELETE

🔙 Back to Table of Contents

snaptrade.authentication.getUserJWT

Generate encrypted JWT token

🛠️ Usage

$result = $snaptrade->authentication->getUserJWT(
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

user_id: string
user_secret: string

🔄 Return

EncryptedResponse

🌐 Endpoint

/snapTrade/encryptedJWT GET

🔙 Back to Table of Contents

snaptrade.authentication.listSnapTradeUsers

Returns a list of users you've registered over the SnapTrade API.

🛠️ Usage

$result = $snaptrade->authentication->listSnapTradeUsers();

🔄 Return

string[]

🌐 Endpoint

/snapTrade/listUsers GET

🔙 Back to Table of Contents

snaptrade.authentication.loginSnapTradeUser

Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.

🛠️ Usage

$result = $snaptrade->authentication->loginSnapTradeUser(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "ALPACA", 
    True, 
    "https://snaptrade.com", 
    "8b5f262d-4bb9-365d-888a-202bd3b15fa1", 
    "read", 
    "v2"
);

⚙️ Parameters

user_id: string
user_secret: string
broker: string

Slug of the brokerage to connect the user to

immediateRedirect: bool

When set to True, user will be redirected back to the partner's site instead of the connection portal

customRedirect: string

URL to redirect the user to after the user connects their brokerage account

reconnect: string

The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See ‘Reconnecting Accounts’ for more information.

connectionType: string

Sets whether the connection should be read or trade

connectionPortalVersion: string

Sets the version of the connection portal to render, with a default to 'v2'

🔄 Return

AuthenticationLoginSnapTradeUser200Response

🌐 Endpoint

/snapTrade/login POST

🔙 Back to Table of Contents

snaptrade.authentication.registerSnapTradeUser

Create SnapTrade user

🛠️ Usage

$result = $snaptrade->authentication->registerSnapTradeUser(
    "snaptrade-user-123"
);

⚙️ Parameters

userId: string

SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user

🔄 Return

UserIDandSecret

🌐 Endpoint

/snapTrade/registerUser POST

🔙 Back to Table of Contents

snaptrade.authentication.resetSnapTradeUserSecret

Obtain a new user secret for a user

🛠️ Usage

$result = $snaptrade->authentication->resetSnapTradeUserSecret(
    "snaptrade-user-123", 
    "h81@cx1lkalablakwjaltkejraj11="
);

⚙️ Parameters

userId: string

SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user

userSecret: string

SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user.

🔄 Return

UserIDandSecret

🌐 Endpoint

/snapTrade/resetUserSecret POST

🔙 Back to Table of Contents

snaptrade.connections.detailBrokerageAuthorization

Get brokerage authorization details

🛠️ Usage

$result = $snaptrade->connections->detailBrokerageAuthorization(
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

authorization_id: string

The ID of a brokerage authorization object.

user_id: string
user_secret: string

🔄 Return

BrokerageAuthorization

🌐 Endpoint

/authorizations/{authorizationId} GET

🔙 Back to Table of Contents

snaptrade.connections.listBrokerageAuthorizations

List all brokerage authorizations for the user

🛠️ Usage

$result = $snaptrade->connections->listBrokerageAuthorizations(
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

user_id: string
user_secret: string

🔄 Return

BrokerageAuthorization

🌐 Endpoint

/authorizations GET

🔙 Back to Table of Contents

snaptrade.connections.removeBrokerageAuthorization

Delete brokerage authorization

🛠️ Usage

$snaptrade->connections->removeBrokerageAuthorization(
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    "John.doe@snaptrade.com", 
    "USERSECRET123"
);

⚙️ Parameters

authorization_id: string

The ID of the Authorization to delete.

user_id: string
user_secret: string

🔄 Return

void (empty response body)

🌐 Endpoint

/authorizations/{authorizationId} DELETE

🔙 Back to Table of Contents

snaptrade.connections.sessionEvents

List all session events for the partner

🛠️ Usage

$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"
);

⚙️ Parameters

partner_client_id: string
user_id: string

Optional comma seperated list of user IDs used to filter the request on specific users

session_id: string

Optional comma seperated list of session IDs used to filter the request on specific users

🔄 Return

ConnectionsSessionEvents200ResponseInner

🌐 Endpoint

/sessionEvents GET

🔙 Back to Table of Contents

snaptrade.options.getOptionStrategy

Creates an option strategy object that will be used to place an option strategy order

🛠️ Usage

$result = $snaptrade->options->getOptionStrategy(
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    [
        [
            "action" => "BUY_TO_OPEN",
            "option_symbol_id" => "SPY220819P00200000",
            "quantity" => 1,
        ]
    ], 
    "CUSTOM", 
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "accountId_example"
);

⚙️ Parameters

underlying_symbol_id: string
legs: OptionLeg[]
strategy_type: string
user_id: string
user_secret: string
account_id: string

The ID of the account to create the option strategy object in.

🔄 Return

StrategyQuotes

🌐 Endpoint

/accounts/{accountId}/optionStrategy POST

🔙 Back to Table of Contents

snaptrade.options.getOptionsChain

Get the options chain

🛠️ Usage

$result = $snaptrade->options->getOptionsChain(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "accountId_example", 
    "symbol_example"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to get the options chain from.

symbol: string

Universal symbol ID if symbol

🔄 Return

OptionChainInner

🌐 Endpoint

/accounts/{accountId}/optionsChain GET

🔙 Back to Table of Contents

snaptrade.options.getOptionsStrategyQuote

Get latest market data of option strategy

🛠️ Usage

$result = $snaptrade->options->getOptionsStrategyQuote(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "accountId_example", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account the strategy will be placed in.

option_strategy_id: string

Option strategy id obtained from response when creating option strategy object

🔄 Return

StrategyQuotes

🌐 Endpoint

/accounts/{accountId}/optionStrategy/{optionStrategyId} GET

🔙 Back to Table of Contents

snaptrade.options.listOptionHoldings

Get the options holdings in the account

🛠️ Usage

$result = $snaptrade->options->listOptionHoldings(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "accountId_example"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to fetch options holdings for.

🔄 Return

OptionsPosition

🌐 Endpoint

/accounts/{accountId}/options GET

🔙 Back to Table of Contents

snaptrade.options.placeOptionStrategy

Place an option strategy order on the brokerage

🛠️ Usage

$result = $snaptrade->options->placeOptionStrategy(
    "Limit", 
    "FOK", 
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    31.33
);

⚙️ Parameters

order_type:
time_in_force:
user_id: string
user_secret: string
account_id: string

The ID of the account to execute the strategy in.

option_strategy_id: string

Option strategy id obtained from response when creating option strategy object

price: float

Trade Price if limit or stop limit order

🔄 Return

StrategyOrderRecord

🌐 Endpoint

/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute POST

🔙 Back to Table of Contents

snaptrade.referenceData.getCurrencyExchangeRatePair

Return the exchange rate of a currency pair

🛠️ Usage

$result = $snaptrade->referenceData->getCurrencyExchangeRatePair(
    "currencyPair_example"
);

⚙️ Parameters

currency_pair: string

A currency pair based on currency code for example, {CAD-USD}

🔄 Return

ExchangeRatePairs

🌐 Endpoint

/currencies/rates/{currencyPair} GET

🔙 Back to Table of Contents

snaptrade.referenceData.getPartnerInfo

Get metadata related to Snaptrade partner

🛠️ Usage

$result = $snaptrade->referenceData->getPartnerInfo();

🔄 Return

PartnerData

🌐 Endpoint

/snapTrade/partners GET

🔙 Back to Table of Contents

snaptrade.referenceData.getSecurityTypes

List security types available on SnapTrade.

🛠️ Usage

$result = $snaptrade->referenceData->getSecurityTypes();

🔄 Return

SecurityType

🌐 Endpoint

/securityTypes GET

🔙 Back to Table of Contents

snaptrade.referenceData.getStockExchanges

List exchanges

🛠️ Usage

$result = $snaptrade->referenceData->getStockExchanges();

🔄 Return

Exchange

🌐 Endpoint

/exchanges GET

🔙 Back to Table of Contents

snaptrade.referenceData.getSymbols

Search for symbols

🛠️ Usage

$result = $snaptrade->referenceData->getSymbols(
    "apple"
);

⚙️ Parameters

substring: string

🔄 Return

UniversalSymbol

🌐 Endpoint

/symbols POST

🔙 Back to Table of Contents

snaptrade.referenceData.getSymbolsByTicker

Get details of a symbol by the ticker or the universal_symbol_id

🛠️ Usage

$result = $snaptrade->referenceData->getSymbolsByTicker(
    "query_example"
);

⚙️ Parameters

query: string

The ticker or universal_symbol_id of the UniversalSymbol to get.

🔄 Return

UniversalSymbol

🌐 Endpoint

/symbols/{query} GET

🔙 Back to Table of Contents

snaptrade.referenceData.listAllBrokerageAuthorizationType

List of all brokerage authorization types

🛠️ Usage

$result = $snaptrade->referenceData->listAllBrokerageAuthorizationType(
    "QUESTRADE,ALPACA"
);

⚙️ Parameters

brokerage: string

Comma separated value of brokerage slugs

🔄 Return

BrokerageAuthorizationTypeReadOnly

🌐 Endpoint

/brokerageAuthorizationTypes GET

🔙 Back to Table of Contents

snaptrade.referenceData.listAllBrokerages

List brokerages

🛠️ Usage

$result = $snaptrade->referenceData->listAllBrokerages();

🔄 Return

Brokerage

🌐 Endpoint

/brokerages GET

🔙 Back to Table of Contents

snaptrade.referenceData.listAllCurrencies

List currencies

🛠️ Usage

$result = $snaptrade->referenceData->listAllCurrencies();

🔄 Return

Currency

🌐 Endpoint

/currencies GET

🔙 Back to Table of Contents

snaptrade.referenceData.listAllCurrenciesRates

List currency exchange rates

🛠️ Usage

$result = $snaptrade->referenceData->listAllCurrenciesRates();

🔄 Return

ExchangeRatePairs

🌐 Endpoint

/currencies/rates GET

🔙 Back to Table of Contents

snaptrade.referenceData.symbolSearchUserAccount

Search for symbols available in an account

🛠️ Usage

$result = $snaptrade->referenceData->symbolSearchUserAccount(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631", 
    "apple"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to search for symbols within.

substring: string

🔄 Return

UniversalSymbol

🌐 Endpoint

/accounts/{accountId}/symbols POST

🔙 Back to Table of Contents

snaptrade.trading.cancelUserAccountOrder

Cancel open order in account

🛠️ Usage

$result = $snaptrade->trading->cancelUserAccountOrder(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3"
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string

The ID of the account to cancel the order in.

brokerage_order_id: string

🔄 Return

AccountOrderRecord

🌐 Endpoint

/accounts/{accountId}/orders/cancel POST

🔙 Back to Table of Contents

snaptrade.trading.getOrderImpact

Check impact of trades on account.

🛠️ Usage

$result = $snaptrade->trading->getOrderImpact(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    "BUY", 
    "Limit", 
    31.33, 
    31.33, 
    "FOK", 
    3.14, 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    100
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string
action:
order_type:
price: float

Trade Price if limit or stop limit order

stop: float

Stop Price. If stop loss or stop limit order, the price to trigger the stop

time_in_force:
units: float
universal_symbol_id: string
notional_value: float

🔄 Return

ManualTradeAndImpact

🌐 Endpoint

/trade/impact POST

🔙 Back to Table of Contents

snaptrade.trading.getUserAccountQuotes

Get symbol quotes

🛠️ Usage

$result = $snaptrade->trading->getUserAccountQuotes(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "symbols_example", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631", 
    True
);

⚙️ Parameters

user_id: string
user_secret: string
symbols: string

List of universal_symbol_id or tickers to get quotes for.

account_id: string

The ID of the account to get quotes.

use_ticker: bool

Should be set to True if providing tickers.

🔄 Return

SymbolsQuotesInner

🌐 Endpoint

/accounts/{accountId}/quotes GET

🔙 Back to Table of Contents

snaptrade.trading.placeForceOrder

Place a trade with NO validation.

🛠️ Usage

$result = $snaptrade->trading->placeForceOrder(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    "BUY", 
    "Limit", 
    31.33, 
    31.33, 
    "FOK", 
    3.14, 
    "2bcd7cc3-e922-4976-bce1-9858296801c3", 
    100
);

⚙️ Parameters

user_id: string
user_secret: string
account_id: string
action:
order_type:
price: float

Trade Price if limit or stop limit order

stop: float

Stop Price. If stop loss or stop limit order, the price to trigger the stop

time_in_force:
units: float
universal_symbol_id: string
notional_value: float

🔄 Return

AccountOrderRecord

🌐 Endpoint

/trade/place POST

🔙 Back to Table of Contents

snaptrade.trading.placeOCOOrder

Place a OCO (One Cancels Other) order

🛠️ Usage

$result = $snaptrade->trading->placeOCOOrder(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    None, 
    None
);

⚙️ Parameters

user_id: string
user_secret: string
first_trade_id:

The ID of first trade object obtained from trade/impact endpoint

second_trade_id:

The ID of second trade object obtained from trade/impact endpoint

🔄 Return

AccountOrderRecord

🌐 Endpoint

/trade/oco POST

🔙 Back to Table of Contents

snaptrade.trading.placeOrder

Place order

🛠️ Usage

$result = $snaptrade->trading->placeOrder(
    "tradeId_example", 
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    True
);

⚙️ Parameters

trade_id: string

The ID of trade object obtained from trade/impact endpoint

user_id: string
user_secret: string
wait_to_confirm: bool

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

🔄 Return

AccountOrderRecord

🌐 Endpoint

/trade/{tradeId} POST

🔙 Back to Table of Contents

snaptrade.transactionsAndReporting.getActivities

Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance

🛠️ Usage

$result = $snaptrade->transactionsAndReporting->getActivities(
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "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", 
    "DIVIDEND"
);

⚙️ Parameters

user_id: string
user_secret: string
start_date: \DateTime
end_date: \DateTime
accounts: string

Optional comma seperated list of account IDs used to filter the request on specific accounts

brokerage_authorizations: string

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

type: string

Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT

🔄 Return

UniversalActivity

🌐 Endpoint

/activities GET

🔙 Back to Table of Contents

snaptrade.transactionsAndReporting.getReportingCustomRange

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.

🛠️ Usage

$result = $snaptrade->transactionsAndReporting->getReportingCustomRange(
    "2022-01-24", 
    "2022-01-24", 
    "John.doe@snaptrade.com", 
    "USERSECRET123", 
    "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", 
    True, 
    "monthly"
);

⚙️ Parameters

start_date: \DateTime
end_date: \DateTime
user_id: string
user_secret: string
accounts: string

Optional comma seperated list of account IDs used to filter the request on specific accounts

detailed: bool

Optional, increases frequency of data points for the total value and contribution charts if set to true

frequency: string

Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.

🔄 Return

PerformanceCustom

🌐 Endpoint

/performance/custom GET

🔙 Back to Table of Contents

Author

This PHP package is automatically generated by Konfig