snaptrade 1.17.2 → 1.17.4
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 +4 -7
- data/docs/AccountInformationApi.md +8 -4
- data/docs/AuthenticationApi.md +6 -4
- data/docs/Model500UnexpectedExceptionResponse.md +22 -0
- data/docs/OptionsApi.md +6 -6
- data/docs/OptionsPlaceOptionStrategyRequest.md +3 -3
- data/docs/ReferenceDataApi.md +6 -4
- data/docs/SnapTradeLoginUserRequestBody.md +4 -4
- data/docs/SnapTradeRegisterUserRequestBody.md +1 -3
- data/docs/StrategyOrderRecord.md +2 -2
- data/docs/TransactionsAndReportingApi.md +1 -1
- data/lib/snaptrade/api/account_information_api.rb +12 -4
- data/lib/snaptrade/api/authentication_api.rb +22 -14
- data/lib/snaptrade/api/options_api.rb +8 -8
- data/lib/snaptrade/api/reference_data_api.rb +8 -4
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/models/model500_unexpected_exception_response.rb +239 -0
- data/lib/snaptrade/models/options_place_option_strategy_request.rb +2 -2
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +4 -0
- data/lib/snaptrade/models/snap_trade_register_user_request_body.rb +4 -14
- data/lib/snaptrade/models/strategy_order_record.rb +2 -2
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -4
- data/spec/api/account_information_api_spec.rb +3 -1
- data/spec/api/authentication_api_spec.rb +3 -0
- data/spec/api/reference_data_api_spec.rb +2 -1
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- data/spec/models/model500_unexpected_exception_response_spec.rb +42 -0
- data/spec/models/snap_trade_register_user_request_body_spec.rb +0 -6
- metadata +6 -18
- data/docs/OrderStrategyExecuteBodyOrderType.md +0 -15
- data/docs/OrderStrategyExecuteBodyTimeInForce.md +0 -15
- data/docs/StrategyOrderRecordOrderType.md +0 -15
- data/docs/StrategyOrderRecordTimeInForce.md +0 -15
- data/lib/snaptrade/models/order_strategy_execute_body_order_type.rb +0 -40
- data/lib/snaptrade/models/order_strategy_execute_body_time_in_force.rb +0 -38
- data/lib/snaptrade/models/strategy_order_record_order_type.rb +0 -40
- data/lib/snaptrade/models/strategy_order_record_time_in_force.rb +0 -38
- data/spec/models/order_strategy_execute_body_order_type_spec.rb +0 -24
- data/spec/models/order_strategy_execute_body_time_in_force_spec.rb +0 -24
- data/spec/models/strategy_order_record_order_type_spec.rb +0 -24
- data/spec/models/strategy_order_record_time_in_force_spec.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ee1e44cc2bde366d7731faac581c68b517af3621461ab2a0953c9f2b0a4a6ec
|
4
|
+
data.tar.gz: dd2db85f3b6c31d935d5ef6411025e7a8c4139bcbf0701603f51ff2a34074706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2379e02876c21f12630d35108960f22b988f2c9d5eb13211f4811d5106eda52132a8bf168e529cbe1dcb0b8f8395b96c4a36a9b8b31a65b5ad8cd5453cc4eead
|
7
|
+
data.tar.gz: 2eed9e6b4512eb372a4fa1c0d554ba4664b02d069404275393b88f6ee3956de4624a15541749d0f3fc4e76120bcf6953e8b97713cafe9632955db2c7f33f3494
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ For more information, please visit [https://snaptrade.com/](https://snaptrade.co
|
|
9
9
|
Add to Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'snaptrade', '~> 1.17.
|
12
|
+
gem 'snaptrade', '~> 1.17.4'
|
13
13
|
```
|
14
14
|
|
15
15
|
## Getting Started
|
@@ -48,7 +48,7 @@ Class | Method | HTTP request | Description
|
|
48
48
|
*SnapTrade::AccountInformationApi* | [**get_user_account_details**](docs/AccountInformationApi.md#get_user_account_details) | **GET** /accounts/{accountId} | Return details of a specific investment account
|
49
49
|
*SnapTrade::AccountInformationApi* | [**get_user_account_orders**](docs/AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | Get history of orders placed in account
|
50
50
|
*SnapTrade::AccountInformationApi* | [**get_user_account_positions**](docs/AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions
|
51
|
-
*SnapTrade::AccountInformationApi* | [**get_user_holdings**](docs/AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
51
|
+
*SnapTrade::AccountInformationApi* | [**get_user_holdings**](docs/AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
52
52
|
*SnapTrade::AccountInformationApi* | [**list_user_accounts**](docs/AccountInformationApi.md#list_user_accounts) | **GET** /accounts | List accounts
|
53
53
|
*SnapTrade::AccountInformationApi* | [**update_user_account**](docs/AccountInformationApi.md#update_user_account) | **PUT** /accounts/{accountId} | Update details of an investment account
|
54
54
|
*SnapTrade::APIStatusApi* | [**check**](docs/APIStatusApi.md#check) | **GET** / | Get API Status
|
@@ -69,7 +69,7 @@ Class | Method | HTTP request | Description
|
|
69
69
|
*SnapTrade::OptionsApi* | [**place_option_strategy**](docs/OptionsApi.md#place_option_strategy) | **POST** /accounts/{accountId}/optionStrategy/{optionStrategyId}/execute | Place an option strategy order on the brokerage
|
70
70
|
*SnapTrade::ReferenceDataApi* | [**get_currency_exchange_rate_pair**](docs/ReferenceDataApi.md#get_currency_exchange_rate_pair) | **GET** /currencies/rates/{currencyPair} | Return the exchange rate of a currency pair
|
71
71
|
*SnapTrade::ReferenceDataApi* | [**get_partner_info**](docs/ReferenceDataApi.md#get_partner_info) | **GET** /snapTrade/partners | Get metadata related to Snaptrade partner
|
72
|
-
*SnapTrade::ReferenceDataApi* | [**get_security_types**](docs/ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
72
|
+
*SnapTrade::ReferenceDataApi* | [**get_security_types**](docs/ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
73
73
|
*SnapTrade::ReferenceDataApi* | [**get_stock_exchanges**](docs/ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges
|
74
74
|
*SnapTrade::ReferenceDataApi* | [**get_symbols**](docs/ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols
|
75
75
|
*SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker
|
@@ -135,6 +135,7 @@ Class | Method | HTTP request | Description
|
|
135
135
|
- [SnapTrade::Model401FailedRequestResponse](docs/Model401FailedRequestResponse.md)
|
136
136
|
- [SnapTrade::Model403FailedRequestResponse](docs/Model403FailedRequestResponse.md)
|
137
137
|
- [SnapTrade::Model404FailedRequestResponse](docs/Model404FailedRequestResponse.md)
|
138
|
+
- [SnapTrade::Model500UnexpectedExceptionResponse](docs/Model500UnexpectedExceptionResponse.md)
|
138
139
|
- [SnapTrade::ModelAssetClass](docs/ModelAssetClass.md)
|
139
140
|
- [SnapTrade::ModelAssetClassDetails](docs/ModelAssetClassDetails.md)
|
140
141
|
- [SnapTrade::ModelAssetClassTarget](docs/ModelAssetClassTarget.md)
|
@@ -160,8 +161,6 @@ Class | Method | HTTP request | Description
|
|
160
161
|
- [SnapTrade::OptionsPosition](docs/OptionsPosition.md)
|
161
162
|
- [SnapTrade::OptionsPositionCurrency](docs/OptionsPositionCurrency.md)
|
162
163
|
- [SnapTrade::OptionsSymbol](docs/OptionsSymbol.md)
|
163
|
-
- [SnapTrade::OrderStrategyExecuteBodyOrderType](docs/OrderStrategyExecuteBodyOrderType.md)
|
164
|
-
- [SnapTrade::OrderStrategyExecuteBodyTimeInForce](docs/OrderStrategyExecuteBodyTimeInForce.md)
|
165
164
|
- [SnapTrade::OrderType](docs/OrderType.md)
|
166
165
|
- [SnapTrade::PartnerData](docs/PartnerData.md)
|
167
166
|
- [SnapTrade::PastValue](docs/PastValue.md)
|
@@ -190,9 +189,7 @@ Class | Method | HTTP request | Description
|
|
190
189
|
- [SnapTrade::StrategyOrderPlaceOrdersInner](docs/StrategyOrderPlaceOrdersInner.md)
|
191
190
|
- [SnapTrade::StrategyOrderPlaceOrdersInnerLegsInner](docs/StrategyOrderPlaceOrdersInnerLegsInner.md)
|
192
191
|
- [SnapTrade::StrategyOrderRecord](docs/StrategyOrderRecord.md)
|
193
|
-
- [SnapTrade::StrategyOrderRecordOrderType](docs/StrategyOrderRecordOrderType.md)
|
194
192
|
- [SnapTrade::StrategyOrderRecordStatus](docs/StrategyOrderRecordStatus.md)
|
195
|
-
- [SnapTrade::StrategyOrderRecordTimeInForce](docs/StrategyOrderRecordTimeInForce.md)
|
196
193
|
- [SnapTrade::StrategyQuotes](docs/StrategyQuotes.md)
|
197
194
|
- [SnapTrade::StrategyQuotesGreek](docs/StrategyQuotesGreek.md)
|
198
195
|
- [SnapTrade::StrategyType](docs/StrategyType.md)
|
@@ -9,7 +9,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
9
9
|
| [**get_user_account_details**](AccountInformationApi.md#get_user_account_details) | **GET** /accounts/{accountId} | Return details of a specific investment account |
|
10
10
|
| [**get_user_account_orders**](AccountInformationApi.md#get_user_account_orders) | **GET** /accounts/{accountId}/orders | Get history of orders placed in account |
|
11
11
|
| [**get_user_account_positions**](AccountInformationApi.md#get_user_account_positions) | **GET** /accounts/{accountId}/positions | List account positions |
|
12
|
-
| [**get_user_holdings**](AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account
|
12
|
+
| [**get_user_holdings**](AccountInformationApi.md#get_user_holdings) | **GET** /accounts/{accountId}/holdings | List balances, positions and orders for the specified account |
|
13
13
|
| [**list_user_accounts**](AccountInformationApi.md#list_user_accounts) | **GET** /accounts | List accounts |
|
14
14
|
| [**update_user_account**](AccountInformationApi.md#update_user_account) | **PUT** /accounts/{accountId} | Update details of an investment account |
|
15
15
|
|
@@ -82,6 +82,8 @@ end
|
|
82
82
|
|
83
83
|
List account balances
|
84
84
|
|
85
|
+
A list of account balances for the specified account (one per currency that the account holds).
|
86
|
+
|
85
87
|
### Example
|
86
88
|
|
87
89
|
```ruby
|
@@ -212,6 +214,8 @@ end
|
|
212
214
|
|
213
215
|
Get history of orders placed in account
|
214
216
|
|
217
|
+
Fetch all recent orders from a user's account.
|
218
|
+
|
215
219
|
### Example
|
216
220
|
|
217
221
|
```ruby
|
@@ -345,7 +349,7 @@ end
|
|
345
349
|
|
346
350
|
## get_user_holdings
|
347
351
|
|
348
|
-
List balances, positions and orders for the specified account
|
352
|
+
List balances, positions and orders for the specified account
|
349
353
|
|
350
354
|
### Example
|
351
355
|
|
@@ -360,7 +364,7 @@ user_id = "John.doe@snaptrade.com"
|
|
360
364
|
user_secret = "USERSECRET123"
|
361
365
|
|
362
366
|
begin
|
363
|
-
# List balances, positions and orders for the specified account
|
367
|
+
# List balances, positions and orders for the specified account
|
364
368
|
result = SnapTrade::AccountInformation.get_user_holdings(
|
365
369
|
account_id: account_id,
|
366
370
|
user_id: user_id,
|
@@ -382,7 +386,7 @@ user_id = "John.doe@snaptrade.com"
|
|
382
386
|
user_secret = "USERSECRET123"
|
383
387
|
|
384
388
|
begin
|
385
|
-
# List balances, positions and orders for the specified account
|
389
|
+
# List balances, positions and orders for the specified account
|
386
390
|
data, status_code, headers, response = SnapTrade::AccountInformation.get_user_holdings_with_http_info(
|
387
391
|
account_id: account_id,
|
388
392
|
user_id: user_id,
|
data/docs/AuthenticationApi.md
CHANGED
@@ -14,6 +14,8 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
14
14
|
|
15
15
|
Delete SnapTrade user
|
16
16
|
|
17
|
+
Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
18
|
+
|
17
19
|
### Example
|
18
20
|
|
19
21
|
```ruby
|
@@ -129,6 +131,8 @@ end
|
|
129
131
|
|
130
132
|
List SnapTrade users
|
131
133
|
|
134
|
+
Returns a list of users you've registered over the SnapTrade API.
|
135
|
+
|
132
136
|
### Example
|
133
137
|
|
134
138
|
```ruby
|
@@ -176,6 +180,8 @@ This endpoint does not need any parameter.
|
|
176
180
|
|
177
181
|
Login user & generate connection link
|
178
182
|
|
183
|
+
Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
184
|
+
|
179
185
|
### Example
|
180
186
|
|
181
187
|
```ruby
|
@@ -266,13 +272,11 @@ SnapTrade.client_id = "YOUR_CLIENT_ID"
|
|
266
272
|
SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
267
273
|
|
268
274
|
user_id = "snaptrade-user-123"
|
269
|
-
rsa_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw=="
|
270
275
|
|
271
276
|
begin
|
272
277
|
# Create SnapTrade user
|
273
278
|
result = SnapTrade::Authentication.register_snap_trade_user(
|
274
279
|
user_id: user_id,
|
275
|
-
rsa_public_key: rsa_public_key,
|
276
280
|
)
|
277
281
|
p result
|
278
282
|
rescue SnapTrade::ApiError => e
|
@@ -286,13 +290,11 @@ This returns an Array which contains the response data, status code and headers.
|
|
286
290
|
|
287
291
|
```ruby
|
288
292
|
user_id = "snaptrade-user-123"
|
289
|
-
rsa_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw=="
|
290
293
|
|
291
294
|
begin
|
292
295
|
# Create SnapTrade user
|
293
296
|
data, status_code, headers, response = SnapTrade::Authentication.register_snap_trade_user_with_http_info(
|
294
297
|
user_id: user_id,
|
295
|
-
rsa_public_key: rsa_public_key,
|
296
298
|
)
|
297
299
|
p status_code # => 2xx
|
298
300
|
p headers # => { ... }
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SnapTrade::Model500UnexpectedExceptionResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **detail** | **Object** | | [optional] |
|
8
|
+
| **status_code** | **Object** | | [optional] |
|
9
|
+
| **code** | **Object** | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'snaptrade'
|
15
|
+
|
16
|
+
instance = SnapTrade::Model500UnexpectedExceptionResponse.new(
|
17
|
+
detail: Encountered an unexpected exception.,
|
18
|
+
status_code: 500,
|
19
|
+
code: 1000
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/OptionsApi.md
CHANGED
@@ -318,23 +318,23 @@ SnapTrade.client_id = "YOUR_CLIENT_ID"
|
|
318
318
|
SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
319
319
|
|
320
320
|
order_type = "Limit"
|
321
|
-
time_in_force = "
|
322
|
-
price = 31.33
|
321
|
+
time_in_force = "Day"
|
323
322
|
user_id = "John.doe@snaptrade.com"
|
324
323
|
user_secret = "USERSECRET123"
|
325
324
|
account_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
326
325
|
option_strategy_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
326
|
+
price = 31.33
|
327
327
|
|
328
328
|
begin
|
329
329
|
# Place an option strategy order on the brokerage
|
330
330
|
result = SnapTrade::Options.place_option_strategy(
|
331
331
|
order_type: order_type,
|
332
332
|
time_in_force: time_in_force,
|
333
|
-
price: price,
|
334
333
|
user_id: user_id,
|
335
334
|
user_secret: user_secret,
|
336
335
|
account_id: account_id,
|
337
336
|
option_strategy_id: option_strategy_id,
|
337
|
+
price: price,
|
338
338
|
)
|
339
339
|
p result
|
340
340
|
rescue SnapTrade::ApiError => e
|
@@ -348,23 +348,23 @@ This returns an Array which contains the response data, status code and headers.
|
|
348
348
|
|
349
349
|
```ruby
|
350
350
|
order_type = "Limit"
|
351
|
-
time_in_force = "
|
352
|
-
price = 31.33
|
351
|
+
time_in_force = "Day"
|
353
352
|
user_id = "John.doe@snaptrade.com"
|
354
353
|
user_secret = "USERSECRET123"
|
355
354
|
account_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
356
355
|
option_strategy_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
356
|
+
price = 31.33
|
357
357
|
|
358
358
|
begin
|
359
359
|
# Place an option strategy order on the brokerage
|
360
360
|
data, status_code, headers, response = SnapTrade::Options.place_option_strategy_with_http_info(
|
361
361
|
order_type: order_type,
|
362
362
|
time_in_force: time_in_force,
|
363
|
-
price: price,
|
364
363
|
user_id: user_id,
|
365
364
|
user_secret: user_secret,
|
366
365
|
account_id: account_id,
|
367
366
|
option_strategy_id: option_strategy_id,
|
367
|
+
price: price,
|
368
368
|
)
|
369
369
|
p status_code # => 2xx
|
370
370
|
p headers # => { ... }
|
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **order_type** | [**
|
8
|
-
| **time_in_force** | [**
|
9
|
-
| **price** | **Float** | Trade Price if limit or stop limit order |
|
7
|
+
| **order_type** | [**OrderType**](OrderType.md) | | |
|
8
|
+
| **time_in_force** | [**TimeInForce**](TimeInForce.md) | | |
|
9
|
+
| **price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
10
10
|
|
11
11
|
## Example
|
12
12
|
|
data/docs/ReferenceDataApi.md
CHANGED
@@ -6,7 +6,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
6
6
|
| ------ | ------------ | ----------- |
|
7
7
|
| [**get_currency_exchange_rate_pair**](ReferenceDataApi.md#get_currency_exchange_rate_pair) | **GET** /currencies/rates/{currencyPair} | Return the exchange rate of a currency pair |
|
8
8
|
| [**get_partner_info**](ReferenceDataApi.md#get_partner_info) | **GET** /snapTrade/partners | Get metadata related to Snaptrade partner |
|
9
|
-
| [**get_security_types**](ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
|
9
|
+
| [**get_security_types**](ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types |
|
10
10
|
| [**get_stock_exchanges**](ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges |
|
11
11
|
| [**get_symbols**](ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols |
|
12
12
|
| [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker |
|
@@ -120,7 +120,9 @@ This endpoint does not need any parameter.
|
|
120
120
|
|
121
121
|
## get_security_types
|
122
122
|
|
123
|
-
List of all security types
|
123
|
+
List of all security types
|
124
|
+
|
125
|
+
List security types available on SnapTrade.
|
124
126
|
|
125
127
|
### Example
|
126
128
|
|
@@ -132,7 +134,7 @@ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
|
|
132
134
|
|
133
135
|
|
134
136
|
begin
|
135
|
-
# List of all security types
|
137
|
+
# List of all security types
|
136
138
|
result = SnapTrade::ReferenceData.get_security_types
|
137
139
|
p result
|
138
140
|
rescue SnapTrade::ApiError => e
|
@@ -147,7 +149,7 @@ This returns an Array which contains the response data, status code and headers.
|
|
147
149
|
```ruby
|
148
150
|
|
149
151
|
begin
|
150
|
-
# List of all security types
|
152
|
+
# List of all security types
|
151
153
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_security_types_with_http_info
|
152
154
|
p status_code # => 2xx
|
153
155
|
p headers # => { ... }
|
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **broker** | **String** |
|
8
|
-
| **immediate_redirect** | **Boolean** |
|
9
|
-
| **custom_redirect** | **String** |
|
10
|
-
| **reconnect** | **String** |
|
7
|
+
| **broker** | **String** | Slug of the brokerage to connect the user to | [optional] |
|
8
|
+
| **immediate_redirect** | **Boolean** | When set to True, user will be redirected back to the partner's site instead of the connection portal | [optional] |
|
9
|
+
| **custom_redirect** | **String** | URL to redirect the user to after the user connects their brokerage account | [optional] |
|
10
|
+
| **reconnect** | **String** | The UUID of the brokerage connection to be reconnected | [optional] |
|
11
11
|
| **connection_type** | [**ConnectionType**](ConnectionType.md) | | [optional] |
|
12
12
|
|
13
13
|
## Example
|
@@ -5,7 +5,6 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **user_id** | **String** | SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user | [optional] |
|
8
|
-
| **rsa_public_key** | **String** | Open SSH RSA public key | [optional] |
|
9
8
|
|
10
9
|
## Example
|
11
10
|
|
@@ -13,8 +12,7 @@
|
|
13
12
|
require 'snaptrade'
|
14
13
|
|
15
14
|
instance = SnapTrade::SnapTradeRegisterUserRequestBody.new(
|
16
|
-
user_id: snaptrade-user-123
|
17
|
-
rsa_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==
|
15
|
+
user_id: snaptrade-user-123
|
18
16
|
)
|
19
17
|
```
|
20
18
|
|
data/docs/StrategyOrderRecord.md
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
| **filled_quantity** | **Float** | | [optional] |
|
10
10
|
| **open_quantity** | **Float** | | [optional] |
|
11
11
|
| **closed_quantity** | **Float** | | [optional] |
|
12
|
-
| **order_type** | [**
|
13
|
-
| **time_in_force** | [**
|
12
|
+
| **order_type** | [**OrderType**](OrderType.md) | | [optional] |
|
13
|
+
| **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
|
14
14
|
| **limit_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
15
15
|
| **execution_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
16
16
|
| **time_placed** | **String** | Time | [optional] |
|
@@ -11,7 +11,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
11
11
|
|
12
12
|
Get transaction history for a user
|
13
13
|
|
14
|
-
Returns activities (transactions) for a user. Specifing start and end date is highly recommended for
|
14
|
+
Returns activities (transactions) for a user. Specifing start and end date is highly recommended for better performance
|
15
15
|
|
16
16
|
### Example
|
17
17
|
|
@@ -113,6 +113,7 @@ module SnapTrade
|
|
113
113
|
|
114
114
|
|
115
115
|
# List account balances
|
116
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
116
117
|
# @param user_id [String]
|
117
118
|
# @param user_secret [String]
|
118
119
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -123,6 +124,7 @@ module SnapTrade
|
|
123
124
|
end
|
124
125
|
|
125
126
|
# List account balances
|
127
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
126
128
|
# @param user_id [String]
|
127
129
|
# @param user_secret [String]
|
128
130
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -132,6 +134,7 @@ module SnapTrade
|
|
132
134
|
end
|
133
135
|
|
134
136
|
# List account balances
|
137
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
135
138
|
# @param user_id [String]
|
136
139
|
# @param user_secret [String]
|
137
140
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -143,6 +146,7 @@ module SnapTrade
|
|
143
146
|
end
|
144
147
|
|
145
148
|
# List account balances
|
149
|
+
# A list of account balances for the specified account (one per currency that the account holds).
|
146
150
|
# @param user_id [String]
|
147
151
|
# @param user_secret [String]
|
148
152
|
# @param account_id [String] The ID of the account to get balances.
|
@@ -303,6 +307,7 @@ module SnapTrade
|
|
303
307
|
|
304
308
|
|
305
309
|
# Get history of orders placed in account
|
310
|
+
# Fetch all recent orders from a user's account.
|
306
311
|
# @param user_id [String]
|
307
312
|
# @param user_secret [String]
|
308
313
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -315,6 +320,7 @@ module SnapTrade
|
|
315
320
|
end
|
316
321
|
|
317
322
|
# Get history of orders placed in account
|
323
|
+
# Fetch all recent orders from a user's account.
|
318
324
|
# @param user_id [String]
|
319
325
|
# @param user_secret [String]
|
320
326
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -326,6 +332,7 @@ module SnapTrade
|
|
326
332
|
end
|
327
333
|
|
328
334
|
# Get history of orders placed in account
|
335
|
+
# Fetch all recent orders from a user's account.
|
329
336
|
# @param user_id [String]
|
330
337
|
# @param user_secret [String]
|
331
338
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -338,6 +345,7 @@ module SnapTrade
|
|
338
345
|
end
|
339
346
|
|
340
347
|
# Get history of orders placed in account
|
348
|
+
# Fetch all recent orders from a user's account.
|
341
349
|
# @param user_id [String]
|
342
350
|
# @param user_secret [String]
|
343
351
|
# @param account_id [String] The ID of the account to get orders.
|
@@ -503,7 +511,7 @@ module SnapTrade
|
|
503
511
|
end
|
504
512
|
|
505
513
|
|
506
|
-
# List balances, positions and orders for the specified account
|
514
|
+
# List balances, positions and orders for the specified account
|
507
515
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
508
516
|
# @param user_id [String]
|
509
517
|
# @param user_secret [String]
|
@@ -513,7 +521,7 @@ module SnapTrade
|
|
513
521
|
data
|
514
522
|
end
|
515
523
|
|
516
|
-
# List balances, positions and orders for the specified account
|
524
|
+
# List balances, positions and orders for the specified account
|
517
525
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
518
526
|
# @param user_id [String]
|
519
527
|
# @param user_secret [String]
|
@@ -522,7 +530,7 @@ module SnapTrade
|
|
522
530
|
get_user_holdings_with_http_info_impl(account_id, user_id, user_secret, extra)
|
523
531
|
end
|
524
532
|
|
525
|
-
# List balances, positions and orders for the specified account
|
533
|
+
# List balances, positions and orders for the specified account
|
526
534
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
527
535
|
# @param user_id [String]
|
528
536
|
# @param user_secret [String]
|
@@ -533,7 +541,7 @@ module SnapTrade
|
|
533
541
|
data
|
534
542
|
end
|
535
543
|
|
536
|
-
# List balances, positions and orders for the specified account
|
544
|
+
# List balances, positions and orders for the specified account
|
537
545
|
# @param account_id [String] The ID of the account to fetch holdings for.
|
538
546
|
# @param user_id [String]
|
539
547
|
# @param user_secret [String]
|
@@ -19,6 +19,7 @@ module SnapTrade
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# Delete SnapTrade user
|
22
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
22
23
|
# @param user_id [String]
|
23
24
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
24
25
|
def delete_snap_trade_user(user_id:, extra: {})
|
@@ -27,6 +28,7 @@ module SnapTrade
|
|
27
28
|
end
|
28
29
|
|
29
30
|
# Delete SnapTrade user
|
31
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
30
32
|
# @param user_id [String]
|
31
33
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
32
34
|
def delete_snap_trade_user_with_http_info(user_id:, extra: {})
|
@@ -34,6 +36,7 @@ module SnapTrade
|
|
34
36
|
end
|
35
37
|
|
36
38
|
# Delete SnapTrade user
|
39
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
37
40
|
# @param user_id [String]
|
38
41
|
# @param [Hash] opts the optional parameters
|
39
42
|
# @return [DeleteUserResponse]
|
@@ -43,6 +46,7 @@ module SnapTrade
|
|
43
46
|
end
|
44
47
|
|
45
48
|
# Delete SnapTrade user
|
49
|
+
# Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts.
|
46
50
|
# @param user_id [String]
|
47
51
|
# @param [Hash] opts the optional parameters
|
48
52
|
# @return [Array<(DeleteUserResponse, Integer, Hash)>] DeleteUserResponse data, response status code and response headers
|
@@ -184,6 +188,7 @@ module SnapTrade
|
|
184
188
|
|
185
189
|
|
186
190
|
# List SnapTrade users
|
191
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
187
192
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
188
193
|
def list_snap_trade_users(extra: {})
|
189
194
|
data, _status_code, _headers = list_snap_trade_users_with_http_info_impl(extra)
|
@@ -191,12 +196,14 @@ module SnapTrade
|
|
191
196
|
end
|
192
197
|
|
193
198
|
# List SnapTrade users
|
199
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
194
200
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
195
201
|
def list_snap_trade_users_with_http_info(extra: {})
|
196
202
|
list_snap_trade_users_with_http_info_impl(extra)
|
197
203
|
end
|
198
204
|
|
199
205
|
# List SnapTrade users
|
206
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
200
207
|
# @param [Hash] opts the optional parameters
|
201
208
|
# @return [Array<String>]
|
202
209
|
def list_snap_trade_users_impl(opts = {})
|
@@ -205,6 +212,7 @@ module SnapTrade
|
|
205
212
|
end
|
206
213
|
|
207
214
|
# List SnapTrade users
|
215
|
+
# Returns a list of users you've registered over the SnapTrade API.
|
208
216
|
# @param [Hash] opts the optional parameters
|
209
217
|
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
210
218
|
def list_snap_trade_users_with_http_info_impl(opts = {})
|
@@ -253,12 +261,13 @@ module SnapTrade
|
|
253
261
|
|
254
262
|
|
255
263
|
# Login user & generate connection link
|
264
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
256
265
|
# @param user_id [String]
|
257
266
|
# @param user_secret [String]
|
258
|
-
# @param broker [String]
|
259
|
-
# @param immediate_redirect [Boolean]
|
260
|
-
# @param custom_redirect [String]
|
261
|
-
# @param reconnect [String]
|
267
|
+
# @param broker [String] Slug of the brokerage to connect the user to
|
268
|
+
# @param immediate_redirect [Boolean] When set to True, user will be redirected back to the partner's site instead of the connection portal
|
269
|
+
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account
|
270
|
+
# @param reconnect [String] The UUID of the brokerage connection to be reconnected
|
262
271
|
# @param connection_type [ConnectionType]
|
263
272
|
# @param body [SnapTradeLoginUserRequestBody]
|
264
273
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -275,12 +284,13 @@ module SnapTrade
|
|
275
284
|
end
|
276
285
|
|
277
286
|
# Login user & generate connection link
|
287
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
278
288
|
# @param user_id [String]
|
279
289
|
# @param user_secret [String]
|
280
|
-
# @param broker [String]
|
281
|
-
# @param immediate_redirect [Boolean]
|
282
|
-
# @param custom_redirect [String]
|
283
|
-
# @param reconnect [String]
|
290
|
+
# @param broker [String] Slug of the brokerage to connect the user to
|
291
|
+
# @param immediate_redirect [Boolean] When set to True, user will be redirected back to the partner's site instead of the connection portal
|
292
|
+
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account
|
293
|
+
# @param reconnect [String] The UUID of the brokerage connection to be reconnected
|
284
294
|
# @param connection_type [ConnectionType]
|
285
295
|
# @param body [SnapTradeLoginUserRequestBody]
|
286
296
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -296,6 +306,7 @@ module SnapTrade
|
|
296
306
|
end
|
297
307
|
|
298
308
|
# Login user & generate connection link
|
309
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
299
310
|
# @param user_id [String]
|
300
311
|
# @param user_secret [String]
|
301
312
|
# @param [Hash] opts the optional parameters
|
@@ -307,6 +318,7 @@ module SnapTrade
|
|
307
318
|
end
|
308
319
|
|
309
320
|
# Login user & generate connection link
|
321
|
+
# Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.
|
310
322
|
# @param user_id [String]
|
311
323
|
# @param user_secret [String]
|
312
324
|
# @param [Hash] opts the optional parameters
|
@@ -374,13 +386,11 @@ module SnapTrade
|
|
374
386
|
|
375
387
|
# Create SnapTrade user
|
376
388
|
# @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
377
|
-
# @param rsa_public_key [String] Open SSH RSA public key
|
378
389
|
# @param body [SnapTradeRegisterUserRequestBody]
|
379
390
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
380
|
-
def register_snap_trade_user(user_id: SENTINEL,
|
391
|
+
def register_snap_trade_user(user_id: SENTINEL, extra: {})
|
381
392
|
_body = {}
|
382
393
|
_body[:userId] = user_id if user_id != SENTINEL
|
383
|
-
_body[:rsaPublicKey] = rsa_public_key if rsa_public_key != SENTINEL
|
384
394
|
snap_trade_register_user_request_body = _body
|
385
395
|
data, _status_code, _headers = register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
|
386
396
|
data
|
@@ -388,13 +398,11 @@ module SnapTrade
|
|
388
398
|
|
389
399
|
# Create SnapTrade user
|
390
400
|
# @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it's unique to a user
|
391
|
-
# @param rsa_public_key [String] Open SSH RSA public key
|
392
401
|
# @param body [SnapTradeRegisterUserRequestBody]
|
393
402
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
394
|
-
def register_snap_trade_user_with_http_info(user_id: SENTINEL,
|
403
|
+
def register_snap_trade_user_with_http_info(user_id: SENTINEL, extra: {})
|
395
404
|
_body = {}
|
396
405
|
_body[:userId] = user_id if user_id != SENTINEL
|
397
|
-
_body[:rsaPublicKey] = rsa_public_key if rsa_public_key != SENTINEL
|
398
406
|
snap_trade_register_user_request_body = _body
|
399
407
|
register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
|
400
408
|
end
|
@@ -445,16 +445,16 @@ module SnapTrade
|
|
445
445
|
|
446
446
|
|
447
447
|
# Place an option strategy order on the brokerage
|
448
|
-
# @param order_type [
|
449
|
-
# @param time_in_force [
|
450
|
-
# @param price [Float] Trade Price if limit or stop limit order
|
448
|
+
# @param order_type [OrderType]
|
449
|
+
# @param time_in_force [TimeInForce]
|
451
450
|
# @param user_id [String]
|
452
451
|
# @param user_secret [String]
|
453
452
|
# @param account_id [String] The ID of the account to execute the strategy in.
|
454
453
|
# @param option_strategy_id [String] Option strategy id obtained from response when creating option strategy object
|
454
|
+
# @param price [Float] Trade Price if limit or stop limit order
|
455
455
|
# @param body [OptionsPlaceOptionStrategyRequest]
|
456
456
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
457
|
-
def place_option_strategy(order_type:, time_in_force:,
|
457
|
+
def place_option_strategy(order_type:, time_in_force:, user_id:, user_secret:, account_id:, option_strategy_id:, price: SENTINEL, extra: {})
|
458
458
|
_body = {}
|
459
459
|
_body[:order_type] = order_type if order_type != SENTINEL
|
460
460
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|
@@ -465,16 +465,16 @@ module SnapTrade
|
|
465
465
|
end
|
466
466
|
|
467
467
|
# Place an option strategy order on the brokerage
|
468
|
-
# @param order_type [
|
469
|
-
# @param time_in_force [
|
470
|
-
# @param price [Float] Trade Price if limit or stop limit order
|
468
|
+
# @param order_type [OrderType]
|
469
|
+
# @param time_in_force [TimeInForce]
|
471
470
|
# @param user_id [String]
|
472
471
|
# @param user_secret [String]
|
473
472
|
# @param account_id [String] The ID of the account to execute the strategy in.
|
474
473
|
# @param option_strategy_id [String] Option strategy id obtained from response when creating option strategy object
|
474
|
+
# @param price [Float] Trade Price if limit or stop limit order
|
475
475
|
# @param body [OptionsPlaceOptionStrategyRequest]
|
476
476
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
477
|
-
def place_option_strategy_with_http_info(order_type:, time_in_force:,
|
477
|
+
def place_option_strategy_with_http_info(order_type:, time_in_force:, user_id:, user_secret:, account_id:, option_strategy_id:, price: SENTINEL, extra: {})
|
478
478
|
_body = {}
|
479
479
|
_body[:order_type] = order_type if order_type != SENTINEL
|
480
480
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|