snaptrade 2.0.36 → 2.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +60 -56
- data/lib/snaptrade/api/account_information_api.rb +4 -4
- data/lib/snaptrade/api/authentication_api.rb +12 -12
- data/lib/snaptrade/api/connections_api.rb +70 -52
- data/lib/snaptrade/models/account.rb +2 -2
- data/lib/snaptrade/models/brokerage.rb +25 -40
- data/lib/snaptrade/models/brokerage_authorization.rb +12 -8
- data/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb +1 -0
- data/lib/snaptrade/models/brokerage_type.rb +1 -1
- data/lib/snaptrade/models/user_i_dand_secret.rb +1 -2
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/authentication_api_spec.rb +2 -2
- data/spec/api/connections_api_spec.rb +13 -13
- data/spec/models/brokerage_spec.rb +6 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9395a7a9c5148bdb86a0b86e948181fef7189924188c4da86cf27a89ed75c57
|
4
|
+
data.tar.gz: 5c1cca0121a0d496d6fb3be53b67a6e500104568b32276a13763f770d2f151f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c3294b628c979b2c77328aa2b6a04784ffd2b3135c4bc7744bf21321e86c13aabeeb358631d9d71df1a9f690f0773f70d28174e5b194e691490b410dee455de
|
7
|
+
data.tar.gz: fb57f0a91a559a936fec3a109a0784d893ef9ac0d72a519efd527c4c1f5baf9f188d72692cd62808f823c90e88a12694b51c8505a994dade123f874e4550e66e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.38)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -52,7 +52,7 @@ GEM
|
|
52
52
|
rspec-mocks (~> 3.13.0)
|
53
53
|
rspec-core (3.13.0)
|
54
54
|
rspec-support (~> 3.13.0)
|
55
|
-
rspec-expectations (3.13.
|
55
|
+
rspec-expectations (3.13.2)
|
56
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
57
|
rspec-support (~> 3.13.0)
|
58
58
|
rspec-mocks (3.13.1)
|
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.0.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.38-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.38)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
70
|
Add to Gemfile:
|
71
71
|
|
72
72
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
73
|
+
gem 'snaptrade', '~> 2.0.38'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Getting Started<a id="getting-started"></a>
|
@@ -84,7 +84,7 @@ configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"]
|
|
84
84
|
snaptrade = SnapTrade::Client.new(configuration)
|
85
85
|
result = snaptrade.account_information.get_all_user_holdings(
|
86
86
|
user_id: "snaptrade-user-123",
|
87
|
-
user_secret: "
|
87
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
88
88
|
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
89
89
|
)
|
90
90
|
p result
|
@@ -97,7 +97,7 @@ To access the raw HTTP response, suffix any method with `_with_http_info`.
|
|
97
97
|
```ruby
|
98
98
|
result = snaptrade.account_information.get_all_user_holdings_with_http_info(
|
99
99
|
user_id: "snaptrade-user-123",
|
100
|
-
user_secret: "
|
100
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
101
101
|
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
102
102
|
)
|
103
103
|
p result[0] # [Array<AccountHoldings>] Deserialized data
|
@@ -123,7 +123,7 @@ account.
|
|
123
123
|
```ruby
|
124
124
|
result = snaptrade.account_information.get_all_user_holdings(
|
125
125
|
user_id: "snaptrade-user-123",
|
126
|
-
user_secret: "
|
126
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
127
127
|
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
128
128
|
)
|
129
129
|
p result
|
@@ -162,7 +162,7 @@ The data returned here is cached. How long the data is cached for varies by brok
|
|
162
162
|
```ruby
|
163
163
|
result = snaptrade.account_information.get_user_account_balance(
|
164
164
|
user_id: "snaptrade-user-123",
|
165
|
-
user_secret: "
|
165
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
166
166
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
167
167
|
)
|
168
168
|
p result
|
@@ -198,7 +198,7 @@ The data returned here is always cached and refreshed once a day. **If you need
|
|
198
198
|
```ruby
|
199
199
|
result = snaptrade.account_information.get_user_account_details(
|
200
200
|
user_id: "snaptrade-user-123",
|
201
|
-
user_secret: "
|
201
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
202
202
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
203
203
|
)
|
204
204
|
p result
|
@@ -234,7 +234,7 @@ The data returned here is cached. How long the data is cached for varies by brok
|
|
234
234
|
```ruby
|
235
235
|
result = snaptrade.account_information.get_user_account_orders(
|
236
236
|
user_id: "snaptrade-user-123",
|
237
|
-
user_secret: "
|
237
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
238
238
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
239
239
|
state: "all",
|
240
240
|
days: 30,
|
@@ -279,7 +279,7 @@ The data returned here is cached. How long the data is cached for varies by brok
|
|
279
279
|
```ruby
|
280
280
|
result = snaptrade.account_information.get_user_account_positions(
|
281
281
|
user_id: "snaptrade-user-123",
|
282
|
-
user_secret: "
|
282
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
283
283
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
284
284
|
)
|
285
285
|
p result
|
@@ -316,7 +316,7 @@ The data returned here is cached. How long the data is cached for varies by brok
|
|
316
316
|
result = snaptrade.account_information.get_user_holdings(
|
317
317
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
318
318
|
user_id: "snaptrade-user-123",
|
319
|
-
user_secret: "
|
319
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
320
320
|
)
|
321
321
|
p result
|
322
322
|
```
|
@@ -341,7 +341,7 @@ p result
|
|
341
341
|
|
342
342
|
### `snaptrade.account_information.list_user_accounts`<a id="snaptradeaccount_informationlist_user_accounts"></a>
|
343
343
|
|
344
|
-
Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
344
|
+
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
345
345
|
|
346
346
|
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
347
347
|
|
@@ -351,7 +351,7 @@ The data returned here is always cached and refreshed once a day. **If you need
|
|
351
351
|
```ruby
|
352
352
|
result = snaptrade.account_information.list_user_accounts(
|
353
353
|
user_id: "snaptrade-user-123",
|
354
|
-
user_secret: "
|
354
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
355
355
|
)
|
356
356
|
p result
|
357
357
|
```
|
@@ -382,7 +382,7 @@ Updates various properties of a specified account.
|
|
382
382
|
```ruby
|
383
383
|
result = snaptrade.account_information.update_user_account(
|
384
384
|
user_id: "snaptrade-user-123",
|
385
|
-
user_secret: "
|
385
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
386
386
|
account_id: "accountId_example",
|
387
387
|
)
|
388
388
|
p result
|
@@ -463,7 +463,7 @@ p result
|
|
463
463
|
|
464
464
|
### `snaptrade.authentication.list_snap_trade_users`<a id="snaptradeauthenticationlist_snap_trade_users"></a>
|
465
465
|
|
466
|
-
Returns a list of all registered user IDs.
|
466
|
+
Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
467
467
|
|
468
468
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
469
469
|
|
@@ -490,7 +490,7 @@ Logs in a SnapTrade user and returns an authenticated connection portal URL for
|
|
490
490
|
```ruby
|
491
491
|
result = snaptrade.authentication.login_snap_trade_user(
|
492
492
|
user_id: "snaptrade-user-123",
|
493
|
-
user_secret: "
|
493
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
494
494
|
broker: "ALPACA",
|
495
495
|
immediate_redirect: true,
|
496
496
|
custom_redirect: "https://snaptrade.com",
|
@@ -552,8 +552,8 @@ Sets the version of the connection portal to render.
|
|
552
552
|
|
553
553
|
### `snaptrade.authentication.register_snap_trade_user`<a id="snaptradeauthenticationregister_snap_trade_user"></a>
|
554
554
|
|
555
|
-
Registers a new SnapTrade user under your
|
556
|
-
Most SnapTrade operations require a user ID and user secret to be passed as
|
555
|
+
Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system.
|
556
|
+
Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
557
557
|
|
558
558
|
|
559
559
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -596,7 +596,7 @@ Rotates the secret for a SnapTrade user. You might use this if `userSecret` is c
|
|
596
596
|
```ruby
|
597
597
|
result = snaptrade.authentication.reset_snap_trade_user_secret(
|
598
598
|
user_id: "snaptrade-user-123",
|
599
|
-
user_secret: "
|
599
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
600
600
|
)
|
601
601
|
p result
|
602
602
|
```
|
@@ -610,9 +610,9 @@ NOT use email addresses for this property because they are usually not
|
|
610
610
|
immutable.
|
611
611
|
|
612
612
|
##### userSecret: `String`<a id="usersecret-string"></a>
|
613
|
-
SnapTrade User Secret randomly generated
|
614
|
-
|
615
|
-
endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret)
|
613
|
+
SnapTrade User Secret. This is a randomly generated string and should be stored
|
614
|
+
securely. If compromised, please rotate it via the [rotate user secret
|
615
|
+
endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
616
616
|
|
617
617
|
#### 🔄 Return<a id="🔄-return"></a>
|
618
618
|
|
@@ -629,15 +629,15 @@ endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret)
|
|
629
629
|
|
630
630
|
### `snaptrade.connections.detail_brokerage_authorization`<a id="snaptradeconnectionsdetail_brokerage_authorization"></a>
|
631
631
|
|
632
|
-
Returns a single
|
632
|
+
Returns a single connection for the specified ID.
|
633
633
|
|
634
634
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
635
635
|
|
636
636
|
```ruby
|
637
637
|
result = snaptrade.connections.detail_brokerage_authorization(
|
638
|
-
authorization_id: "
|
638
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
639
639
|
user_id: "snaptrade-user-123",
|
640
|
-
user_secret: "
|
640
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
641
641
|
)
|
642
642
|
p result
|
643
643
|
```
|
@@ -645,8 +645,6 @@ p result
|
|
645
645
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
646
646
|
|
647
647
|
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
648
|
-
The ID of a brokerage authorization object.
|
649
|
-
|
650
648
|
##### user_id: `String`<a id="user_id-string"></a>
|
651
649
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
652
650
|
#### 🔄 Return<a id="🔄-return"></a>
|
@@ -664,15 +662,19 @@ The ID of a brokerage authorization object.
|
|
664
662
|
|
665
663
|
### `snaptrade.connections.disable_brokerage_authorization`<a id="snaptradeconnectionsdisable_brokerage_authorization"></a>
|
666
664
|
|
667
|
-
Manually
|
665
|
+
Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
|
666
|
+
Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection.
|
667
|
+
|
668
|
+
*Please contact us in order to use this endpoint as it is disabled by default.*
|
669
|
+
|
668
670
|
|
669
671
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
670
672
|
|
671
673
|
```ruby
|
672
674
|
result = snaptrade.connections.disable_brokerage_authorization(
|
673
|
-
authorization_id: "
|
675
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
674
676
|
user_id: "snaptrade-user-123",
|
675
|
-
user_secret: "
|
677
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
676
678
|
)
|
677
679
|
p result
|
678
680
|
```
|
@@ -680,8 +682,6 @@ p result
|
|
680
682
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
681
683
|
|
682
684
|
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
683
|
-
The ID of a brokerage authorization object.
|
684
|
-
|
685
685
|
##### user_id: `String`<a id="user_id-string"></a>
|
686
686
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
687
687
|
#### 🔄 Return<a id="🔄-return"></a>
|
@@ -699,14 +699,19 @@ The ID of a brokerage authorization object.
|
|
699
699
|
|
700
700
|
### `snaptrade.connections.list_brokerage_authorizations`<a id="snaptradeconnectionslist_brokerage_authorizations"></a>
|
701
701
|
|
702
|
-
Returns a list of Brokerage Authorization
|
702
|
+
Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|
703
|
+
|
704
|
+
A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
|
705
|
+
|
706
|
+
SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
707
|
+
|
703
708
|
|
704
709
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
705
710
|
|
706
711
|
```ruby
|
707
712
|
result = snaptrade.connections.list_brokerage_authorizations(
|
708
713
|
user_id: "snaptrade-user-123",
|
709
|
-
user_secret: "
|
714
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
710
715
|
)
|
711
716
|
p result
|
712
717
|
```
|
@@ -730,15 +735,18 @@ p result
|
|
730
735
|
|
731
736
|
### `snaptrade.connections.refresh_brokerage_authorization`<a id="snaptradeconnectionsrefresh_brokerage_authorization"></a>
|
732
737
|
|
733
|
-
Trigger a holdings update for all accounts under this
|
738
|
+
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection.
|
739
|
+
|
740
|
+
*Please contact support for access as this endpoint is not enabled by default.*
|
741
|
+
|
734
742
|
|
735
743
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
736
744
|
|
737
745
|
```ruby
|
738
746
|
result = snaptrade.connections.refresh_brokerage_authorization(
|
739
|
-
authorization_id: "
|
747
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
740
748
|
user_id: "snaptrade-user-123",
|
741
|
-
user_secret: "
|
749
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
742
750
|
)
|
743
751
|
p result
|
744
752
|
```
|
@@ -746,8 +754,6 @@ p result
|
|
746
754
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
747
755
|
|
748
756
|
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
749
|
-
The ID of a brokerage authorization object.
|
750
|
-
|
751
757
|
##### user_id: `String`<a id="user_id-string"></a>
|
752
758
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
753
759
|
#### 🔄 Return<a id="🔄-return"></a>
|
@@ -765,23 +771,21 @@ The ID of a brokerage authorization object.
|
|
765
771
|
|
766
772
|
### `snaptrade.connections.remove_brokerage_authorization`<a id="snaptradeconnectionsremove_brokerage_authorization"></a>
|
767
773
|
|
768
|
-
Deletes
|
774
|
+
Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
769
775
|
|
770
776
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
771
777
|
|
772
778
|
```ruby
|
773
779
|
snaptrade.connections.remove_brokerage_authorization(
|
774
|
-
authorization_id: "
|
780
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
775
781
|
user_id: "snaptrade-user-123",
|
776
|
-
user_secret: "
|
782
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
777
783
|
)
|
778
784
|
```
|
779
785
|
|
780
786
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
781
787
|
|
782
788
|
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
783
|
-
The ID of the Authorization to delete.
|
784
|
-
|
785
789
|
##### user_id: `String`<a id="user_id-string"></a>
|
786
790
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
787
791
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
@@ -851,7 +855,7 @@ result = snaptrade.options.get_option_strategy(
|
|
851
855
|
],
|
852
856
|
strategy_type: "CUSTOM",
|
853
857
|
user_id: "snaptrade-user-123",
|
854
|
-
user_secret: "
|
858
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
855
859
|
account_id: "accountId_example",
|
856
860
|
)
|
857
861
|
p result
|
@@ -889,7 +893,7 @@ Returns the option chain for the specified symbol in the specified account.
|
|
889
893
|
```ruby
|
890
894
|
result = snaptrade.options.get_options_chain(
|
891
895
|
user_id: "snaptrade-user-123",
|
892
|
-
user_secret: "
|
896
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
893
897
|
account_id: "accountId_example",
|
894
898
|
symbol: "symbol_example",
|
895
899
|
)
|
@@ -929,7 +933,7 @@ Returns a Strategy Quotes object which has latest market data of the specified o
|
|
929
933
|
```ruby
|
930
934
|
result = snaptrade.options.get_options_strategy_quote(
|
931
935
|
user_id: "snaptrade-user-123",
|
932
|
-
user_secret: "
|
936
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
933
937
|
account_id: "accountId_example",
|
934
938
|
option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
935
939
|
)
|
@@ -971,7 +975,7 @@ The data returned here is cached. How long the data is cached for varies by brok
|
|
971
975
|
```ruby
|
972
976
|
result = snaptrade.options.list_option_holdings(
|
973
977
|
user_id: "snaptrade-user-123",
|
974
|
-
user_secret: "
|
978
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
975
979
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
976
980
|
)
|
977
981
|
p result
|
@@ -1006,7 +1010,7 @@ result = snaptrade.options.place_option_strategy(
|
|
1006
1010
|
order_type: "Limit",
|
1007
1011
|
time_in_force: "FOK",
|
1008
1012
|
user_id: "snaptrade-user-123",
|
1009
|
-
user_secret: "
|
1013
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1010
1014
|
account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
1011
1015
|
option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
1012
1016
|
price: 31.33,
|
@@ -1328,7 +1332,7 @@ provided search string, matching on ticker and name.
|
|
1328
1332
|
```ruby
|
1329
1333
|
result = snaptrade.reference_data.symbol_search_user_account(
|
1330
1334
|
user_id: "snaptrade-user-123",
|
1331
|
-
user_secret: "
|
1335
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1332
1336
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
1333
1337
|
substring: "apple",
|
1334
1338
|
)
|
@@ -1367,7 +1371,7 @@ This will only work if the order has not yet been executed.
|
|
1367
1371
|
```ruby
|
1368
1372
|
result = snaptrade.trading.cancel_user_account_order(
|
1369
1373
|
user_id: "snaptrade-user-123",
|
1370
|
-
user_secret: "
|
1374
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1371
1375
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
1372
1376
|
brokerage_order_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
1373
1377
|
)
|
@@ -1404,7 +1408,7 @@ Return the trade object and it's impact on the account for the specified order.
|
|
1404
1408
|
```ruby
|
1405
1409
|
result = snaptrade.trading.get_order_impact(
|
1406
1410
|
user_id: "snaptrade-user-123",
|
1407
|
-
user_secret: "
|
1411
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1408
1412
|
account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
1409
1413
|
action: "BUY",
|
1410
1414
|
order_type: "Limit",
|
@@ -1464,7 +1468,7 @@ Returns quote(s) from the brokerage for the specified symbol(s).
|
|
1464
1468
|
```ruby
|
1465
1469
|
result = snaptrade.trading.get_user_account_quotes(
|
1466
1470
|
user_id: "snaptrade-user-123",
|
1467
|
-
user_secret: "
|
1471
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1468
1472
|
symbols: "symbols_example",
|
1469
1473
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
1470
1474
|
use_ticker: true,
|
@@ -1507,7 +1511,7 @@ Places a specified trade in the specified account.
|
|
1507
1511
|
```ruby
|
1508
1512
|
result = snaptrade.trading.place_force_order(
|
1509
1513
|
user_id: "snaptrade-user-123",
|
1510
|
-
user_secret: "
|
1514
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1511
1515
|
account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
1512
1516
|
action: "BUY",
|
1513
1517
|
order_type: "Limit",
|
@@ -1570,7 +1574,7 @@ returns the status of the order from the brokerage.
|
|
1570
1574
|
result = snaptrade.trading.place_order(
|
1571
1575
|
trade_id: "tradeId_example",
|
1572
1576
|
user_id: "snaptrade-user-123",
|
1573
|
-
user_secret: "
|
1577
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1574
1578
|
wait_to_confirm: true,
|
1575
1579
|
)
|
1576
1580
|
p result
|
@@ -1616,7 +1620,7 @@ The data returned here is always cached and refreshed once a day. **If you need
|
|
1616
1620
|
```ruby
|
1617
1621
|
result = snaptrade.transactions_and_reporting.get_activities(
|
1618
1622
|
user_id: "snaptrade-user-123",
|
1619
|
-
user_secret: "
|
1623
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1620
1624
|
start_date: "2022-01-24",
|
1621
1625
|
end_date: "2022-01-24",
|
1622
1626
|
accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
@@ -1683,7 +1687,7 @@ result = snaptrade.transactions_and_reporting.get_reporting_custom_range(
|
|
1683
1687
|
start_date: "2022-01-24",
|
1684
1688
|
end_date: "2022-01-24",
|
1685
1689
|
user_id: "snaptrade-user-123",
|
1686
|
-
user_secret: "
|
1690
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1687
1691
|
accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
1688
1692
|
detailed: true,
|
1689
1693
|
frequency: "monthly",
|
@@ -684,7 +684,7 @@ module SnapTrade
|
|
684
684
|
|
685
685
|
# List accounts
|
686
686
|
#
|
687
|
-
# Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
687
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
688
688
|
#
|
689
689
|
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
690
690
|
#
|
@@ -698,7 +698,7 @@ module SnapTrade
|
|
698
698
|
|
699
699
|
# List accounts
|
700
700
|
#
|
701
|
-
# Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
701
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
702
702
|
#
|
703
703
|
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
704
704
|
#
|
@@ -710,7 +710,7 @@ module SnapTrade
|
|
710
710
|
end
|
711
711
|
|
712
712
|
# List accounts
|
713
|
-
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
713
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
714
714
|
# @param user_id [String]
|
715
715
|
# @param user_secret [String]
|
716
716
|
# @param [Hash] opts the optional parameters
|
@@ -721,7 +721,7 @@ module SnapTrade
|
|
721
721
|
end
|
722
722
|
|
723
723
|
# List accounts
|
724
|
-
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
724
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
725
725
|
# @param user_id [String]
|
726
726
|
# @param user_secret [String]
|
727
727
|
# @param [Hash] opts the optional parameters
|
@@ -105,7 +105,7 @@ module SnapTrade
|
|
105
105
|
|
106
106
|
# List all users
|
107
107
|
#
|
108
|
-
# Returns a list of all registered user IDs.
|
108
|
+
# Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
109
109
|
#
|
110
110
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
111
111
|
def list_snap_trade_users(extra: {})
|
@@ -115,7 +115,7 @@ module SnapTrade
|
|
115
115
|
|
116
116
|
# List all users
|
117
117
|
#
|
118
|
-
# Returns a list of all registered user IDs.
|
118
|
+
# Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
119
119
|
#
|
120
120
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
121
121
|
def list_snap_trade_users_with_http_info(extra: {})
|
@@ -123,7 +123,7 @@ module SnapTrade
|
|
123
123
|
end
|
124
124
|
|
125
125
|
# List all users
|
126
|
-
# Returns a list of all registered user IDs.
|
126
|
+
# Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
127
127
|
# @param [Hash] opts the optional parameters
|
128
128
|
# @return [Array<String>]
|
129
129
|
private def list_snap_trade_users_impl(opts = {})
|
@@ -132,7 +132,7 @@ module SnapTrade
|
|
132
132
|
end
|
133
133
|
|
134
134
|
# List all users
|
135
|
-
# Returns a list of all registered user IDs.
|
135
|
+
# Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
136
136
|
# @param [Hash] opts the optional parameters
|
137
137
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
138
138
|
private def list_snap_trade_users_with_http_info_impl(opts = {})
|
@@ -314,8 +314,8 @@ module SnapTrade
|
|
314
314
|
|
315
315
|
# Register user
|
316
316
|
#
|
317
|
-
# Registers a new SnapTrade user under your
|
318
|
-
# Most SnapTrade operations require a user ID and user secret to be passed as
|
317
|
+
# Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system.
|
318
|
+
# Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
319
319
|
#
|
320
320
|
# @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
321
321
|
# @param body [SnapTradeRegisterUserRequestBody]
|
@@ -330,8 +330,8 @@ module SnapTrade
|
|
330
330
|
|
331
331
|
# Register user
|
332
332
|
#
|
333
|
-
# Registers a new SnapTrade user under your
|
334
|
-
# Most SnapTrade operations require a user ID and user secret to be passed as
|
333
|
+
# Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system.
|
334
|
+
# Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
335
335
|
#
|
336
336
|
# @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
337
337
|
# @param body [SnapTradeRegisterUserRequestBody]
|
@@ -344,7 +344,7 @@ module SnapTrade
|
|
344
344
|
end
|
345
345
|
|
346
346
|
# Register user
|
347
|
-
# Registers a new SnapTrade user under your
|
347
|
+
# Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
348
348
|
# @param snap_trade_register_user_request_body [SnapTradeRegisterUserRequestBody]
|
349
349
|
# @param [Hash] opts the optional parameters
|
350
350
|
# @return [UserIDandSecret]
|
@@ -354,7 +354,7 @@ module SnapTrade
|
|
354
354
|
end
|
355
355
|
|
356
356
|
# Register user
|
357
|
-
# Registers a new SnapTrade user under your
|
357
|
+
# Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
358
358
|
# @param snap_trade_register_user_request_body [SnapTradeRegisterUserRequestBody]
|
359
359
|
# @param [Hash] opts the optional parameters
|
360
360
|
# @return [Array<(UserIDandSecret, Integer, Hash)>] UserIDandSecret data, response status code and response headers
|
@@ -417,7 +417,7 @@ module SnapTrade
|
|
417
417
|
# Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
|
418
418
|
#
|
419
419
|
# @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
420
|
-
# @param user_secret [String] SnapTrade User Secret randomly generated
|
420
|
+
# @param user_secret [String] SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
421
421
|
# @param body [UserIDandSecret]
|
422
422
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
423
423
|
def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
|
@@ -434,7 +434,7 @@ module SnapTrade
|
|
434
434
|
# Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
|
435
435
|
#
|
436
436
|
# @param user_id [String] SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
437
|
-
# @param user_secret [String] SnapTrade User Secret randomly generated
|
437
|
+
# @param user_secret [String] SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
438
438
|
# @param body [UserIDandSecret]
|
439
439
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
440
440
|
def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
|