snaptrade 2.1.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v2.1.0-blue)](https://rubygems.org/gems/snaptrade/versions/2.1.0)
9
+ [![npm](https://img.shields.io/badge/gem-v3.0.0-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.0)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -22,12 +22,10 @@ Connect brokerage accounts to your app for live positions and trading
22
22
  * [`snaptrade.account_information.get_account_activities`](#snaptradeaccount_informationget_account_activities)
23
23
  * [`snaptrade.account_information.get_account_balance_history`](#snaptradeaccount_informationget_account_balance_history)
24
24
  * [`snaptrade.account_information.get_all_account_positions`](#snaptradeaccount_informationget_all_account_positions)
25
- * [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
26
25
  * [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
27
26
  * [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
28
27
  * [`snaptrade.account_information.get_user_account_order_detail`](#snaptradeaccount_informationget_user_account_order_detail)
29
28
  * [`snaptrade.account_information.get_user_account_orders`](#snaptradeaccount_informationget_user_account_orders)
30
- * [`snaptrade.account_information.get_user_account_positions`](#snaptradeaccount_informationget_user_account_positions)
31
29
  * [`snaptrade.account_information.get_user_account_recent_orders`](#snaptradeaccount_informationget_user_account_recent_orders)
32
30
  * [`snaptrade.account_information.get_user_account_return_rates`](#snaptradeaccount_informationget_user_account_return_rates)
33
31
  * [`snaptrade.account_information.get_user_holdings`](#snaptradeaccount_informationget_user_holdings)
@@ -45,9 +43,7 @@ Connect brokerage accounts to your app for live positions and trading
45
43
  * [`snaptrade.connections.list_brokerage_authorization_accounts`](#snaptradeconnectionslist_brokerage_authorization_accounts)
46
44
  * [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations)
47
45
  * [`snaptrade.connections.refresh_brokerage_authorization`](#snaptradeconnectionsrefresh_brokerage_authorization)
48
- * [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
49
46
  * [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
50
- * [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
51
47
  * [`snaptrade.connections.sync_brokerage_authorization_transactions`](#snaptradeconnectionssync_brokerage_authorization_transactions)
52
48
  * [`snaptrade.experimental_endpoints.add_subscription`](#snaptradeexperimental_endpointsadd_subscription)
53
49
  * [`snaptrade.experimental_endpoints.cancel_subscription`](#snaptradeexperimental_endpointscancel_subscription)
@@ -56,27 +52,20 @@ Connect brokerage accounts to your app for live positions and trading
56
52
  * [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
57
53
  * [`snaptrade.experimental_endpoints.list_connection_accounts`](#snaptradeexperimental_endpointslist_connection_accounts)
58
54
  * [`snaptrade.experimental_endpoints.list_subscriptions`](#snaptradeexperimental_endpointslist_subscriptions)
59
- * [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
60
- * [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
61
55
  * [`snaptrade.reference_data.get_partner_info`](#snaptradereference_dataget_partner_info)
62
- * [`snaptrade.reference_data.get_security_types`](#snaptradereference_dataget_security_types)
63
56
  * [`snaptrade.reference_data.get_stock_exchanges`](#snaptradereference_dataget_stock_exchanges)
64
57
  * [`snaptrade.reference_data.get_symbols`](#snaptradereference_dataget_symbols)
65
58
  * [`snaptrade.reference_data.get_symbols_by_ticker`](#snaptradereference_dataget_symbols_by_ticker)
66
59
  * [`snaptrade.reference_data.list_all_brokerage_authorization_type`](#snaptradereference_datalist_all_brokerage_authorization_type)
67
60
  * [`snaptrade.reference_data.list_all_brokerage_instruments`](#snaptradereference_datalist_all_brokerage_instruments)
68
61
  * [`snaptrade.reference_data.list_all_brokerages`](#snaptradereference_datalist_all_brokerages)
69
- * [`snaptrade.reference_data.list_all_currencies`](#snaptradereference_datalist_all_currencies)
70
- * [`snaptrade.reference_data.list_all_currencies_rates`](#snaptradereference_datalist_all_currencies_rates)
71
62
  * [`snaptrade.reference_data.symbol_search_user_account`](#snaptradereference_datasymbol_search_user_account)
72
63
  * [`snaptrade.trading.cancel_order`](#snaptradetradingcancel_order)
73
- * [`snaptrade.trading.cancel_user_account_order`](#snaptradetradingcancel_user_account_order)
74
64
  * [`snaptrade.trading.get_cryptocurrency_pair_quote`](#snaptradetradingget_cryptocurrency_pair_quote)
75
65
  * [`snaptrade.trading.get_option_impact`](#snaptradetradingget_option_impact)
76
66
  * [`snaptrade.trading.get_order_impact`](#snaptradetradingget_order_impact)
77
67
  * [`snaptrade.trading.get_user_account_option_quotes`](#snaptradetradingget_user_account_option_quotes)
78
68
  * [`snaptrade.trading.get_user_account_quotes`](#snaptradetradingget_user_account_quotes)
79
- * [`snaptrade.trading.place_bracket_order`](#snaptradetradingplace_bracket_order)
80
69
  * [`snaptrade.trading.place_complex_order`](#snaptradetradingplace_complex_order)
81
70
  * [`snaptrade.trading.place_crypto_order`](#snaptradetradingplace_crypto_order)
82
71
  * [`snaptrade.trading.place_force_order`](#snaptradetradingplace_force_order)
@@ -85,8 +74,6 @@ Connect brokerage accounts to your app for live positions and trading
85
74
  * [`snaptrade.trading.preview_crypto_order`](#snaptradetradingpreview_crypto_order)
86
75
  * [`snaptrade.trading.replace_order`](#snaptradetradingreplace_order)
87
76
  * [`snaptrade.trading.search_cryptocurrency_pair_instruments`](#snaptradetradingsearch_cryptocurrency_pair_instruments)
88
- * [`snaptrade.transactions_and_reporting.get_activities`](#snaptradetransactions_and_reportingget_activities)
89
- * [`snaptrade.transactions_and_reporting.get_reporting_custom_range`](#snaptradetransactions_and_reportingget_reporting_custom_range)
90
77
 
91
78
  <!-- tocstop -->
92
79
 
@@ -95,7 +82,7 @@ Connect brokerage accounts to your app for live positions and trading
95
82
  Add to Gemfile:
96
83
 
97
84
  ```ruby
98
- gem 'snaptrade', '~> 2.1.0'
85
+ gem 'snaptrade', '~> 3.0.0'
99
86
  ```
100
87
 
101
88
  ## Getting Started<a id="getting-started"></a>
@@ -299,49 +286,6 @@ p result
299
286
  ---
300
287
 
301
288
 
302
- ### `snaptrade.account_information.get_all_user_holdings`<a id="snaptradeaccount_informationget_all_user_holdings"></a>
303
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
304
-
305
- **Deprecated.** Use the account-specific holdings endpoint instead.
306
-
307
- This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
308
-
309
- List all accounts for the user, plus balances, positions, and orders for each
310
- account.
311
-
312
-
313
- #### 🛠️ Usage<a id="🛠️-usage"></a>
314
-
315
- ```ruby
316
- result = snaptrade.account_information.get_all_user_holdings(
317
- user_id: "snaptrade-user-123",
318
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
319
- brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
320
- )
321
- p result
322
- ```
323
-
324
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
325
-
326
- ##### user_id: `String`<a id="user_id-string"></a>
327
- ##### user_secret: `String`<a id="user_secret-string"></a>
328
- ##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
329
- Optional. Comma separated list of authorization IDs (only use if filtering is
330
- needed on one or more authorizations).
331
-
332
- #### 🔄 Return<a id="🔄-return"></a>
333
-
334
- [AccountHoldings](./lib/snaptrade/models/account_holdings.rb)
335
-
336
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
337
-
338
- `/holdings` `GET`
339
-
340
- [🔙 **Back to Table of Contents**](#table-of-contents)
341
-
342
- ---
343
-
344
-
345
289
  ### `snaptrade.account_information.get_user_account_balance`<a id="snaptradeaccount_informationget_user_account_balance"></a>
346
290
 
347
291
  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](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).
@@ -516,49 +460,6 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
516
460
  ---
517
461
 
518
462
 
519
- ### `snaptrade.account_information.get_user_account_positions`<a id="snaptradeaccount_informationget_user_account_positions"></a>
520
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
521
-
522
- **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
523
-
524
- Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings).
525
-
526
- Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
527
- - If you do, this endpoint returns real-time data.
528
- - If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
529
-
530
- If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
531
-
532
-
533
- #### 🛠️ Usage<a id="🛠️-usage"></a>
534
-
535
- ```ruby
536
- result = snaptrade.account_information.get_user_account_positions(
537
- user_id: "snaptrade-user-123",
538
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
539
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
540
- )
541
- p result
542
- ```
543
-
544
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
545
-
546
- ##### user_id: `String`<a id="user_id-string"></a>
547
- ##### user_secret: `String`<a id="user_secret-string"></a>
548
- ##### account_id: `String`<a id="account_id-string"></a>
549
- #### 🔄 Return<a id="🔄-return"></a>
550
-
551
- [Position](./lib/snaptrade/models/position.rb)
552
-
553
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
554
-
555
- `/accounts/{accountId}/positions` `GET`
556
-
557
- [🔙 **Back to Table of Contents**](#table-of-contents)
558
-
559
- ---
560
-
561
-
562
463
  ### `snaptrade.account_information.get_user_account_recent_orders`<a id="snaptradeaccount_informationget_user_account_recent_orders"></a>
563
464
 
564
465
  A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
@@ -1204,34 +1105,6 @@ p result
1204
1105
  ---
1205
1106
 
1206
1107
 
1207
- ### `snaptrade.connections.remove_brokerage_authorization`<a id="snaptradeconnectionsremove_brokerage_authorization"></a>
1208
-
1209
- Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the data has been successfully deleted.
1210
-
1211
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1212
-
1213
- ```ruby
1214
- snaptrade.connections.remove_brokerage_authorization(
1215
- authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
1216
- user_id: "snaptrade-user-123",
1217
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1218
- )
1219
- ```
1220
-
1221
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1222
-
1223
- ##### authorization_id: `String`<a id="authorization_id-string"></a>
1224
- ##### user_id: `String`<a id="user_id-string"></a>
1225
- ##### user_secret: `String`<a id="user_secret-string"></a>
1226
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1227
-
1228
- `/authorizations/{authorizationId}` `DELETE`
1229
-
1230
- [🔙 **Back to Table of Contents**](#table-of-contents)
1231
-
1232
- ---
1233
-
1234
-
1235
1108
  ### `snaptrade.connections.return_rates`<a id="snaptradeconnectionsreturn_rates"></a>
1236
1109
 
1237
1110
  Returns a list of rate of return percents for a given connection.
@@ -1272,45 +1145,6 @@ returns all six supported timeframes.
1272
1145
  ---
1273
1146
 
1274
1147
 
1275
- ### `snaptrade.connections.session_events`<a id="snaptradeconnectionssession_events"></a>
1276
-
1277
- Returns a list of session events associated with a user.
1278
-
1279
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1280
-
1281
- ```ruby
1282
- result = snaptrade.connections.session_events(
1283
- partner_client_id: "SNAPTRADETEST",
1284
- user_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
1285
- session_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
1286
- )
1287
- p result
1288
- ```
1289
-
1290
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1291
-
1292
- ##### partner_client_id: `String`<a id="partner_client_id-string"></a>
1293
- ##### user_id: `String`<a id="user_id-string"></a>
1294
- Optional comma separated list of user IDs used to filter the request on specific
1295
- users
1296
-
1297
- ##### session_id: `String`<a id="session_id-string"></a>
1298
- Optional comma separated list of session IDs used to filter the request on
1299
- specific users
1300
-
1301
- #### 🔄 Return<a id="🔄-return"></a>
1302
-
1303
- [ConnectionsSessionEvents200ResponseInner](./lib/snaptrade/models/connections_session_events200_response_inner.rb)
1304
-
1305
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1306
-
1307
- `/sessionEvents` `GET`
1308
-
1309
- [🔙 **Back to Table of Contents**](#table-of-contents)
1310
-
1311
- ---
1312
-
1313
-
1314
1148
  ### `snaptrade.connections.sync_brokerage_authorization_transactions`<a id="snaptradeconnectionssync_brokerage_authorization_transactions"></a>
1315
1149
 
1316
1150
  Trigger a transactions sync for all accounts under this connection. Updates will be queued asynchronously. Transactions are not updated intra-day, but calling this endpoint can ensure that the previous day's transactions have been synced. For more information on sync behaviour, see: https://docs.snaptrade.com/docs/syncing
@@ -1623,78 +1457,6 @@ p result
1623
1457
  ---
1624
1458
 
1625
1459
 
1626
- ### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
1627
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
1628
-
1629
- **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
1630
-
1631
- Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
1632
-
1633
- Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
1634
- - If you do, this endpoint returns real-time data.
1635
- - If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
1636
-
1637
-
1638
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1639
-
1640
- ```ruby
1641
- result = snaptrade.options.list_option_holdings(
1642
- user_id: "snaptrade-user-123",
1643
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1644
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1645
- )
1646
- p result
1647
- ```
1648
-
1649
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1650
-
1651
- ##### user_id: `String`<a id="user_id-string"></a>
1652
- ##### user_secret: `String`<a id="user_secret-string"></a>
1653
- ##### account_id: `String`<a id="account_id-string"></a>
1654
- #### 🔄 Return<a id="🔄-return"></a>
1655
-
1656
- [OptionsPosition](./lib/snaptrade/models/options_position.rb)
1657
-
1658
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1659
-
1660
- `/accounts/{accountId}/options` `GET`
1661
-
1662
- [🔙 **Back to Table of Contents**](#table-of-contents)
1663
-
1664
- ---
1665
-
1666
-
1667
- ### `snaptrade.reference_data.get_currency_exchange_rate_pair`<a id="snaptradereference_dataget_currency_exchange_rate_pair"></a>
1668
-
1669
- Returns an Exchange Rate Pair object for the specified Currency Pair.
1670
-
1671
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1672
-
1673
- ```ruby
1674
- result = snaptrade.reference_data.get_currency_exchange_rate_pair(
1675
- currency_pair: "currencyPair_example",
1676
- )
1677
- p result
1678
- ```
1679
-
1680
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1681
-
1682
- ##### currency_pair: `String`<a id="currency_pair-string"></a>
1683
- A currency pair based on currency code for example, {CAD-USD}
1684
-
1685
- #### 🔄 Return<a id="🔄-return"></a>
1686
-
1687
- [ExchangeRatePairs](./lib/snaptrade/models/exchange_rate_pairs.rb)
1688
-
1689
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1690
-
1691
- `/currencies/rates/{currencyPair}` `GET`
1692
-
1693
- [🔙 **Back to Table of Contents**](#table-of-contents)
1694
-
1695
- ---
1696
-
1697
-
1698
1460
  ### `snaptrade.reference_data.get_partner_info`<a id="snaptradereference_dataget_partner_info"></a>
1699
1461
 
1700
1462
  Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
@@ -1719,30 +1481,6 @@ p result
1719
1481
  ---
1720
1482
 
1721
1483
 
1722
- ### `snaptrade.reference_data.get_security_types`<a id="snaptradereference_dataget_security_types"></a>
1723
-
1724
- Return all available security types supported by SnapTrade.
1725
-
1726
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1727
-
1728
- ```ruby
1729
- result = snaptrade.reference_data.get_security_types
1730
- p result
1731
- ```
1732
-
1733
- #### 🔄 Return<a id="🔄-return"></a>
1734
-
1735
- [SecurityType](./lib/snaptrade/models/security_type.rb)
1736
-
1737
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1738
-
1739
- `/securityTypes` `GET`
1740
-
1741
- [🔙 **Back to Table of Contents**](#table-of-contents)
1742
-
1743
- ---
1744
-
1745
-
1746
1484
  ### `snaptrade.reference_data.get_stock_exchanges`<a id="snaptradereference_dataget_stock_exchanges"></a>
1747
1485
 
1748
1486
  Returns a list of all supported Exchanges.
@@ -1918,54 +1656,6 @@ p result
1918
1656
  ---
1919
1657
 
1920
1658
 
1921
- ### `snaptrade.reference_data.list_all_currencies`<a id="snaptradereference_datalist_all_currencies"></a>
1922
-
1923
- Returns a list of all defined Currency objects.
1924
-
1925
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1926
-
1927
- ```ruby
1928
- result = snaptrade.reference_data.list_all_currencies
1929
- p result
1930
- ```
1931
-
1932
- #### 🔄 Return<a id="🔄-return"></a>
1933
-
1934
- [Currency](./lib/snaptrade/models/currency.rb)
1935
-
1936
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1937
-
1938
- `/currencies` `GET`
1939
-
1940
- [🔙 **Back to Table of Contents**](#table-of-contents)
1941
-
1942
- ---
1943
-
1944
-
1945
- ### `snaptrade.reference_data.list_all_currencies_rates`<a id="snaptradereference_datalist_all_currencies_rates"></a>
1946
-
1947
- Returns a list of all Exchange Rate Pairs for all supported Currencies.
1948
-
1949
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1950
-
1951
- ```ruby
1952
- result = snaptrade.reference_data.list_all_currencies_rates
1953
- p result
1954
- ```
1955
-
1956
- #### 🔄 Return<a id="🔄-return"></a>
1957
-
1958
- [ExchangeRatePairs](./lib/snaptrade/models/exchange_rate_pairs.rb)
1959
-
1960
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1961
-
1962
- `/currencies/rates` `GET`
1963
-
1964
- [🔙 **Back to Table of Contents**](#table-of-contents)
1965
-
1966
- ---
1967
-
1968
-
1969
1659
  ### `snaptrade.reference_data.symbol_search_user_account`<a id="snaptradereference_datasymbol_search_user_account"></a>
1970
1660
 
1971
1661
  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.
@@ -2045,48 +1735,6 @@ the brokerage system.
2045
1735
  ---
2046
1736
 
2047
1737
 
2048
- ### `snaptrade.trading.cancel_user_account_order`<a id="snaptradetradingcancel_user_account_order"></a>
2049
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
2050
-
2051
- **Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead.
2052
-
2053
- Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
2054
-
2055
-
2056
- #### 🛠️ Usage<a id="🛠️-usage"></a>
2057
-
2058
- ```ruby
2059
- result = snaptrade.trading.cancel_user_account_order(
2060
- brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
2061
- user_id: "snaptrade-user-123",
2062
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2063
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
2064
- )
2065
- p result
2066
- ```
2067
-
2068
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2069
-
2070
- ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
2071
- Order ID returned by brokerage. This is the unique identifier for the order in
2072
- the brokerage system.
2073
-
2074
- ##### user_id: `String`<a id="user_id-string"></a>
2075
- ##### user_secret: `String`<a id="user_secret-string"></a>
2076
- ##### account_id: `String`<a id="account_id-string"></a>
2077
- #### 🔄 Return<a id="🔄-return"></a>
2078
-
2079
- [AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
2080
-
2081
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2082
-
2083
- `/accounts/{accountId}/orders/cancel` `POST`
2084
-
2085
- [🔙 **Back to Table of Contents**](#table-of-contents)
2086
-
2087
- ---
2088
-
2089
-
2090
1738
  ### `snaptrade.trading.get_cryptocurrency_pair_quote`<a id="snaptradetradingget_cryptocurrency_pair_quote"></a>
2091
1739
 
2092
1740
  Gets a quote for the specified account.
@@ -2359,96 +2007,6 @@ Should be set to `True` if `symbols` are comprised of tickers. Defaults to
2359
2007
  ---
2360
2008
 
2361
2009
 
2362
- ### `snaptrade.trading.place_bracket_order`<a id="snaptradetradingplace_bracket_order"></a>
2363
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
2364
-
2365
- **Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead.
2366
-
2367
- Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for
2368
- use. Only supported on certain brokerages
2369
-
2370
-
2371
- #### 🛠️ Usage<a id="🛠️-usage"></a>
2372
-
2373
- ```ruby
2374
- result = snaptrade.trading.place_bracket_order(
2375
- action: "BUY",
2376
- instrument: {
2377
- "symbol" => "AAPL",
2378
- "type" => "EQUITY",
2379
- },
2380
- order_type: "Market",
2381
- time_in_force: "Day",
2382
- stop_loss: {
2383
- "stop_price" => "48.55",
2384
- "limit_price" => "48.50",
2385
- },
2386
- take_profit: {
2387
- "limit_price" => "49.95",
2388
- },
2389
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
2390
- user_id: "snaptrade-user-123",
2391
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2392
- price: 31.33,
2393
- stop: 31.33,
2394
- units: 10.5,
2395
- )
2396
- p result
2397
- ```
2398
-
2399
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2400
-
2401
- ##### action: [`ActionStrictWithOptions`](./lib/snaptrade/models/action_strict_with_options.rb)<a id="action-actionstrictwithoptionslibsnaptrademodelsaction_strict_with_optionsrb"></a>
2402
- The action describes the intent or side of a trade. This is either `BUY` or
2403
- `SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or
2404
- `SELL_TO_CLOSE` for Options.
2405
-
2406
- ##### instrument: [`TradingInstrument`](./lib/snaptrade/models/trading_instrument.rb)<a id="instrument-tradinginstrumentlibsnaptrademodelstrading_instrumentrb"></a>
2407
- ##### order_type: [`OrderTypeStrict`](./lib/snaptrade/models/order_type_strict.rb)<a id="order_type-ordertypestrictlibsnaptrademodelsorder_type_strictrb"></a>
2408
- The type of order to place. - For `Limit` and `StopLimit` orders, the `price`
2409
- field is required. - For `Stop` and `StopLimit` orders, the `stop` field is
2410
- required.
2411
-
2412
- ##### time_in_force: [`TimeInForceStrict`](./lib/snaptrade/models/time_in_force_strict.rb)<a id="time_in_force-timeinforcestrictlibsnaptrademodelstime_in_force_strictrb"></a>
2413
- The Time in Force type for the order. This field indicates how long the order
2414
- will remain active before it is executed or expires. Here are the supported
2415
- values: - `Day` - Day. The order is valid only for the trading day on which it
2416
- is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed
2417
- or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety
2418
- immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order
2419
- must be executed immediately. Any portion of the order that cannot be filled
2420
- immediately will be canceled.
2421
-
2422
- ##### stop_loss: [`StopLoss`](./lib/snaptrade/models/stop_loss.rb)<a id="stop_loss-stoplosslibsnaptrademodelsstop_lossrb"></a>
2423
- ##### take_profit: [`TakeProfit`](./lib/snaptrade/models/take_profit.rb)<a id="take_profit-takeprofitlibsnaptrademodelstake_profitrb"></a>
2424
- ##### account_id: `String`<a id="account_id-string"></a>
2425
- The ID of the account to execute the trade on.
2426
-
2427
- ##### user_id: `String`<a id="user_id-string"></a>
2428
- ##### user_secret: `String`<a id="user_secret-string"></a>
2429
- ##### price: `Float`<a id="price-float"></a>
2430
- The limit price for `Limit` and `StopLimit` orders.
2431
-
2432
- ##### stop: `Float`<a id="stop-float"></a>
2433
- The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
2434
-
2435
- ##### units: `Float`<a id="units-float"></a>
2436
- Number of shares for the order. This can be a decimal for fractional orders.
2437
- Must be `null` if `notional_value` is provided.
2438
-
2439
- #### 🔄 Return<a id="🔄-return"></a>
2440
-
2441
- [AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
2442
-
2443
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2444
-
2445
- `/accounts/{accountId}/trading/bracket` `POST`
2446
-
2447
- [🔙 **Back to Table of Contents**](#table-of-contents)
2448
-
2449
- ---
2450
-
2451
-
2452
2010
  ### `snaptrade.trading.place_complex_order`<a id="snaptradetradingplace_complex_order"></a>
2453
2011
 
2454
2012
  Places a complex conditional order (OCO, OTO, or OTOCO).
@@ -3028,137 +2586,5 @@ p result
3028
2586
  ---
3029
2587
 
3030
2588
 
3031
- ### `snaptrade.transactions_and_reporting.get_activities`<a id="snaptradetransactions_and_reportingget_activities"></a>
3032
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
3033
-
3034
- **Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible.
3035
-
3036
- This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
3037
-
3038
- 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.
3039
-
3040
- 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.
3041
-
3042
- This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
3043
-
3044
-
3045
- #### 🛠️ Usage<a id="🛠️-usage"></a>
3046
-
3047
- ```ruby
3048
- result = snaptrade.transactions_and_reporting.get_activities(
3049
- user_id: "snaptrade-user-123",
3050
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
3051
- start_date: "2022-01-24",
3052
- end_date: "2022-01-24",
3053
- accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
3054
- brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
3055
- type: "BUY,SELL,DIVIDEND",
3056
- )
3057
- p result
3058
- ```
3059
-
3060
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
3061
-
3062
- ##### user_id: `String`<a id="user_id-string"></a>
3063
- ##### user_secret: `String`<a id="user_secret-string"></a>
3064
- ##### start_date: `Date`<a id="start_date-date"></a>
3065
- The start date (inclusive) of the transaction history to retrieve. If not
3066
- provided, the default is the first transaction known to SnapTrade based on
3067
- `trade_date`.
3068
-
3069
- ##### end_date: `Date`<a id="end_date-date"></a>
3070
- The end date (inclusive) of the transaction history to retrieve. If not
3071
- provided, the default is the last transaction known to SnapTrade based on
3072
- `trade_date`.
3073
-
3074
- ##### accounts: `String`<a id="accounts-string"></a>
3075
- Optional comma separated list of SnapTrade Account IDs used to filter the
3076
- request to specific accounts. If not provided, the default is all known
3077
- brokerage accounts for the user. The `brokerageAuthorizations` parameter takes
3078
- precedence over this parameter.
3079
-
3080
- ##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
3081
- Optional comma separated list of SnapTrade Connection (Brokerage Authorization)
3082
- IDs used to filter the request to only accounts that belong to those
3083
- connections. If not provided, the default is all connections for the user. This
3084
- parameter takes precedence over the `accounts` parameter.
3085
-
3086
- ##### type: `String`<a id="type-string"></a>
3087
- Optional comma separated list of transaction types to filter by. SnapTrade does
3088
- a best effort to categorize brokerage transaction types into a common set of
3089
- values. Here are some of the most popular values: - `BUY` - Asset bought. -
3090
- `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` -
3091
- Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. -
3092
- `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` -
3093
- Interest deposited into the account. - `FEE` - Fee withdrawn from the account. -
3094
- `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option
3095
- assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` -
3096
- Transfer of assets from one account to another
3097
-
3098
- #### 🔄 Return<a id="🔄-return"></a>
3099
-
3100
- [UniversalActivity](./lib/snaptrade/models/universal_activity.rb)
3101
-
3102
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
3103
-
3104
- `/activities` `GET`
3105
-
3106
- [🔙 **Back to Table of Contents**](#table-of-contents)
3107
-
3108
- ---
3109
-
3110
-
3111
- ### `snaptrade.transactions_and_reporting.get_reporting_custom_range`<a id="snaptradetransactions_and_reportingget_reporting_custom_range"></a>
3112
- ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
3113
-
3114
- **Deprecated.** 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.
3115
-
3116
-
3117
- #### 🛠️ Usage<a id="🛠️-usage"></a>
3118
-
3119
- ```ruby
3120
- result = snaptrade.transactions_and_reporting.get_reporting_custom_range(
3121
- start_date: "2022-01-24",
3122
- end_date: "2022-01-24",
3123
- user_id: "snaptrade-user-123",
3124
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
3125
- accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
3126
- detailed: true,
3127
- frequency: "monthly",
3128
- )
3129
- p result
3130
- ```
3131
-
3132
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
3133
-
3134
- ##### start_date: `Date`<a id="start_date-date"></a>
3135
- ##### end_date: `Date`<a id="end_date-date"></a>
3136
- ##### user_id: `String`<a id="user_id-string"></a>
3137
- ##### user_secret: `String`<a id="user_secret-string"></a>
3138
- ##### accounts: `String`<a id="accounts-string"></a>
3139
- Optional comma separated list of account IDs used to filter the request on
3140
- specific accounts
3141
-
3142
- ##### detailed: `Boolean`<a id="detailed-boolean"></a>
3143
- Optional, increases frequency of data points for the total value and
3144
- contribution charts if set to true
3145
-
3146
- ##### frequency: `String`<a id="frequency-string"></a>
3147
- Optional frequency for the rate of return chart (defaults to monthly). Possible
3148
- values are daily, weekly, monthly, quarterly, yearly.
3149
-
3150
- #### 🔄 Return<a id="🔄-return"></a>
3151
-
3152
- [PerformanceCustom](./lib/snaptrade/models/performance_custom.rb)
3153
-
3154
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
3155
-
3156
- `/performance/custom` `GET`
3157
-
3158
- [🔙 **Back to Table of Contents**](#table-of-contents)
3159
-
3160
- ---
3161
-
3162
-
3163
2589
  ## Author<a id="author"></a>
3164
2590
  This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)