snaptrade 2.0.158 → 2.0.160

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 208d96ea14724d70f6f3590b860441bd35d0e07701eeaec581d0b1b50f6982a3
4
- data.tar.gz: 16f0414d1fc302d6cfcca6bdb76a6ae4a5663602e616ee836293bc50c289e717
3
+ metadata.gz: 39abef0a80a05056e6158a4188f33e2fdaff4fba0e1d2df65e8a0ac813547676
4
+ data.tar.gz: c972f3c93167a4380b19db8012a459afb4d2b04d007f7db1b7753dd8a2549d9f
5
5
  SHA512:
6
- metadata.gz: 1767861bac2258021f487181e064394307103ed53c910ef16e025e9b1de0a4598befa2865b96fd9ef6decd5cd88b0c2302d0e025e476b27ae16bd7f4040afd53
7
- data.tar.gz: 52187c8f7505fe08495fe592a1a32a3c7793d0d0efb163cf3d5e91127ab5f44530bfe367e41f956597df8a22188fb3b089051872e8505807e64631d3b9c2597b
6
+ metadata.gz: cba00b1bdbf83f0eab2124b8694ac57387937a9e71a2e611b96bd4b3d16d2ef512338982371ac54ba4e016b59cd08a03cf723d591c2f2f3c8d8e7637436f4902
7
+ data.tar.gz: 8157df2d2e6eef61236ad1d2105cda161064ad4661828648992dba12c524f4a092f531a54a7876eabcc7aae35b4024eb4a1dee5e27a58b816cb4ef33a251b99e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.158)
4
+ snaptrade (2.0.160)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -58,7 +58,7 @@ GEM
58
58
  rspec-mocks (3.13.7)
59
59
  diff-lcs (>= 1.2.0, < 2.0)
60
60
  rspec-support (~> 3.13.0)
61
- rspec-support (3.13.6)
61
+ rspec-support (3.13.7)
62
62
  rubocop (1.12.1)
63
63
  parallel (~> 1.10)
64
64
  parser (>= 3.0.0.0)
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.158-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.158)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.160-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.160)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -44,6 +44,7 @@ Connect brokerage accounts to your app for live positions and trading
44
44
  * [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
45
45
  * [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
46
46
  * [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
47
+ * [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
47
48
  * [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
48
49
  * [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
49
50
  * [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain)
@@ -83,7 +84,7 @@ Connect brokerage accounts to your app for live positions and trading
83
84
  Add to Gemfile:
84
85
 
85
86
  ```ruby
86
- gem 'snaptrade', '~> 2.0.158'
87
+ gem 'snaptrade', '~> 2.0.160'
87
88
  ```
88
89
 
89
90
  ## Getting Started<a id="getting-started"></a>
@@ -467,9 +468,9 @@ p result
467
468
 
468
469
  ### `snaptrade.account_information.get_user_account_recent_orders`<a id="snaptradeaccount_informationget_user_account_recent_orders"></a>
469
470
 
470
- A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account.
471
+ A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
471
472
  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
472
- Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days
473
+ Differs from /orders in that it is always realtime, and only checks the last 24 hours
473
474
  By default only returns executed orders, but that can be changed by setting *only_executed* to false
474
475
 
475
476
 
@@ -1128,6 +1129,52 @@ specific users
1128
1129
  ---
1129
1130
 
1130
1131
 
1132
+ ### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
1133
+
1134
+ Returns the detail of a single order using the external order ID provided in the request body.
1135
+
1136
+ The V2 order response format includes all legs of the order in the `legs` list field.
1137
+ If the order is single legged, `legs` will be a list of one leg.
1138
+
1139
+ This endpoint is always realtime and does not rely on cached data.
1140
+
1141
+ This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
1142
+
1143
+
1144
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1145
+
1146
+ ```ruby
1147
+ result = snaptrade.experimental_endpoints.get_user_account_order_detail_v2(
1148
+ brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
1149
+ account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1150
+ user_id: "snaptrade-user-123",
1151
+ user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1152
+ )
1153
+ p result
1154
+ ```
1155
+
1156
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1157
+
1158
+ ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
1159
+ Order ID returned by brokerage. This is the unique identifier for the order in
1160
+ the brokerage system.
1161
+
1162
+ ##### account_id: `String`<a id="account_id-string"></a>
1163
+ ##### user_id: `String`<a id="user_id-string"></a>
1164
+ ##### user_secret: `String`<a id="user_secret-string"></a>
1165
+ #### 🔄 Return<a id="🔄-return"></a>
1166
+
1167
+ [AccountOrderRecordV2](./lib/snaptrade/models/account_order_record_v2.rb)
1168
+
1169
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1170
+
1171
+ `/accounts/{accountId}/orders/details/v2` `POST`
1172
+
1173
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1174
+
1175
+ ---
1176
+
1177
+
1131
1178
  ### `snaptrade.experimental_endpoints.get_user_account_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_orders_v2"></a>
1132
1179
 
1133
1180
  Returns a list of recent orders in the specified account.
@@ -907,9 +907,9 @@ module SnapTrade
907
907
 
908
908
  # List account recent orders (last 24 hours only)
909
909
  #
910
- # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account.
910
+ # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
911
911
  # 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
912
- # Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days
912
+ # Differs from /orders in that it is always realtime, and only checks the last 24 hours
913
913
  # By default only returns executed orders, but that can be changed by setting *only_executed* to false
914
914
  #
915
915
  # @param user_id [String]
@@ -925,9 +925,9 @@ module SnapTrade
925
925
 
926
926
  # List account recent orders (last 24 hours only)
927
927
  #
928
- # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account.
928
+ # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
929
929
  # 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
930
- # Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days
930
+ # Differs from /orders in that it is always realtime, and only checks the last 24 hours
931
931
  # By default only returns executed orders, but that can be changed by setting *only_executed* to false
932
932
  #
933
933
  # @param user_id [String]
@@ -941,7 +941,7 @@ module SnapTrade
941
941
  end
942
942
 
943
943
  # List account recent orders (last 24 hours only)
944
- # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account. 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 /orders in that it is 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
944
+ # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. 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 /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
945
945
  # @param user_id [String]
946
946
  # @param user_secret [String]
947
947
  # @param account_id [String]
@@ -954,7 +954,7 @@ module SnapTrade
954
954
  end
955
955
 
956
956
  # List account recent orders (last 24 hours only)
957
- # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account. 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 /orders in that it is 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
957
+ # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. 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 /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
958
958
  # @param user_id [String]
959
959
  # @param user_secret [String]
960
960
  # @param account_id [String]
@@ -17,6 +17,144 @@ module SnapTrade
17
17
  @api_client = api_client
18
18
  end
19
19
 
20
+ # Get account order detail (V2)
21
+ #
22
+ # Returns the detail of a single order using the external order ID provided in the request body.
23
+ #
24
+ # The V2 order response format includes all legs of the order in the `legs` list field.
25
+ # If the order is single legged, `legs` will be a list of one leg.
26
+ #
27
+ # This endpoint is always realtime and does not rely on cached data.
28
+ #
29
+ # This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
30
+ #
31
+ # @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
32
+ # @param account_id [String]
33
+ # @param user_id [String]
34
+ # @param user_secret [String]
35
+ # @param body [AccountInformationGetUserAccountOrderDetailRequest]
36
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
37
+ def get_user_account_order_detail_v2(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
38
+ _body = {}
39
+ _body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
40
+ account_information_get_user_account_order_detail_request = _body
41
+ data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
42
+ data
43
+ end
44
+
45
+ # Get account order detail (V2)
46
+ #
47
+ # Returns the detail of a single order using the external order ID provided in the request body.
48
+ #
49
+ # The V2 order response format includes all legs of the order in the `legs` list field.
50
+ # If the order is single legged, `legs` will be a list of one leg.
51
+ #
52
+ # This endpoint is always realtime and does not rely on cached data.
53
+ #
54
+ # This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
55
+ #
56
+ # @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
57
+ # @param account_id [String]
58
+ # @param user_id [String]
59
+ # @param user_secret [String]
60
+ # @param body [AccountInformationGetUserAccountOrderDetailRequest]
61
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
62
+ def get_user_account_order_detail_v2_with_http_info(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
63
+ _body = {}
64
+ _body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
65
+ account_information_get_user_account_order_detail_request = _body
66
+ get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
67
+ end
68
+
69
+ # Get account order detail (V2)
70
+ # Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
71
+ # @param account_id [String]
72
+ # @param user_id [String]
73
+ # @param user_secret [String]
74
+ # @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [AccountOrderRecordV2]
77
+ private def get_user_account_order_detail_v2_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts = {})
78
+ data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts)
79
+ data
80
+ end
81
+
82
+ # Get account order detail (V2)
83
+ # Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the &#x60;legs&#x60; list field. If the order is single legged, &#x60;legs&#x60; will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
84
+ # @param account_id [String]
85
+ # @param user_id [String]
86
+ # @param user_secret [String]
87
+ # @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [Array<(AccountOrderRecordV2, Integer, Hash)>] AccountOrderRecordV2 data, response status code and response headers
90
+ private def get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts = {})
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_user_account_order_detail_v2 ...'
93
+ end
94
+ # verify the required parameter 'account_id' is set
95
+ if @api_client.config.client_side_validation && account_id.nil?
96
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
97
+ end
98
+ # verify the required parameter 'user_id' is set
99
+ if @api_client.config.client_side_validation && user_id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
101
+ end
102
+ # verify the required parameter 'user_secret' is set
103
+ if @api_client.config.client_side_validation && user_secret.nil?
104
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
105
+ end
106
+ # verify the required parameter 'account_information_get_user_account_order_detail_request' is set
107
+ if @api_client.config.client_side_validation && account_information_get_user_account_order_detail_request.nil?
108
+ fail ArgumentError, "Missing the required parameter 'account_information_get_user_account_order_detail_request' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
109
+ end
110
+ # resource path
111
+ local_var_path = '/accounts/{accountId}/orders/details/v2'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+ query_params[:'userId'] = user_id
116
+ query_params[:'userSecret'] = user_secret
117
+
118
+ # header parameters
119
+ header_params = opts[:header_params] || {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
122
+ # HTTP header 'Content-Type'
123
+ content_type = @api_client.select_header_content_type(['application/json'])
124
+ if !content_type.nil?
125
+ header_params['Content-Type'] = content_type
126
+ end
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(account_information_get_user_account_order_detail_request)
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type] || 'AccountOrderRecordV2'
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
139
+
140
+ new_options = opts.merge(
141
+ :operation => :"ExperimentalEndpointsApi.get_user_account_order_detail_v2",
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type
148
+ )
149
+
150
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_user_account_order_detail_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers, response
155
+ end
156
+
157
+
20
158
  # List account orders v2
21
159
  #
22
160
  # Returns a list of recent orders in the specified account.
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.158'
11
+ VERSION = '2.0.160'
12
12
  end
@@ -135,7 +135,7 @@ describe 'AccountInformationApi' do
135
135
 
136
136
  # unit tests for get_user_account_recent_orders
137
137
  # List account recent orders (last 24 hours only)
138
- # A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account. 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 /orders in that it is 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
138
+ # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. 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 /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
139
139
  # @param user_id
140
140
  # @param user_secret
141
141
  # @param account_id
@@ -27,6 +27,21 @@ describe 'ExperimentalEndpointsApi' do
27
27
  end
28
28
  end
29
29
 
30
+ # unit tests for get_user_account_order_detail_v2
31
+ # Get account order detail (V2)
32
+ # Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the &#x60;legs&#x60; list field. If the order is single legged, &#x60;legs&#x60; will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
33
+ # @param account_id
34
+ # @param user_id
35
+ # @param user_secret
36
+ # @param account_information_get_user_account_order_detail_request
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [AccountOrderRecordV2]
39
+ describe 'get_user_account_order_detail_v2 test' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
30
45
  # unit tests for get_user_account_orders_v2
31
46
  # List account orders v2
32
47
  # Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the &#x60;legs&#x60; list field. If the order is single legged, &#x60;legs&#x60; will be a list of one leg. 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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.158
4
+ version: 2.0.160
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-27 00:00:00.000000000 Z
11
+ date: 2026-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday