snaptrade 2.0.197 → 2.0.199
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +277 -5
- data/lib/snaptrade/api/account_information_api.rb +8 -8
- data/lib/snaptrade/api/connections_api.rb +103 -0
- data/lib/snaptrade/api/experimental_endpoints_api.rb +697 -0
- data/lib/snaptrade/api/options_api.rb +4 -4
- data/lib/snaptrade/models/account_value_history_item.rb +1 -1
- data/lib/snaptrade/models/exchange.rb +1 -1
- data/lib/snaptrade/models/performance_custom.rb +1 -1
- data/lib/snaptrade/models/symbol_exchange.rb +1 -1
- data/lib/snaptrade/models/trade_detection_add_subscription_request.rb +222 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -0
- data/spec/api/account_information_api_spec.rb +2 -2
- data/spec/api/connections_api_spec.rb +14 -0
- data/spec/api/experimental_endpoints_api_spec.rb +113 -0
- data/spec/api/options_api_spec.rb +1 -1
- data/spec/models/trade_detection_add_subscription_request_spec.rb +29 -0
- metadata +194 -188
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bebc8893a14a34d7609059d0182f83f35811e91923fee8f9382d92974f771602
|
|
4
|
+
data.tar.gz: 9b5b600f95ffc948e97c9b4f1181f68f7f315dc6f6c8c312e5e41a5462c03a63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a59a710797277fc96c947437bf1840201ba4c2f3f86ee1184045e99079cb96772981a6a4548c2065f162403dd7a9ce634480e9a5432469f2e4797916a59a9e1e
|
|
7
|
+
data.tar.gz: f69ab1839993bf22c1efea6c112601126364de2a7267ea88f303e64d70523f643a1e44ae01fc66ed45cb346ab23f39ad803f2b9ee97ae7587c711d277721691e
|
data/Gemfile.lock
CHANGED
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.199)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -48,6 +48,13 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
48
48
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
49
49
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
50
50
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
51
|
+
* [`snaptrade.connections.sync_brokerage_authorization_transactions`](#snaptradeconnectionssync_brokerage_authorization_transactions)
|
|
52
|
+
* [`snaptrade.experimental_endpoints.add_subscription`](#snaptradeexperimental_endpointsadd_subscription)
|
|
53
|
+
* [`snaptrade.experimental_endpoints.cancel_subscription`](#snaptradeexperimental_endpointscancel_subscription)
|
|
54
|
+
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
55
|
+
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
56
|
+
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
57
|
+
* [`snaptrade.experimental_endpoints.list_subscriptions`](#snaptradeexperimental_endpointslist_subscriptions)
|
|
51
58
|
* [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
|
|
52
59
|
* [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
|
|
53
60
|
* [`snaptrade.reference_data.get_partner_info`](#snaptradereference_dataget_partner_info)
|
|
@@ -87,7 +94,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
87
94
|
Add to Gemfile:
|
|
88
95
|
|
|
89
96
|
```ruby
|
|
90
|
-
gem 'snaptrade', '~> 2.0.
|
|
97
|
+
gem 'snaptrade', '~> 2.0.199'
|
|
91
98
|
```
|
|
92
99
|
|
|
93
100
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -486,7 +493,7 @@ p result
|
|
|
486
493
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
487
494
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
488
495
|
##### state: `String`<a id="state-string"></a>
|
|
489
|
-
defaults
|
|
496
|
+
defaults to \"all\"
|
|
490
497
|
|
|
491
498
|
##### days: `Integer`<a id="days-integer"></a>
|
|
492
499
|
Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
@@ -506,10 +513,11 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
|
506
513
|
|
|
507
514
|
|
|
508
515
|
### `snaptrade.account_information.get_user_account_positions`<a id="snaptradeaccount_informationget_user_account_positions"></a>
|
|
516
|
+

|
|
509
517
|
|
|
510
518
|
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).
|
|
511
519
|
|
|
512
|
-
Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
520
|
+
This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
513
521
|
|
|
514
522
|
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:
|
|
515
523
|
- If you do, this endpoint returns real-time data.
|
|
@@ -1299,11 +1307,275 @@ specific users
|
|
|
1299
1307
|
---
|
|
1300
1308
|
|
|
1301
1309
|
|
|
1310
|
+
### `snaptrade.connections.sync_brokerage_authorization_transactions`<a id="snaptradeconnectionssync_brokerage_authorization_transactions"></a>
|
|
1311
|
+
|
|
1312
|
+
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
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1316
|
+
|
|
1317
|
+
```ruby
|
|
1318
|
+
result = snaptrade.connections.sync_brokerage_authorization_transactions(
|
|
1319
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1320
|
+
user_id: "snaptrade-user-123",
|
|
1321
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1322
|
+
)
|
|
1323
|
+
p result
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1327
|
+
|
|
1328
|
+
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
|
1329
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1330
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1331
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1332
|
+
|
|
1333
|
+
[BrokerageAuthorizationTransactionsSyncConfirmation](./lib/snaptrade/models/brokerage_authorization_transactions_sync_confirmation.rb)
|
|
1334
|
+
|
|
1335
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1336
|
+
|
|
1337
|
+
`/authorizations/{authorizationId}/transactions/sync` `POST`
|
|
1338
|
+
|
|
1339
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1340
|
+
|
|
1341
|
+
---
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
### `snaptrade.experimental_endpoints.add_subscription`<a id="snaptradeexperimental_endpointsadd_subscription"></a>
|
|
1345
|
+
|
|
1346
|
+
Adds or restores a Trade Detection subscription for a connected brokerage account.
|
|
1347
|
+
This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1351
|
+
|
|
1352
|
+
```ruby
|
|
1353
|
+
result = snaptrade.experimental_endpoints.add_subscription(
|
|
1354
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1355
|
+
user_id: "snaptrade-user-123",
|
|
1356
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1357
|
+
)
|
|
1358
|
+
p result
|
|
1359
|
+
```
|
|
1360
|
+
|
|
1361
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1362
|
+
|
|
1363
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1364
|
+
Unique identifier for the connected brokerage account. This is the UUID used to
|
|
1365
|
+
reference the account in SnapTrade.
|
|
1366
|
+
|
|
1367
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1368
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1369
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1370
|
+
|
|
1371
|
+
[TradeDetectionSubscription](./lib/snaptrade/models/trade_detection_subscription.rb)
|
|
1372
|
+
|
|
1373
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1374
|
+
|
|
1375
|
+
`/snapTrade/tradeDetection/subscriptions` `POST`
|
|
1376
|
+
|
|
1377
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1378
|
+
|
|
1379
|
+
---
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
### `snaptrade.experimental_endpoints.cancel_subscription`<a id="snaptradeexperimental_endpointscancel_subscription"></a>
|
|
1383
|
+
|
|
1384
|
+
Cancels a Trade Detection subscription for a connected brokerage account.
|
|
1385
|
+
This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1389
|
+
|
|
1390
|
+
```ruby
|
|
1391
|
+
result = snaptrade.experimental_endpoints.cancel_subscription(
|
|
1392
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1393
|
+
)
|
|
1394
|
+
p result
|
|
1395
|
+
```
|
|
1396
|
+
|
|
1397
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1398
|
+
|
|
1399
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1400
|
+
Unique identifier for the connected brokerage account. This is the UUID used to
|
|
1401
|
+
reference the account in SnapTrade.
|
|
1402
|
+
|
|
1403
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1404
|
+
|
|
1405
|
+
[TradeDetectionCancelSubscriptionResponse](./lib/snaptrade/models/trade_detection_cancel_subscription_response.rb)
|
|
1406
|
+
|
|
1407
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1408
|
+
|
|
1409
|
+
`/snapTrade/tradeDetection/subscriptions/cancel` `POST`
|
|
1410
|
+
|
|
1411
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1412
|
+
|
|
1413
|
+
---
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1417
|
+
|
|
1418
|
+
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
1419
|
+
|
|
1420
|
+
The V2 order response format includes all legs of the order in the `legs` list field.
|
|
1421
|
+
If the order is single legged, `legs` will be a list of one leg.
|
|
1422
|
+
|
|
1423
|
+
This endpoint is always realtime and does not rely on cached data.
|
|
1424
|
+
|
|
1425
|
+
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1429
|
+
|
|
1430
|
+
```ruby
|
|
1431
|
+
result = snaptrade.experimental_endpoints.get_user_account_order_detail_v2(
|
|
1432
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1433
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1434
|
+
user_id: "snaptrade-user-123",
|
|
1435
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1436
|
+
)
|
|
1437
|
+
p result
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1441
|
+
|
|
1442
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1443
|
+
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
|
1444
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1445
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1446
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1447
|
+
|
|
1448
|
+
[AccountOrderRecordV2](./lib/snaptrade/models/account_order_record_v2.rb)
|
|
1449
|
+
|
|
1450
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1451
|
+
|
|
1452
|
+
`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}` `GET`
|
|
1453
|
+
|
|
1454
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1455
|
+
|
|
1456
|
+
---
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
### `snaptrade.experimental_endpoints.get_user_account_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_orders_v2"></a>
|
|
1460
|
+
|
|
1461
|
+
Returns a list of recent orders in the specified account.
|
|
1462
|
+
|
|
1463
|
+
The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg.
|
|
1464
|
+
|
|
1465
|
+
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.
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1469
|
+
|
|
1470
|
+
```ruby
|
|
1471
|
+
result = snaptrade.experimental_endpoints.get_user_account_orders_v2(
|
|
1472
|
+
user_id: "snaptrade-user-123",
|
|
1473
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1474
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1475
|
+
state: "all",
|
|
1476
|
+
days: 30,
|
|
1477
|
+
)
|
|
1478
|
+
p result
|
|
1479
|
+
```
|
|
1480
|
+
|
|
1481
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1482
|
+
|
|
1483
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1484
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1485
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1486
|
+
##### state: `String`<a id="state-string"></a>
|
|
1487
|
+
defaults to \"all\"
|
|
1488
|
+
|
|
1489
|
+
##### days: `Integer`<a id="days-integer"></a>
|
|
1490
|
+
Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
1491
|
+
30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
1492
|
+
|
|
1493
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1494
|
+
|
|
1495
|
+
[AccountOrdersV2Response](./lib/snaptrade/models/account_orders_v2_response.rb)
|
|
1496
|
+
|
|
1497
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1498
|
+
|
|
1499
|
+
`/accounts/{accountId}/orders/v2` `GET`
|
|
1500
|
+
|
|
1501
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1502
|
+
|
|
1503
|
+
---
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
### `snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_recent_orders_v2"></a>
|
|
1507
|
+
|
|
1508
|
+
A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format.
|
|
1509
|
+
This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders.
|
|
1510
|
+
Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days.
|
|
1511
|
+
By default only returns executed orders, but that can be changed by setting *only_executed* to false.
|
|
1512
|
+
**Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1516
|
+
|
|
1517
|
+
```ruby
|
|
1518
|
+
result = snaptrade.experimental_endpoints.get_user_account_recent_orders_v2(
|
|
1519
|
+
user_id: "snaptrade-user-123",
|
|
1520
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1521
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1522
|
+
only_executed: true,
|
|
1523
|
+
)
|
|
1524
|
+
p result
|
|
1525
|
+
```
|
|
1526
|
+
|
|
1527
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1528
|
+
|
|
1529
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1530
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1531
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1532
|
+
##### only_executed: `Boolean`<a id="only_executed-boolean"></a>
|
|
1533
|
+
Defaults to true. Indicates if request should fetch only executed orders. Set to
|
|
1534
|
+
false to retrieve non executed orders as well
|
|
1535
|
+
|
|
1536
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1537
|
+
|
|
1538
|
+
[AccountOrdersV2Response](./lib/snaptrade/models/account_orders_v2_response.rb)
|
|
1539
|
+
|
|
1540
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1541
|
+
|
|
1542
|
+
`/accounts/{accountId}/recentOrders/v2` `GET`
|
|
1543
|
+
|
|
1544
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1545
|
+
|
|
1546
|
+
---
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
### `snaptrade.experimental_endpoints.list_subscriptions`<a id="snaptradeexperimental_endpointslist_subscriptions"></a>
|
|
1550
|
+
|
|
1551
|
+
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
1552
|
+
|
|
1553
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1554
|
+
|
|
1555
|
+
```ruby
|
|
1556
|
+
result = snaptrade.experimental_endpoints.list_subscriptions
|
|
1557
|
+
p result
|
|
1558
|
+
```
|
|
1559
|
+
|
|
1560
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1561
|
+
|
|
1562
|
+
[TradeDetectionSubscription](./lib/snaptrade/models/trade_detection_subscription.rb)
|
|
1563
|
+
|
|
1564
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1565
|
+
|
|
1566
|
+
`/snapTrade/tradeDetection/subscriptions` `GET`
|
|
1567
|
+
|
|
1568
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1569
|
+
|
|
1570
|
+
---
|
|
1571
|
+
|
|
1572
|
+
|
|
1302
1573
|
### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
|
|
1574
|
+

|
|
1303
1575
|
|
|
1304
1576
|
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).
|
|
1305
1577
|
|
|
1306
|
-
Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1578
|
+
This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1307
1579
|
|
|
1308
1580
|
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:
|
|
1309
1581
|
- If you do, this endpoint returns real-time data.
|
|
@@ -888,7 +888,7 @@ module SnapTrade
|
|
|
888
888
|
# @param user_id [String]
|
|
889
889
|
# @param user_secret [String]
|
|
890
890
|
# @param account_id [String]
|
|
891
|
-
# @param state [String] defaults
|
|
891
|
+
# @param state [String] defaults to \"all\"
|
|
892
892
|
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
893
893
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
894
894
|
def get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
|
@@ -911,7 +911,7 @@ module SnapTrade
|
|
|
911
911
|
# @param user_id [String]
|
|
912
912
|
# @param user_secret [String]
|
|
913
913
|
# @param account_id [String]
|
|
914
|
-
# @param state [String] defaults
|
|
914
|
+
# @param state [String] defaults to \"all\"
|
|
915
915
|
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
916
916
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
917
917
|
def get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
|
|
@@ -926,7 +926,7 @@ module SnapTrade
|
|
|
926
926
|
# @param user_secret [String]
|
|
927
927
|
# @param account_id [String]
|
|
928
928
|
# @param [Hash] opts the optional parameters
|
|
929
|
-
# @option opts [String] :state defaults
|
|
929
|
+
# @option opts [String] :state defaults to \"all\"
|
|
930
930
|
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
931
931
|
# @return [Array<AccountOrderRecord>]
|
|
932
932
|
private def get_user_account_orders_impl(user_id, user_secret, account_id, opts = {})
|
|
@@ -940,7 +940,7 @@ module SnapTrade
|
|
|
940
940
|
# @param user_secret [String]
|
|
941
941
|
# @param account_id [String]
|
|
942
942
|
# @param [Hash] opts the optional parameters
|
|
943
|
-
# @option opts [String] :state defaults
|
|
943
|
+
# @option opts [String] :state defaults to \"all\"
|
|
944
944
|
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
945
945
|
# @return [Array<(Array<AccountOrderRecord>, Integer, Hash)>] Array<AccountOrderRecord> data, response status code and response headers
|
|
946
946
|
private def get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
@@ -1020,7 +1020,7 @@ module SnapTrade
|
|
|
1020
1020
|
#
|
|
1021
1021
|
# 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).
|
|
1022
1022
|
#
|
|
1023
|
-
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1023
|
+
# This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1024
1024
|
#
|
|
1025
1025
|
# 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:
|
|
1026
1026
|
# - If you do, this endpoint returns real-time data.
|
|
@@ -1041,7 +1041,7 @@ module SnapTrade
|
|
|
1041
1041
|
#
|
|
1042
1042
|
# 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).
|
|
1043
1043
|
#
|
|
1044
|
-
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1044
|
+
# This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1045
1045
|
#
|
|
1046
1046
|
# 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:
|
|
1047
1047
|
# - If you do, this endpoint returns real-time data.
|
|
@@ -1058,7 +1058,7 @@ module SnapTrade
|
|
|
1058
1058
|
end
|
|
1059
1059
|
|
|
1060
1060
|
# List account positions
|
|
1061
|
-
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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: - If you do, this endpoint returns real-time data. - 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. 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.
|
|
1061
|
+
# 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). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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: - If you do, this endpoint returns real-time data. - 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. 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.
|
|
1062
1062
|
# @param user_id [String]
|
|
1063
1063
|
# @param user_secret [String]
|
|
1064
1064
|
# @param account_id [String]
|
|
@@ -1070,7 +1070,7 @@ module SnapTrade
|
|
|
1070
1070
|
end
|
|
1071
1071
|
|
|
1072
1072
|
# List account positions
|
|
1073
|
-
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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: - If you do, this endpoint returns real-time data. - 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. 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.
|
|
1073
|
+
# 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). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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: - If you do, this endpoint returns real-time data. - 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. 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.
|
|
1074
1074
|
# @param user_id [String]
|
|
1075
1075
|
# @param user_secret [String]
|
|
1076
1076
|
# @param account_id [String]
|
|
@@ -970,6 +970,109 @@ module SnapTrade
|
|
|
970
970
|
end
|
|
971
971
|
return data, status_code, headers, response
|
|
972
972
|
end
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
# Sync transactions for a connection
|
|
976
|
+
#
|
|
977
|
+
# 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
|
|
978
|
+
#
|
|
979
|
+
# @param authorization_id [String]
|
|
980
|
+
# @param user_id [String]
|
|
981
|
+
# @param user_secret [String]
|
|
982
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
983
|
+
def sync_brokerage_authorization_transactions(authorization_id:, user_id:, user_secret:, extra: {})
|
|
984
|
+
data, _status_code, _headers = sync_brokerage_authorization_transactions_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
|
985
|
+
data
|
|
986
|
+
end
|
|
987
|
+
|
|
988
|
+
# Sync transactions for a connection
|
|
989
|
+
#
|
|
990
|
+
# 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
|
|
991
|
+
#
|
|
992
|
+
# @param authorization_id [String]
|
|
993
|
+
# @param user_id [String]
|
|
994
|
+
# @param user_secret [String]
|
|
995
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
996
|
+
def sync_brokerage_authorization_transactions_with_http_info(authorization_id:, user_id:, user_secret:, extra: {})
|
|
997
|
+
sync_brokerage_authorization_transactions_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
# Sync transactions for a connection
|
|
1001
|
+
# 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
|
|
1002
|
+
# @param authorization_id [String]
|
|
1003
|
+
# @param user_id [String]
|
|
1004
|
+
# @param user_secret [String]
|
|
1005
|
+
# @param [Hash] opts the optional parameters
|
|
1006
|
+
# @return [BrokerageAuthorizationTransactionsSyncConfirmation]
|
|
1007
|
+
private def sync_brokerage_authorization_transactions_impl(authorization_id, user_id, user_secret, opts = {})
|
|
1008
|
+
data, _status_code, _headers = sync_brokerage_authorization_transactions_with_http_info(authorization_id, user_id, user_secret, opts)
|
|
1009
|
+
data
|
|
1010
|
+
end
|
|
1011
|
+
|
|
1012
|
+
# Sync transactions for a connection
|
|
1013
|
+
# 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
|
|
1014
|
+
# @param authorization_id [String]
|
|
1015
|
+
# @param user_id [String]
|
|
1016
|
+
# @param user_secret [String]
|
|
1017
|
+
# @param [Hash] opts the optional parameters
|
|
1018
|
+
# @return [Array<(BrokerageAuthorizationTransactionsSyncConfirmation, Integer, Hash)>] BrokerageAuthorizationTransactionsSyncConfirmation data, response status code and response headers
|
|
1019
|
+
private def sync_brokerage_authorization_transactions_with_http_info_impl(authorization_id, user_id, user_secret, opts = {})
|
|
1020
|
+
if @api_client.config.debugging
|
|
1021
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.sync_brokerage_authorization_transactions ...'
|
|
1022
|
+
end
|
|
1023
|
+
# verify the required parameter 'authorization_id' is set
|
|
1024
|
+
if @api_client.config.client_side_validation && authorization_id.nil?
|
|
1025
|
+
fail ArgumentError, "Missing the required parameter 'authorization_id' when calling ConnectionsApi.sync_brokerage_authorization_transactions"
|
|
1026
|
+
end
|
|
1027
|
+
# verify the required parameter 'user_id' is set
|
|
1028
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
1029
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.sync_brokerage_authorization_transactions"
|
|
1030
|
+
end
|
|
1031
|
+
# verify the required parameter 'user_secret' is set
|
|
1032
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
1033
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.sync_brokerage_authorization_transactions"
|
|
1034
|
+
end
|
|
1035
|
+
# resource path
|
|
1036
|
+
local_var_path = '/authorizations/{authorizationId}/transactions/sync'.sub('{' + 'authorizationId' + '}', CGI.escape(authorization_id.to_s))
|
|
1037
|
+
|
|
1038
|
+
# query parameters
|
|
1039
|
+
query_params = opts[:query_params] || {}
|
|
1040
|
+
query_params[:'userId'] = user_id
|
|
1041
|
+
query_params[:'userSecret'] = user_secret
|
|
1042
|
+
|
|
1043
|
+
# header parameters
|
|
1044
|
+
header_params = opts[:header_params] || {}
|
|
1045
|
+
# HTTP header 'Accept' (if needed)
|
|
1046
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1047
|
+
|
|
1048
|
+
# form parameters
|
|
1049
|
+
form_params = opts[:form_params] || {}
|
|
1050
|
+
|
|
1051
|
+
# http body (model)
|
|
1052
|
+
post_body = opts[:debug_body]
|
|
1053
|
+
|
|
1054
|
+
# return_type
|
|
1055
|
+
return_type = opts[:debug_return_type] || 'BrokerageAuthorizationTransactionsSyncConfirmation'
|
|
1056
|
+
|
|
1057
|
+
# auth_names
|
|
1058
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
1059
|
+
|
|
1060
|
+
new_options = opts.merge(
|
|
1061
|
+
:operation => :"ConnectionsApi.sync_brokerage_authorization_transactions",
|
|
1062
|
+
:header_params => header_params,
|
|
1063
|
+
:query_params => query_params,
|
|
1064
|
+
:form_params => form_params,
|
|
1065
|
+
:body => post_body,
|
|
1066
|
+
:auth_names => auth_names,
|
|
1067
|
+
:return_type => return_type
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1071
|
+
if @api_client.config.debugging
|
|
1072
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#sync_brokerage_authorization_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1073
|
+
end
|
|
1074
|
+
return data, status_code, headers, response
|
|
1075
|
+
end
|
|
973
1076
|
end
|
|
974
1077
|
|
|
975
1078
|
# top-level client access to avoid having the user to insantiate their own API instances
|