Download the PHP package konfig/snaptrade-php-sdk without Composer
On this page you can find all versions of the php package konfig/snaptrade-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package snaptrade-php-sdk
Table of Contents
- Installation & Usage
- Requirements
- Composer
- Manual Installation
- 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.getUserJWT
snaptrade.authentication.listSnapTradeUsers
snaptrade.authentication.loginSnapTradeUser
snaptrade.authentication.registerSnapTradeUser
snaptrade.authentication.resetSnapTradeUserSecret
snaptrade.connections.detailBrokerageAuthorization
snaptrade.connections.listBrokerageAuthorizations
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.placeOCOOrder
snaptrade.trading.placeOrder
snaptrade.transactionsAndReporting.getActivities
snaptrade.transactionsAndReporting.getReportingCustomRange
Installation & Usage
Requirements
This library requires PHP ^8.0
Composer
To install the bindings via Composer, add the following to composer.json
:
Then run composer install
Manual Installation
Download the files and include autoload.php
:
Getting Started
Please follow the installation procedure and then run the following:
Reference
snaptrade.accountInformation.getAllUserHoldings
List all accounts for the user, plus balances, positions, and orders for each account.
π οΈ Usage
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
π 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
βοΈ Parameters
user_id: string
π Return
DeleteUserResponse
π Endpoint
/snapTrade/deleteUser
DELETE
π Back to Table of Contents
snaptrade.authentication.getUserJWT
Generate encrypted JWT token
π οΈ Usage
βοΈ 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
π 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ Parameters
user_id: string
user_secret: string
π Return
BrokerageAuthorization
π Endpoint
/authorizations
GET
π Back to Table of Contents
snaptrade.connections.removeBrokerageAuthorization
Delete brokerage authorization
π οΈ Usage
βοΈ 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
βοΈ 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
βοΈ Parameters
underlying_symbol_id: string
legs:
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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
βοΈ 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
π Return
PartnerData
π Endpoint
/snapTrade/partners
GET
π Back to Table of Contents
snaptrade.referenceData.getSecurityTypes
List security types available on SnapTrade.
π οΈ Usage
π Return
SecurityType
π Endpoint
/securityTypes
GET
π Back to Table of Contents
snaptrade.referenceData.getStockExchanges
List exchanges
π οΈ Usage
π Return
Exchange
π Endpoint
/exchanges
GET
π Back to Table of Contents
snaptrade.referenceData.getSymbols
Search for symbols
π οΈ Usage
βοΈ 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
βοΈ 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
βοΈ 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
π Return
Brokerage
π Endpoint
/brokerages
GET
π Back to Table of Contents
snaptrade.referenceData.listAllCurrencies
List currencies
π οΈ Usage
π Return
Currency
π Endpoint
/currencies
GET
π Back to Table of Contents
snaptrade.referenceData.listAllCurrenciesRates
List currency exchange rates
π οΈ Usage
π Return
ExchangeRatePairs
π Endpoint
/currencies/rates
GET
π Back to Table of Contents
snaptrade.referenceData.symbolSearchUserAccount
Search for symbols available in an account
π οΈ Usage
βοΈ 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
βοΈ 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
βοΈ 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:
universal_symbol_id: string
notional_value:
π Return
ManualTradeAndImpact
π Endpoint
/trade/impact
POST
π Back to Table of Contents
snaptrade.trading.getUserAccountQuotes
Get symbol quotes
π οΈ Usage
βοΈ 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
βοΈ 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:
universal_symbol_id: string
notional_value:
π Return
AccountOrderRecord
π Endpoint
/trade/place
POST
π Back to Table of Contents
snaptrade.trading.placeOCOOrder
Place a OCO (One Cancels Other) order
π οΈ Usage
βοΈ 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
βοΈ 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
βοΈ 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 [email protected] if you notice any inconsistencies.
π οΈ Usage
βοΈ 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
All versions of snaptrade-php-sdk with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0