snaptrade 2.0.37 → 2.0.39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +115 -77
  4. data/lib/snaptrade/api/account_information_api.rb +4 -4
  5. data/lib/snaptrade/api/authentication_api.rb +4 -4
  6. data/lib/snaptrade/api/connections_api.rb +70 -52
  7. data/lib/snaptrade/api/options_api.rb +4 -4
  8. data/lib/snaptrade/api/trading_api.rb +106 -106
  9. data/lib/snaptrade/models/account.rb +2 -2
  10. data/lib/snaptrade/models/brokerage.rb +25 -40
  11. data/lib/snaptrade/models/brokerage_authorization.rb +12 -8
  12. data/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb +1 -0
  13. data/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb +1 -0
  14. data/lib/snaptrade/models/brokerage_type.rb +1 -1
  15. data/lib/snaptrade/models/manual_trade.rb +7 -5
  16. data/lib/snaptrade/models/manual_trade_and_impact.rb +2 -2
  17. data/lib/snaptrade/models/manual_trade_balance.rb +3 -3
  18. data/lib/snaptrade/models/manual_trade_form.rb +52 -25
  19. data/lib/snaptrade/models/manual_trade_impact.rb +260 -0
  20. data/lib/snaptrade/models/manual_trade_symbol.rb +6 -1
  21. data/lib/snaptrade/models/notional_value.rb +1 -1
  22. data/lib/snaptrade/models/options_place_option_strategy_request.rb +2 -2
  23. data/lib/snaptrade/models/symbols_quotes_inner.rb +15 -10
  24. data/lib/snaptrade/models/trading_cancel_user_account_order_request.rb +1 -0
  25. data/lib/snaptrade/models/validated_trade_body.rb +1 -2
  26. data/lib/snaptrade/version.rb +1 -1
  27. data/lib/snaptrade.rb +1 -0
  28. data/spec/api/account_information_api_spec.rb +1 -1
  29. data/spec/api/authentication_api_spec.rb +1 -1
  30. data/spec/api/connections_api_spec.rb +13 -13
  31. data/spec/api/trading_api_spec.rb +15 -15
  32. data/spec/models/brokerage_spec.rb +6 -24
  33. data/spec/models/manual_trade_form_spec.rb +6 -6
  34. data/spec/models/manual_trade_impact_spec.rb +53 -0
  35. data/spec/models/symbols_quotes_inner_spec.rb +3 -3
  36. metadata +5 -2
@@ -17,15 +17,14 @@ module SnapTrade
17
17
  @api_client = api_client
18
18
  end
19
19
 
20
- # Cancel open order in account
20
+ # Cancel order
21
21
  #
22
- # Sends a signal to the brokerage to cancel the specified order.
23
- # This will only work if the order has not yet been executed.
22
+ # Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
24
23
  #
25
24
  # @param user_id [String]
26
25
  # @param user_secret [String]
27
- # @param account_id [String] The ID of the account to cancel the order in.
28
- # @param brokerage_order_id [String]
26
+ # @param account_id [String]
27
+ # @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
29
28
  # @param body [TradingCancelUserAccountOrderRequest]
30
29
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
31
30
  def cancel_user_account_order(user_id:, user_secret:, account_id:, brokerage_order_id: SENTINEL, extra: {})
@@ -36,15 +35,14 @@ module SnapTrade
36
35
  data
37
36
  end
38
37
 
39
- # Cancel open order in account
38
+ # Cancel order
40
39
  #
41
- # Sends a signal to the brokerage to cancel the specified order.
42
- # This will only work if the order has not yet been executed.
40
+ # Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
43
41
  #
44
42
  # @param user_id [String]
45
43
  # @param user_secret [String]
46
- # @param account_id [String] The ID of the account to cancel the order in.
47
- # @param brokerage_order_id [String]
44
+ # @param account_id [String]
45
+ # @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
48
46
  # @param body [TradingCancelUserAccountOrderRequest]
49
47
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
50
48
  def cancel_user_account_order_with_http_info(user_id:, user_secret:, account_id:, brokerage_order_id: SENTINEL, extra: {})
@@ -54,12 +52,12 @@ module SnapTrade
54
52
  cancel_user_account_order_with_http_info_impl(user_id, user_secret, account_id, trading_cancel_user_account_order_request, extra)
55
53
  end
56
54
 
57
- # Cancel open order in account
58
- # Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed.
55
+ # Cancel order
56
+ # Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
59
57
  # @param user_id [String]
60
58
  # @param user_secret [String]
61
- # @param account_id [String] The ID of the account to cancel the order in.
62
- # @param trading_cancel_user_account_order_request [TradingCancelUserAccountOrderRequest] The Order ID to be canceled
59
+ # @param account_id [String]
60
+ # @param trading_cancel_user_account_order_request [TradingCancelUserAccountOrderRequest]
63
61
  # @param [Hash] opts the optional parameters
64
62
  # @return [AccountOrderRecord]
65
63
  private def cancel_user_account_order_impl(user_id, user_secret, account_id, trading_cancel_user_account_order_request, opts = {})
@@ -67,12 +65,12 @@ module SnapTrade
67
65
  data
68
66
  end
69
67
 
70
- # Cancel open order in account
71
- # Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed.
68
+ # Cancel order
69
+ # Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
72
70
  # @param user_id [String]
73
71
  # @param user_secret [String]
74
- # @param account_id [String] The ID of the account to cancel the order in.
75
- # @param trading_cancel_user_account_order_request [TradingCancelUserAccountOrderRequest] The Order ID to be canceled
72
+ # @param account_id [String]
73
+ # @param trading_cancel_user_account_order_request [TradingCancelUserAccountOrderRequest]
76
74
  # @param [Hash] opts the optional parameters
77
75
  # @return [Array<(AccountOrderRecord, Integer, Hash)>] AccountOrderRecord data, response status code and response headers
78
76
  private def cancel_user_account_order_with_http_info_impl(user_id, user_secret, account_id, trading_cancel_user_account_order_request, opts = {})
@@ -143,73 +141,73 @@ module SnapTrade
143
141
  end
144
142
 
145
143
 
146
- # Check the impact of a trade on an account
144
+ # Check order impact
147
145
  #
148
- # Return the trade object and it's impact on the account for the specified order.
146
+ # Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
149
147
  #
148
+ # @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
149
+ # @param action [ActionStrict] The action describes the intent or side of a trade. This is either `BUY` or `SELL`
150
+ # @param universal_symbol_id [String] Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
151
+ # @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
152
+ # @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
150
153
  # @param user_id [String]
151
154
  # @param user_secret [String]
152
- # @param account_id [String]
153
- # @param action [ActionStrict] Trade Action
154
- # @param order_type [OrderTypeStrict] Order Type
155
- # @param price [Float] Trade Price if limit or stop limit order
156
- # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
157
- # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled
155
+ # @param price [Float] The limit price for `Limit` and `StopLimit` orders.
156
+ # @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
158
157
  # @param units [Float]
159
- # @param universal_symbol_id [String]
160
158
  # @param notional_value [ManualTradeFormNotionalValue]
161
159
  # @param body [ManualTradeForm]
162
160
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
163
- def get_order_impact(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
161
+ def get_order_impact(account_id:, action:, universal_symbol_id:, order_type:, time_in_force:, user_id:, user_secret:, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
164
162
  _body = {}
165
163
  _body[:account_id] = account_id if account_id != SENTINEL
166
164
  _body[:action] = action if action != SENTINEL
165
+ _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
167
166
  _body[:order_type] = order_type if order_type != SENTINEL
167
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
168
168
  _body[:price] = price if price != SENTINEL
169
169
  _body[:stop] = stop if stop != SENTINEL
170
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
171
170
  _body[:units] = units if units != SENTINEL
172
- _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
173
171
  _body[:notional_value] = notional_value if notional_value != SENTINEL
174
172
  manual_trade_form = _body
175
173
  data, _status_code, _headers = get_order_impact_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
176
174
  data
177
175
  end
178
176
 
179
- # Check the impact of a trade on an account
177
+ # Check order impact
180
178
  #
181
- # Return the trade object and it's impact on the account for the specified order.
179
+ # Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
182
180
  #
181
+ # @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
182
+ # @param action [ActionStrict] The action describes the intent or side of a trade. This is either `BUY` or `SELL`
183
+ # @param universal_symbol_id [String] Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
184
+ # @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
185
+ # @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
183
186
  # @param user_id [String]
184
187
  # @param user_secret [String]
185
- # @param account_id [String]
186
- # @param action [ActionStrict] Trade Action
187
- # @param order_type [OrderTypeStrict] Order Type
188
- # @param price [Float] Trade Price if limit or stop limit order
189
- # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
190
- # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled
188
+ # @param price [Float] The limit price for `Limit` and `StopLimit` orders.
189
+ # @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
191
190
  # @param units [Float]
192
- # @param universal_symbol_id [String]
193
191
  # @param notional_value [ManualTradeFormNotionalValue]
194
192
  # @param body [ManualTradeForm]
195
193
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
196
- def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
194
+ def get_order_impact_with_http_info(account_id:, action:, universal_symbol_id:, order_type:, time_in_force:, user_id:, user_secret:, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
197
195
  _body = {}
198
196
  _body[:account_id] = account_id if account_id != SENTINEL
199
197
  _body[:action] = action if action != SENTINEL
198
+ _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
200
199
  _body[:order_type] = order_type if order_type != SENTINEL
200
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
201
201
  _body[:price] = price if price != SENTINEL
202
202
  _body[:stop] = stop if stop != SENTINEL
203
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
204
203
  _body[:units] = units if units != SENTINEL
205
- _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
206
204
  _body[:notional_value] = notional_value if notional_value != SENTINEL
207
205
  manual_trade_form = _body
208
206
  get_order_impact_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
209
207
  end
210
208
 
211
- # Check the impact of a trade on an account
212
- # Return the trade object and it's impact on the account for the specified order.
209
+ # Check order impact
210
+ # Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
213
211
  # @param user_id [String]
214
212
  # @param user_secret [String]
215
213
  # @param manual_trade_form [ManualTradeForm]
@@ -220,8 +218,8 @@ module SnapTrade
220
218
  data
221
219
  end
222
220
 
223
- # Check the impact of a trade on an account
224
- # Return the trade object and it&#39;s impact on the account for the specified order.
221
+ # Check order impact
222
+ # Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a &#x60;Trade&#x60; object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the &#x60;Trade&#x60; object returned expires after 5 minutes. Any order placed using an expired &#x60;Trade&#x60; will be rejected.
225
223
  # @param user_id [String]
226
224
  # @param user_secret [String]
227
225
  # @param manual_trade_form [ManualTradeForm]
@@ -293,13 +291,13 @@ module SnapTrade
293
291
 
294
292
  # Get symbol quotes
295
293
  #
296
- # Returns quote(s) from the brokerage for the specified symbol(s).
294
+ # Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
297
295
  #
298
296
  # @param user_id [String]
299
297
  # @param user_secret [String]
300
- # @param symbols [String] List of universal_symbol_id or tickers to get quotes for.
301
- # @param account_id [String] The ID of the account to get quotes.
302
- # @param use_ticker [Boolean] Should be set to True if providing tickers.
298
+ # @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for.
299
+ # @param account_id [String]
300
+ # @param use_ticker [Boolean] Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
303
301
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
304
302
  def get_user_account_quotes(user_id:, user_secret:, symbols:, account_id:, use_ticker: SENTINEL, extra: {})
305
303
  extra[:use_ticker] = use_ticker if use_ticker != SENTINEL
@@ -309,13 +307,13 @@ module SnapTrade
309
307
 
310
308
  # Get symbol quotes
311
309
  #
312
- # Returns quote(s) from the brokerage for the specified symbol(s).
310
+ # Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
313
311
  #
314
312
  # @param user_id [String]
315
313
  # @param user_secret [String]
316
- # @param symbols [String] List of universal_symbol_id or tickers to get quotes for.
317
- # @param account_id [String] The ID of the account to get quotes.
318
- # @param use_ticker [Boolean] Should be set to True if providing tickers.
314
+ # @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for.
315
+ # @param account_id [String]
316
+ # @param use_ticker [Boolean] Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
319
317
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
320
318
  def get_user_account_quotes_with_http_info(user_id:, user_secret:, symbols:, account_id:, use_ticker: SENTINEL, extra: {})
321
319
  extra[:use_ticker] = use_ticker if use_ticker != SENTINEL
@@ -323,13 +321,13 @@ module SnapTrade
323
321
  end
324
322
 
325
323
  # Get symbol quotes
326
- # Returns quote(s) from the brokerage for the specified symbol(s).
324
+ # Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
327
325
  # @param user_id [String]
328
326
  # @param user_secret [String]
329
- # @param symbols [String] List of universal_symbol_id or tickers to get quotes for.
330
- # @param account_id [String] The ID of the account to get quotes.
327
+ # @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for.
328
+ # @param account_id [String]
331
329
  # @param [Hash] opts the optional parameters
332
- # @option opts [Boolean] :use_ticker Should be set to True if providing tickers.
330
+ # @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
333
331
  # @return [Array<SymbolsQuotesInner>]
334
332
  private def get_user_account_quotes_impl(user_id, user_secret, symbols, account_id, opts = {})
335
333
  data, _status_code, _headers = get_user_account_quotes_with_http_info(user_id, user_secret, symbols, account_id, opts)
@@ -337,13 +335,13 @@ module SnapTrade
337
335
  end
338
336
 
339
337
  # Get symbol quotes
340
- # Returns quote(s) from the brokerage for the specified symbol(s).
338
+ # Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
341
339
  # @param user_id [String]
342
340
  # @param user_secret [String]
343
- # @param symbols [String] List of universal_symbol_id or tickers to get quotes for.
344
- # @param account_id [String] The ID of the account to get quotes.
341
+ # @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for.
342
+ # @param account_id [String]
345
343
  # @param [Hash] opts the optional parameters
346
- # @option opts [Boolean] :use_ticker Should be set to True if providing tickers.
344
+ # @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
347
345
  # @return [Array<(Array<SymbolsQuotesInner>, Integer, Hash)>] Array<SymbolsQuotesInner> data, response status code and response headers
348
346
  private def get_user_account_quotes_with_http_info_impl(user_id, user_secret, symbols, account_id, opts = {})
349
347
  if @api_client.config.debugging
@@ -410,73 +408,77 @@ module SnapTrade
410
408
  end
411
409
 
412
410
 
413
- # Place a trade with NO validation.
411
+ # Place order
414
412
  #
415
- # Places a specified trade in the specified account.
413
+ # Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
414
+ #
415
+ # This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
416
416
  #
417
+ # @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
418
+ # @param action [ActionStrict] The action describes the intent or side of a trade. This is either `BUY` or `SELL`
419
+ # @param universal_symbol_id [String] Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
420
+ # @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
421
+ # @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
417
422
  # @param user_id [String]
418
423
  # @param user_secret [String]
419
- # @param account_id [String]
420
- # @param action [ActionStrict] Trade Action
421
- # @param order_type [OrderTypeStrict] Order Type
422
- # @param price [Float] Trade Price if limit or stop limit order
423
- # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
424
- # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled
424
+ # @param price [Float] The limit price for `Limit` and `StopLimit` orders.
425
+ # @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
425
426
  # @param units [Float]
426
- # @param universal_symbol_id [String]
427
427
  # @param notional_value [ManualTradeFormNotionalValue]
428
428
  # @param body [ManualTradeForm]
429
429
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
430
- def place_force_order(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
430
+ def place_force_order(account_id:, action:, universal_symbol_id:, order_type:, time_in_force:, user_id:, user_secret:, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
431
431
  _body = {}
432
432
  _body[:account_id] = account_id if account_id != SENTINEL
433
433
  _body[:action] = action if action != SENTINEL
434
+ _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
434
435
  _body[:order_type] = order_type if order_type != SENTINEL
436
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
435
437
  _body[:price] = price if price != SENTINEL
436
438
  _body[:stop] = stop if stop != SENTINEL
437
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
438
439
  _body[:units] = units if units != SENTINEL
439
- _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
440
440
  _body[:notional_value] = notional_value if notional_value != SENTINEL
441
441
  manual_trade_form = _body
442
442
  data, _status_code, _headers = place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
443
443
  data
444
444
  end
445
445
 
446
- # Place a trade with NO validation.
446
+ # Place order
447
447
  #
448
- # Places a specified trade in the specified account.
448
+ # Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
449
+ #
450
+ # This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
449
451
  #
452
+ # @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
453
+ # @param action [ActionStrict] The action describes the intent or side of a trade. This is either `BUY` or `SELL`
454
+ # @param universal_symbol_id [String] Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
455
+ # @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
456
+ # @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
450
457
  # @param user_id [String]
451
458
  # @param user_secret [String]
452
- # @param account_id [String]
453
- # @param action [ActionStrict] Trade Action
454
- # @param order_type [OrderTypeStrict] Order Type
455
- # @param price [Float] Trade Price if limit or stop limit order
456
- # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
457
- # @param time_in_force [TimeInForceStrict] Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled
459
+ # @param price [Float] The limit price for `Limit` and `StopLimit` orders.
460
+ # @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
458
461
  # @param units [Float]
459
- # @param universal_symbol_id [String]
460
462
  # @param notional_value [ManualTradeFormNotionalValue]
461
463
  # @param body [ManualTradeForm]
462
464
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
463
- def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
465
+ def place_force_order_with_http_info(account_id:, action:, universal_symbol_id:, order_type:, time_in_force:, user_id:, user_secret:, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
464
466
  _body = {}
465
467
  _body[:account_id] = account_id if account_id != SENTINEL
466
468
  _body[:action] = action if action != SENTINEL
469
+ _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
467
470
  _body[:order_type] = order_type if order_type != SENTINEL
471
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
468
472
  _body[:price] = price if price != SENTINEL
469
473
  _body[:stop] = stop if stop != SENTINEL
470
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
471
474
  _body[:units] = units if units != SENTINEL
472
- _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
473
475
  _body[:notional_value] = notional_value if notional_value != SENTINEL
474
476
  manual_trade_form = _body
475
477
  place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
476
478
  end
477
479
 
478
- # Place a trade with NO validation.
479
- # Places a specified trade in the specified account.
480
+ # Place order
481
+ # Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
480
482
  # @param user_id [String]
481
483
  # @param user_secret [String]
482
484
  # @param manual_trade_form [ManualTradeForm]
@@ -487,8 +489,8 @@ module SnapTrade
487
489
  data
488
490
  end
489
491
 
490
- # Place a trade with NO validation.
491
- # Places a specified trade in the specified account.
492
+ # Place order
493
+ # Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
492
494
  # @param user_id [String]
493
495
  # @param user_secret [String]
494
496
  # @param manual_trade_form [ManualTradeForm]
@@ -558,15 +560,14 @@ module SnapTrade
558
560
  end
559
561
 
560
562
 
561
- # Place order
563
+ # Place checked order
562
564
  #
563
- # Places the specified trade object. This places the order in the account and
564
- # returns the status of the order from the brokerage.
565
+ # Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
565
566
  #
566
- # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint
567
+ # @param trade_id [String] Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
567
568
  # @param user_id [String]
568
569
  # @param user_secret [String]
569
- # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request
570
+ # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status `PENDING` as we will not wait to check on the status before responding to the request.
570
571
  # @param body [ValidatedTradeBody]
571
572
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
572
573
  def place_order(trade_id:, user_id:, user_secret:, wait_to_confirm: SENTINEL, extra: {})
@@ -577,15 +578,14 @@ module SnapTrade
577
578
  data
578
579
  end
579
580
 
580
- # Place order
581
+ # Place checked order
581
582
  #
582
- # Places the specified trade object. This places the order in the account and
583
- # returns the status of the order from the brokerage.
583
+ # Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
584
584
  #
585
- # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint
585
+ # @param trade_id [String] Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
586
586
  # @param user_id [String]
587
587
  # @param user_secret [String]
588
- # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request
588
+ # @param wait_to_confirm [Boolean] Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status `PENDING` as we will not wait to check on the status before responding to the request.
589
589
  # @param body [ValidatedTradeBody]
590
590
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
591
591
  def place_order_with_http_info(trade_id:, user_id:, user_secret:, wait_to_confirm: SENTINEL, extra: {})
@@ -595,9 +595,9 @@ module SnapTrade
595
595
  place_order_with_http_info_impl(trade_id, user_id, user_secret, extra)
596
596
  end
597
597
 
598
- # Place order
599
- # Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage.
600
- # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint
598
+ # Place checked order
599
+ # Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
600
+ # @param trade_id [String] Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
601
601
  # @param user_id [String]
602
602
  # @param user_secret [String]
603
603
  # @param [Hash] opts the optional parameters
@@ -608,9 +608,9 @@ module SnapTrade
608
608
  data
609
609
  end
610
610
 
611
- # Place order
612
- # Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage.
613
- # @param trade_id [String] The ID of trade object obtained from trade/impact endpoint
611
+ # Place checked order
612
+ # Places the previously checked order with the brokerage. The &#x60;tradeId&#x60; is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
613
+ # @param trade_id [String] Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
614
614
  # @param user_id [String]
615
615
  # @param user_secret [String]
616
616
  # @param [Hash] opts the optional parameters
@@ -16,7 +16,7 @@ module SnapTrade
16
16
  # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade. This ID should not change for as long as the connection stays active. If the connection is deleted and re-added, a new account ID will be generated.
17
17
  attr_accessor :id
18
18
 
19
- # Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
19
+ # Unique identifier for the connection. This is the UUID used to reference the connection in SnapTrade.
20
20
  attr_accessor :brokerage_authorization
21
21
 
22
22
  # Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
@@ -34,7 +34,7 @@ module SnapTrade
34
34
  # Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the brokerage.
35
35
  attr_accessor :created_date
36
36
 
37
- # Additional information about the account, such as account type, status, etc. This information is specific to the brokerage and there's no standard format for this data. Please use at your own risk.
37
+ # Additional information about the account, such as account type, status, etc. This information is specific to the brokerage and there's no standard format for this data. This field is deprecated and subject to removal in a future version.
38
38
  attr_accessor :meta
39
39
 
40
40
  # This field is deprecated.