snaptrade 3.0.53 → 3.0.55
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/README.md +53 -4
- data/lib/snaptrade/api/account_information_api.rb +6 -6
- data/lib/snaptrade/api/experimental_endpoints_api.rb +128 -0
- data/lib/snaptrade/models/account_position.rb +1 -1
- data/lib/snaptrade/models/all_account_orders_response.rb +1 -1
- data/lib/snaptrade/models/instrument.rb +2 -0
- data/lib/snaptrade/models/preferred_stock_instrument.rb +311 -0
- data/lib/snaptrade/models/preferred_stock_instrument_kind.rb +36 -0
- data/lib/snaptrade/models/underlying_cfd_instrument.rb +2 -0
- data/lib/snaptrade/models/underlying_option_instrument.rb +2 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +2 -0
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/experimental_endpoints_api_spec.rb +15 -0
- data/spec/models/preferred_stock_instrument_kind_spec.rb +23 -0
- data/spec/models/preferred_stock_instrument_spec.rb +71 -0
- metadata +286 -280
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d287578bf468373387af4dc41a0667d7ffab76dc2d179253d20befd8fd7d340
|
|
4
|
+
data.tar.gz: a4f26360a33be173e0aff43f782ed8756dbbc2fd4a98e7a99db47d9c99e2308a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed65b82c974ae5d04736fb8151e910b9d947f4c5ad6d83019c431196712fcb67990930c82123a0bbeec7f344508b39276323293af5d57a76f094ed9df4b0aae6
|
|
7
|
+
data.tar.gz: c81aedddc8755207ec7fb37709e86939f63d1ab14074a5d6876f5d266ec6836a1a93d95254cea07c34d0ebe57e7bfa700221bdff90e709f7f0f30f815f43253d
|
data/README.md
CHANGED
|
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
|
|
|
63
63
|
See https://docs.snaptrade.com/docs/ratelimiting.
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
[](https://rubygems.org/gems/snaptrade/versions/3.0.55)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -109,6 +109,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
109
109
|
* [`snaptrade.experimental_endpoints.add_subscription`](#snaptradeexperimental_endpointsadd_subscription)
|
|
110
110
|
* [`snaptrade.experimental_endpoints.cancel_subscription`](#snaptradeexperimental_endpointscancel_subscription)
|
|
111
111
|
* [`snaptrade.experimental_endpoints.get_all_account_orders`](#snaptradeexperimental_endpointsget_all_account_orders)
|
|
112
|
+
* [`snaptrade.experimental_endpoints.get_all_account_recent_orders`](#snaptradeexperimental_endpointsget_all_account_recent_orders)
|
|
112
113
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
113
114
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
114
115
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
@@ -147,7 +148,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
147
148
|
Add to Gemfile:
|
|
148
149
|
|
|
149
150
|
```ruby
|
|
150
|
-
gem 'snaptrade', '~> 3.0.
|
|
151
|
+
gem 'snaptrade', '~> 3.0.55'
|
|
151
152
|
```
|
|
152
153
|
|
|
153
154
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -403,11 +404,11 @@ p result
|
|
|
403
404
|
|
|
404
405
|
Returns a list of all positions in the specified account.
|
|
405
406
|
|
|
406
|
-
The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
407
|
+
The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
407
408
|
|
|
408
409
|
**Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change.
|
|
409
410
|
|
|
410
|
-
Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
411
|
+
Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
411
412
|
|
|
412
413
|
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.
|
|
413
414
|
|
|
@@ -1559,6 +1560,54 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
|
1559
1560
|
---
|
|
1560
1561
|
|
|
1561
1562
|
|
|
1563
|
+
### `snaptrade.experimental_endpoints.get_all_account_recent_orders`<a id="snaptradeexperimental_endpointsget_all_account_recent_orders"></a>
|
|
1564
|
+
|
|
1565
|
+
A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
1566
|
+
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.
|
|
1567
|
+
Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days.
|
|
1568
|
+
By default only returns executed orders, but that can be changed by setting *only_executed* to false.
|
|
1569
|
+
|
|
1570
|
+
Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request.
|
|
1571
|
+
|
|
1572
|
+
**Experimental:** this endpoint may change without notice.
|
|
1573
|
+
|
|
1574
|
+
**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)**
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1578
|
+
|
|
1579
|
+
```ruby
|
|
1580
|
+
result = snaptrade.experimental_endpoints.get_all_account_recent_orders(
|
|
1581
|
+
user_id: "snaptrade-user-123",
|
|
1582
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1583
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1584
|
+
only_executed: true,
|
|
1585
|
+
)
|
|
1586
|
+
p result
|
|
1587
|
+
```
|
|
1588
|
+
|
|
1589
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1590
|
+
|
|
1591
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1592
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1593
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1594
|
+
##### only_executed: `Boolean`<a id="only_executed-boolean"></a>
|
|
1595
|
+
Defaults to true. Indicates if request should fetch only executed orders. Set to
|
|
1596
|
+
false to retrieve non executed orders as well
|
|
1597
|
+
|
|
1598
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1599
|
+
|
|
1600
|
+
[AllAccountOrdersResponse](./lib/snaptrade/models/all_account_orders_response.rb)
|
|
1601
|
+
|
|
1602
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1603
|
+
|
|
1604
|
+
`/accounts/{accountId}/orders/recent` `GET`
|
|
1605
|
+
|
|
1606
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1607
|
+
|
|
1608
|
+
---
|
|
1609
|
+
|
|
1610
|
+
|
|
1562
1611
|
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1563
1612
|
|
|
1564
1613
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -536,11 +536,11 @@ module SnapTrade
|
|
|
536
536
|
#
|
|
537
537
|
# Returns a list of all positions in the specified account.
|
|
538
538
|
#
|
|
539
|
-
# The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
539
|
+
# The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
540
540
|
#
|
|
541
541
|
# **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change.
|
|
542
542
|
#
|
|
543
|
-
# Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
543
|
+
# Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
544
544
|
#
|
|
545
545
|
# 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.
|
|
546
546
|
#
|
|
@@ -557,11 +557,11 @@ module SnapTrade
|
|
|
557
557
|
#
|
|
558
558
|
# Returns a list of all positions in the specified account.
|
|
559
559
|
#
|
|
560
|
-
# The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
560
|
+
# The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
561
561
|
#
|
|
562
562
|
# **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change.
|
|
563
563
|
#
|
|
564
|
-
# Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
564
|
+
# Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
565
565
|
#
|
|
566
566
|
# 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.
|
|
567
567
|
#
|
|
@@ -574,7 +574,7 @@ module SnapTrade
|
|
|
574
574
|
end
|
|
575
575
|
|
|
576
576
|
# List all account positions
|
|
577
|
-
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
577
|
+
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
578
578
|
# @param user_id [String]
|
|
579
579
|
# @param user_secret [String]
|
|
580
580
|
# @param account_id [String]
|
|
@@ -586,7 +586,7 @@ module SnapTrade
|
|
|
586
586
|
end
|
|
587
587
|
|
|
588
588
|
# List all account positions
|
|
589
|
-
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
589
|
+
# Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
590
590
|
# @param user_id [String]
|
|
591
591
|
# @param user_secret [String]
|
|
592
592
|
# @param account_id [String]
|
|
@@ -384,6 +384,134 @@ module SnapTrade
|
|
|
384
384
|
end
|
|
385
385
|
|
|
386
386
|
|
|
387
|
+
# List all account recent orders (last 24 hours only)
|
|
388
|
+
#
|
|
389
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
390
|
+
# 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.
|
|
391
|
+
# Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days.
|
|
392
|
+
# By default only returns executed orders, but that can be changed by setting *only_executed* to false.
|
|
393
|
+
#
|
|
394
|
+
# Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request.
|
|
395
|
+
#
|
|
396
|
+
# **Experimental:** this endpoint may change without notice.
|
|
397
|
+
#
|
|
398
|
+
# **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)**
|
|
399
|
+
#
|
|
400
|
+
# @param user_id [String]
|
|
401
|
+
# @param user_secret [String]
|
|
402
|
+
# @param account_id [String]
|
|
403
|
+
# @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
404
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
405
|
+
def get_all_account_recent_orders(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
|
|
406
|
+
extra[:only_executed] = only_executed if only_executed != SENTINEL
|
|
407
|
+
data, _status_code, _headers = get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
408
|
+
data
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# List all account recent orders (last 24 hours only)
|
|
412
|
+
#
|
|
413
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
414
|
+
# 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.
|
|
415
|
+
# Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days.
|
|
416
|
+
# By default only returns executed orders, but that can be changed by setting *only_executed* to false.
|
|
417
|
+
#
|
|
418
|
+
# Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request.
|
|
419
|
+
#
|
|
420
|
+
# **Experimental:** this endpoint may change without notice.
|
|
421
|
+
#
|
|
422
|
+
# **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)**
|
|
423
|
+
#
|
|
424
|
+
# @param user_id [String]
|
|
425
|
+
# @param user_secret [String]
|
|
426
|
+
# @param account_id [String]
|
|
427
|
+
# @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
428
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
429
|
+
def get_all_account_recent_orders_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
|
|
430
|
+
extra[:only_executed] = only_executed if only_executed != SENTINEL
|
|
431
|
+
get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# List all account recent orders (last 24 hours only)
|
|
435
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. 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. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **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)**
|
|
436
|
+
# @param user_id [String]
|
|
437
|
+
# @param user_secret [String]
|
|
438
|
+
# @param account_id [String]
|
|
439
|
+
# @param [Hash] opts the optional parameters
|
|
440
|
+
# @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
441
|
+
# @return [AllAccountOrdersResponse]
|
|
442
|
+
private def get_all_account_recent_orders_impl(user_id, user_secret, account_id, opts = {})
|
|
443
|
+
data, _status_code, _headers = get_all_account_recent_orders_with_http_info(user_id, user_secret, account_id, opts)
|
|
444
|
+
data
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
# List all account recent orders (last 24 hours only)
|
|
448
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. 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. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **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)**
|
|
449
|
+
# @param user_id [String]
|
|
450
|
+
# @param user_secret [String]
|
|
451
|
+
# @param account_id [String]
|
|
452
|
+
# @param [Hash] opts the optional parameters
|
|
453
|
+
# @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
454
|
+
# @return [Array<(AllAccountOrdersResponse, Integer, Hash)>] AllAccountOrdersResponse data, response status code and response headers
|
|
455
|
+
private def get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
456
|
+
if @api_client.config.debugging
|
|
457
|
+
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_all_account_recent_orders ...'
|
|
458
|
+
end
|
|
459
|
+
# verify the required parameter 'user_id' is set
|
|
460
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
461
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
|
|
462
|
+
end
|
|
463
|
+
# verify the required parameter 'user_secret' is set
|
|
464
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
465
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
|
|
466
|
+
end
|
|
467
|
+
# verify the required parameter 'account_id' is set
|
|
468
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
469
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
|
|
470
|
+
end
|
|
471
|
+
# resource path
|
|
472
|
+
local_var_path = '/accounts/{accountId}/orders/recent'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
473
|
+
|
|
474
|
+
# query parameters
|
|
475
|
+
query_params = opts[:query_params] || {}
|
|
476
|
+
query_params[:'userId'] = user_id
|
|
477
|
+
query_params[:'userSecret'] = user_secret
|
|
478
|
+
query_params[:'only_executed'] = opts[:'only_executed'] if !opts[:'only_executed'].nil?
|
|
479
|
+
|
|
480
|
+
# header parameters
|
|
481
|
+
header_params = opts[:header_params] || {}
|
|
482
|
+
# HTTP header 'Accept' (if needed)
|
|
483
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
484
|
+
|
|
485
|
+
# form parameters
|
|
486
|
+
form_params = opts[:form_params] || {}
|
|
487
|
+
|
|
488
|
+
# http body (model)
|
|
489
|
+
post_body = opts[:debug_body]
|
|
490
|
+
|
|
491
|
+
# return_type
|
|
492
|
+
return_type = opts[:debug_return_type] || 'AllAccountOrdersResponse'
|
|
493
|
+
|
|
494
|
+
# auth_names
|
|
495
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
496
|
+
|
|
497
|
+
new_options = opts.merge(
|
|
498
|
+
:operation => :"ExperimentalEndpointsApi.get_all_account_recent_orders",
|
|
499
|
+
:header_params => header_params,
|
|
500
|
+
:query_params => query_params,
|
|
501
|
+
:form_params => form_params,
|
|
502
|
+
:body => post_body,
|
|
503
|
+
:auth_names => auth_names,
|
|
504
|
+
:return_type => return_type
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
508
|
+
if @api_client.config.debugging
|
|
509
|
+
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_all_account_recent_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
510
|
+
end
|
|
511
|
+
return data, status_code, headers, response
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
|
|
387
515
|
# Get account order detail (V2)
|
|
388
516
|
#
|
|
389
517
|
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -30,7 +30,7 @@ module SnapTrade
|
|
|
30
30
|
# Present for mutual fund positions and for other instrument kinds when true. A true value means the position is also counted in cash balance or buying power.
|
|
31
31
|
attr_accessor :cash_equivalent
|
|
32
32
|
|
|
33
|
-
# List of tax lots for the given position. Disabled by default; enable via the Customer Dashboard Add-ons page. When enabled, this field is included for security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`). For these positions, an empty list means no tax lot data is available. Availability varies by brokerage and position. This field is omitted for options, futures, future options, CFDs, tokenized assets, and cash, or when the feature is disabled.
|
|
33
|
+
# List of tax lots for the given position. Disabled by default; enable via the Customer Dashboard Add-ons page. When enabled, this field is included for security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`). For these positions, an empty list means no tax lot data is available. Availability varies by brokerage and position. This field is omitted for options, futures, future options, CFDs, tokenized assets, and cash, or when the feature is disabled.
|
|
34
34
|
attr_accessor :tax_lots
|
|
35
35
|
|
|
36
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
#
|
|
14
|
+
# A list of account orders together with the freshness of the returned data.
|
|
15
15
|
class AllAccountOrdersResponse
|
|
16
16
|
# Orders returned for the request.
|
|
17
17
|
attr_accessor :results
|
|
@@ -28,6 +28,7 @@ module SnapTrade
|
|
|
28
28
|
:'MutualFundInstrument',
|
|
29
29
|
:'OptionInstrument',
|
|
30
30
|
:'OtherInstrument',
|
|
31
|
+
:'PreferredStockInstrument',
|
|
31
32
|
:'StockInstrument',
|
|
32
33
|
:'TokenizedAssetInstrument'
|
|
33
34
|
]
|
|
@@ -53,6 +54,7 @@ module SnapTrade
|
|
|
53
54
|
:'mutualfund' => :'MutualFundInstrument',
|
|
54
55
|
:'option' => :'OptionInstrument',
|
|
55
56
|
:'other' => :'OtherInstrument',
|
|
57
|
+
:'preferred_stock' => :'PreferredStockInstrument',
|
|
56
58
|
:'stock' => :'StockInstrument',
|
|
57
59
|
:'tokenized_asset' => :'TokenizedAssetInstrument'
|
|
58
60
|
}
|