snaptrade 3.0.65 → 3.0.67

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.
@@ -334,6 +334,10 @@ module SnapTrade
334
334
 
335
335
  # List accounts for a connection
336
336
  #
337
+ # **Deprecated.** Use the [list accounts](/reference/Connections/Connections_listConnectionAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, line of credit, annuity, and mortgage accounts.
338
+ #
339
+ # This endpoint will return HTTP 410 Gone for all customers that sign up after December 1, 2026.
340
+ #
337
341
  # Returns all brokerage accounts that belong to the specified connection for the authenticated user.
338
342
  #
339
343
  # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.
@@ -353,6 +357,10 @@ module SnapTrade
353
357
 
354
358
  # List accounts for a connection
355
359
  #
360
+ # **Deprecated.** Use the [list accounts](/reference/Connections/Connections_listConnectionAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, line of credit, annuity, and mortgage accounts.
361
+ #
362
+ # This endpoint will return HTTP 410 Gone for all customers that sign up after December 1, 2026.
363
+ #
356
364
  # Returns all brokerage accounts that belong to the specified connection for the authenticated user.
357
365
  #
358
366
  # On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.
@@ -370,7 +378,7 @@ module SnapTrade
370
378
  end
371
379
 
372
380
  # List accounts for a connection
373
- # Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
381
+ # **Deprecated.** Use the [list accounts](/reference/Connections/Connections_listConnectionAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, line of credit, annuity, and mortgage accounts. This endpoint will return HTTP 410 Gone for all customers that sign up after December 1, 2026. Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
374
382
  # @param authorization_id [String]
375
383
  # @param user_id [String]
376
384
  # @param user_secret [String]
@@ -382,7 +390,7 @@ module SnapTrade
382
390
  end
383
391
 
384
392
  # List accounts for a connection
385
- # Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
393
+ # **Deprecated.** Use the [list accounts](/reference/Connections/Connections_listConnectionAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, line of credit, annuity, and mortgage accounts. This endpoint will return HTTP 410 Gone for all customers that sign up after December 1, 2026. Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
386
394
  # @param authorization_id [String]
387
395
  # @param user_id [String]
388
396
  # @param user_secret [String]
@@ -692,190 +692,6 @@ module SnapTrade
692
692
  end
693
693
  return data, status_code, headers, response
694
694
  end
695
-
696
-
697
- # Place a simple order (beta)
698
- #
699
- # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase.
700
- #
701
- # Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages).
702
- #
703
- # An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders.
704
- #
705
- # Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments.
706
- #
707
- # TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments.
708
- #
709
- # All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order.
710
- #
711
- # A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
712
- #
713
- # @param order_type [SimpleTradeFormOrderType]
714
- # @param time_in_force [SimpleTradeFormTimeInForce] Order duration, subject to brokerage and execution-path support. gtd requires expiry_date and a non-market single-leg equity/option order. Existing single-leg option routing does not support ioc. Futures and multi-leg orders do not support gtd through this endpoint. Webull US futures only support day and gtc. TradeStation futures and futures options accept day, gtc, ioc, and fok, subject to the contract and route's supported combinations.
715
- # @param legs [Array<SimpleTradeLeg>] Legs of one brokerage order. Use equity/option legs or future/future_option legs, without mixing the two families. Brokerage strategy and leg-count limits apply.
716
- # @param account_id [String] The ID of the account to execute the trade on.
717
- # @param user_id [String]
718
- # @param user_secret [String]
719
- # @param limit_price [Float] Required for limit and stop_limit orders, except that multi-leg price_effect even implies zero. Must be omitted or null for market and stop orders. For multi-leg orders this is the net strategy price. Negative prices are accepted only for futures-family orders, subject to brokerage support.
720
- # @param stop_price [Float] Required for stop and stop_limit orders. Must be omitted or null for market and limit orders. Must be positive for equity/option orders; futures-family trigger prices are subject to brokerage support.
721
- # @param price_effect [SimpleTradeFormPriceEffect] Only applicable to multi-leg limit and stop_limit orders. Requirements and supported values depend on the brokerage; tastytrade requires credit or debit. even implies a zero limit_price, which may be omitted and must be zero if supplied. Single-leg price effects are derived from the action.
722
- # @param client_order_id [String] Canonical UUID. Required for Wealthsimple multi-leg placement regardless of client-order-ID enablement; reuse it when retrying the same attempt. Wealthsimple multi-leg attempts retain the ID after success or failure, and reuse by the same user across accounts or placement endpoints returns 409 without another submission. A 409 does not establish whether the original attempt was accepted; reconcile it before creating a new order with a new ID. Optional for other orders, forwarded where the existing execution path supports it and for tastytrade, Webull US, and TradeStation futures-family orders. Other orders require the existing client-order-ID enablement; when disabled the value is ignored. Brokerage behavior on duplicates varies. OAuth requests also reject a client_order_id the user has already used with 409. Tastytrade uses this as external-identifier for correlation and does not deduplicate submissions. For Webull US futures, SnapTrade converts the supplied UUID (or its generated order UUID) to lowercase 32-character hexadecimal without hyphens. The original supplied UUID remains in SnapTrade's trade audit; the converted value is returned as brokerage_order_id for subsequent order reads. For TradeStation live and SIM, SnapTrade encodes the supplied UUID (or its generated order UUID) as 22-character URL-safe base64 without padding and sends it as OrderConfirmID for brokerage duplicate prevention; the response contains TradeStation's separate order ID.
723
- # @param expiry_date [Time] ISO 8601 expiry timestamp, required for gtd and invalid with other durations. A missing timezone is treated as UTC. Supported only through existing single-leg Public and Sandbox execution paths.
724
- # @param notional_value [Float] Positive order value, supported only for a single-equity market order on eligible brokerages and partners. Mutually exclusive with leg units. Omit or set units to null when supplied.
725
- # @param trading_session [SimpleTradeFormTradingSession] extended uses existing single-leg equity/option brokerage support and requires extended-hours enablement. Futures and multi-leg orders only accept regular.
726
- # @param body [SimpleTradeForm]
727
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
728
- def place_simple_order(order_type:, time_in_force:, legs:, account_id:, user_id:, user_secret:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, client_order_id: SENTINEL, expiry_date: SENTINEL, notional_value: SENTINEL, trading_session: 'regular', extra: {})
729
- _body = {}
730
- _body[:order_type] = order_type if order_type != SENTINEL
731
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
732
- _body[:legs] = legs if legs != SENTINEL
733
- _body[:limit_price] = limit_price if limit_price != SENTINEL
734
- _body[:stop_price] = stop_price if stop_price != SENTINEL
735
- _body[:price_effect] = price_effect if price_effect != SENTINEL
736
- _body[:client_order_id] = client_order_id if client_order_id != SENTINEL
737
- _body[:expiry_date] = expiry_date if expiry_date != SENTINEL
738
- _body[:notional_value] = notional_value if notional_value != SENTINEL
739
- _body[:trading_session] = trading_session if trading_session != SENTINEL
740
- simple_trade_form = _body
741
- data, _status_code, _headers = place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, extra)
742
- data
743
- end
744
-
745
- # Place a simple order (beta)
746
- #
747
- # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase.
748
- #
749
- # Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages).
750
- #
751
- # An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders.
752
- #
753
- # Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments.
754
- #
755
- # TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments.
756
- #
757
- # All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order.
758
- #
759
- # A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
760
- #
761
- # @param order_type [SimpleTradeFormOrderType]
762
- # @param time_in_force [SimpleTradeFormTimeInForce] Order duration, subject to brokerage and execution-path support. gtd requires expiry_date and a non-market single-leg equity/option order. Existing single-leg option routing does not support ioc. Futures and multi-leg orders do not support gtd through this endpoint. Webull US futures only support day and gtc. TradeStation futures and futures options accept day, gtc, ioc, and fok, subject to the contract and route's supported combinations.
763
- # @param legs [Array<SimpleTradeLeg>] Legs of one brokerage order. Use equity/option legs or future/future_option legs, without mixing the two families. Brokerage strategy and leg-count limits apply.
764
- # @param account_id [String] The ID of the account to execute the trade on.
765
- # @param user_id [String]
766
- # @param user_secret [String]
767
- # @param limit_price [Float] Required for limit and stop_limit orders, except that multi-leg price_effect even implies zero. Must be omitted or null for market and stop orders. For multi-leg orders this is the net strategy price. Negative prices are accepted only for futures-family orders, subject to brokerage support.
768
- # @param stop_price [Float] Required for stop and stop_limit orders. Must be omitted or null for market and limit orders. Must be positive for equity/option orders; futures-family trigger prices are subject to brokerage support.
769
- # @param price_effect [SimpleTradeFormPriceEffect] Only applicable to multi-leg limit and stop_limit orders. Requirements and supported values depend on the brokerage; tastytrade requires credit or debit. even implies a zero limit_price, which may be omitted and must be zero if supplied. Single-leg price effects are derived from the action.
770
- # @param client_order_id [String] Canonical UUID. Required for Wealthsimple multi-leg placement regardless of client-order-ID enablement; reuse it when retrying the same attempt. Wealthsimple multi-leg attempts retain the ID after success or failure, and reuse by the same user across accounts or placement endpoints returns 409 without another submission. A 409 does not establish whether the original attempt was accepted; reconcile it before creating a new order with a new ID. Optional for other orders, forwarded where the existing execution path supports it and for tastytrade, Webull US, and TradeStation futures-family orders. Other orders require the existing client-order-ID enablement; when disabled the value is ignored. Brokerage behavior on duplicates varies. OAuth requests also reject a client_order_id the user has already used with 409. Tastytrade uses this as external-identifier for correlation and does not deduplicate submissions. For Webull US futures, SnapTrade converts the supplied UUID (or its generated order UUID) to lowercase 32-character hexadecimal without hyphens. The original supplied UUID remains in SnapTrade's trade audit; the converted value is returned as brokerage_order_id for subsequent order reads. For TradeStation live and SIM, SnapTrade encodes the supplied UUID (or its generated order UUID) as 22-character URL-safe base64 without padding and sends it as OrderConfirmID for brokerage duplicate prevention; the response contains TradeStation's separate order ID.
771
- # @param expiry_date [Time] ISO 8601 expiry timestamp, required for gtd and invalid with other durations. A missing timezone is treated as UTC. Supported only through existing single-leg Public and Sandbox execution paths.
772
- # @param notional_value [Float] Positive order value, supported only for a single-equity market order on eligible brokerages and partners. Mutually exclusive with leg units. Omit or set units to null when supplied.
773
- # @param trading_session [SimpleTradeFormTradingSession] extended uses existing single-leg equity/option brokerage support and requires extended-hours enablement. Futures and multi-leg orders only accept regular.
774
- # @param body [SimpleTradeForm]
775
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
776
- def place_simple_order_with_http_info(order_type:, time_in_force:, legs:, account_id:, user_id:, user_secret:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, client_order_id: SENTINEL, expiry_date: SENTINEL, notional_value: SENTINEL, trading_session: 'regular', extra: {})
777
- _body = {}
778
- _body[:order_type] = order_type if order_type != SENTINEL
779
- _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
780
- _body[:legs] = legs if legs != SENTINEL
781
- _body[:limit_price] = limit_price if limit_price != SENTINEL
782
- _body[:stop_price] = stop_price if stop_price != SENTINEL
783
- _body[:price_effect] = price_effect if price_effect != SENTINEL
784
- _body[:client_order_id] = client_order_id if client_order_id != SENTINEL
785
- _body[:expiry_date] = expiry_date if expiry_date != SENTINEL
786
- _body[:notional_value] = notional_value if notional_value != SENTINEL
787
- _body[:trading_session] = trading_session if trading_session != SENTINEL
788
- simple_trade_form = _body
789
- place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, extra)
790
- end
791
-
792
- # Place a simple order (beta)
793
- # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments. TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
794
- # @param account_id [String] The ID of the account to execute the trade on.
795
- # @param user_id [String]
796
- # @param user_secret [String]
797
- # @param simple_trade_form [SimpleTradeForm]
798
- # @param [Hash] opts the optional parameters
799
- # @return [SimpleTradeResponse]
800
- private def place_simple_order_impl(account_id, user_id, user_secret, simple_trade_form, opts = {})
801
- data, _status_code, _headers = place_simple_order_with_http_info(account_id, user_id, user_secret, simple_trade_form, opts)
802
- data
803
- end
804
-
805
- # Place a simple order (beta)
806
- # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments. TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route&#39;s supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as &#x60;ESZ26 C6000&#x60;, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade&#39;s local instrument catalog to submit an order. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
807
- # @param account_id [String] The ID of the account to execute the trade on.
808
- # @param user_id [String]
809
- # @param user_secret [String]
810
- # @param simple_trade_form [SimpleTradeForm]
811
- # @param [Hash] opts the optional parameters
812
- # @return [Array<(SimpleTradeResponse, Integer, Hash)>] SimpleTradeResponse data, response status code and response headers
813
- private def place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, opts = {})
814
- if @api_client.config.debugging
815
- @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.place_simple_order ...'
816
- end
817
- # verify the required parameter 'account_id' is set
818
- if @api_client.config.client_side_validation && account_id.nil?
819
- fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.place_simple_order"
820
- end
821
- # verify the required parameter 'user_id' is set
822
- if @api_client.config.client_side_validation && user_id.nil?
823
- fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.place_simple_order"
824
- end
825
- # verify the required parameter 'user_secret' is set
826
- if @api_client.config.client_side_validation && user_secret.nil?
827
- fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.place_simple_order"
828
- end
829
- # verify the required parameter 'simple_trade_form' is set
830
- if @api_client.config.client_side_validation && simple_trade_form.nil?
831
- fail ArgumentError, "Missing the required parameter 'simple_trade_form' when calling ExperimentalEndpointsApi.place_simple_order"
832
- end
833
- # resource path
834
- local_var_path = '/accounts/{accountId}/trading/simple'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
835
-
836
- # query parameters
837
- query_params = opts[:query_params] || {}
838
- query_params[:'userId'] = user_id
839
- query_params[:'userSecret'] = user_secret
840
-
841
- # header parameters
842
- header_params = opts[:header_params] || {}
843
- # HTTP header 'Accept' (if needed)
844
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
845
- # HTTP header 'Content-Type'
846
- content_type = @api_client.select_header_content_type(['application/json'])
847
- if !content_type.nil?
848
- header_params['Content-Type'] = content_type
849
- end
850
-
851
- # form parameters
852
- form_params = opts[:form_params] || {}
853
-
854
- # http body (model)
855
- post_body = opts[:debug_body] || @api_client.object_to_http_body(simple_trade_form)
856
-
857
- # return_type
858
- return_type = opts[:debug_return_type] || 'SimpleTradeResponse'
859
-
860
- # auth_names
861
- auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
862
-
863
- new_options = opts.merge(
864
- :operation => :"ExperimentalEndpointsApi.place_simple_order",
865
- :header_params => header_params,
866
- :query_params => query_params,
867
- :form_params => form_params,
868
- :body => post_body,
869
- :auth_names => auth_names,
870
- :return_type => return_type
871
- )
872
-
873
- data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
874
- if @api_client.config.debugging
875
- @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#place_simple_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
876
- end
877
- return data, status_code, headers, response
878
- end
879
695
  end
880
696
 
881
697
  # top-level client access to avoid having the user to insantiate their own API instances
@@ -1581,6 +1581,190 @@ module SnapTrade
1581
1581
  end
1582
1582
 
1583
1583
 
1584
+ # Place a simple order (beta)
1585
+ #
1586
+ # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. Breaking changes are possible while this endpoint is in beta.
1587
+ #
1588
+ # Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages).
1589
+ #
1590
+ # An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders.
1591
+ #
1592
+ # Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments.
1593
+ #
1594
+ # TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments.
1595
+ #
1596
+ # All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order.
1597
+ #
1598
+ # A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
1599
+ #
1600
+ # @param order_type [SimpleTradeFormOrderType]
1601
+ # @param time_in_force [SimpleTradeFormTimeInForce] Order duration, subject to brokerage and execution-path support. gtd requires expiry_date and a non-market single-leg equity/option order. Existing single-leg option routing does not support ioc. Futures and multi-leg orders do not support gtd through this endpoint. Webull US futures only support day and gtc. TradeStation futures and futures options accept day, gtc, ioc, and fok, subject to the contract and route's supported combinations.
1602
+ # @param legs [Array<SimpleTradeLeg>] Legs of one brokerage order. Use equity/option legs or future/future_option legs, without mixing the two families. Brokerage strategy and leg-count limits apply.
1603
+ # @param account_id [String] The ID of the account to execute the trade on.
1604
+ # @param user_id [String]
1605
+ # @param user_secret [String]
1606
+ # @param limit_price [Float] Required for limit and stop_limit orders, except that multi-leg price_effect even implies zero. Must be omitted or null for market and stop orders. For multi-leg orders this is the net strategy price. Negative prices are accepted only for futures-family orders, subject to brokerage support.
1607
+ # @param stop_price [Float] Required for stop and stop_limit orders. Must be omitted or null for market and limit orders. Must be positive for equity/option orders; futures-family trigger prices are subject to brokerage support.
1608
+ # @param price_effect [SimpleTradeFormPriceEffect] Only applicable to multi-leg limit and stop_limit orders. Requirements and supported values depend on the brokerage; tastytrade requires credit or debit. even implies a zero limit_price, which may be omitted and must be zero if supplied. Single-leg price effects are derived from the action.
1609
+ # @param client_order_id [String] Canonical UUID. Required for Wealthsimple multi-leg placement regardless of client-order-ID enablement; reuse it when retrying the same attempt. Wealthsimple multi-leg attempts retain the ID after success or failure, and reuse by the same user across accounts or placement endpoints returns 409 without another submission. A 409 does not establish whether the original attempt was accepted; reconcile it before creating a new order with a new ID. Optional for other orders, forwarded where the existing execution path supports it and for tastytrade, Webull US, and TradeStation futures-family orders. Other orders require the existing client-order-ID enablement; when disabled the value is ignored. Brokerage behavior on duplicates varies. OAuth requests also reject a client_order_id the user has already used with 409. Tastytrade uses this as external-identifier for correlation and does not deduplicate submissions. For Webull US futures, SnapTrade converts the supplied UUID (or its generated order UUID) to lowercase 32-character hexadecimal without hyphens. The original supplied UUID remains in SnapTrade's trade audit; the converted value is returned as brokerage_order_id for subsequent order reads. For TradeStation live and SIM, SnapTrade encodes the supplied UUID (or its generated order UUID) as 22-character URL-safe base64 without padding and sends it as OrderConfirmID for brokerage duplicate prevention; the response contains TradeStation's separate order ID.
1610
+ # @param expiry_date [Time] ISO 8601 expiry timestamp, required for gtd and invalid with other durations. A missing timezone is treated as UTC. Supported only through existing single-leg Public and Sandbox execution paths.
1611
+ # @param notional_value [Float] Positive order value, supported only for a single-equity market order on eligible brokerages and partners. Mutually exclusive with leg units. Omit or set units to null when supplied.
1612
+ # @param trading_session [SimpleTradeFormTradingSession] extended uses existing single-leg equity/option brokerage support and requires extended-hours enablement. Futures and multi-leg orders only accept regular.
1613
+ # @param body [SimpleTradeForm]
1614
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1615
+ def place_simple_order(order_type:, time_in_force:, legs:, account_id:, user_id:, user_secret:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, client_order_id: SENTINEL, expiry_date: SENTINEL, notional_value: SENTINEL, trading_session: 'regular', extra: {})
1616
+ _body = {}
1617
+ _body[:order_type] = order_type if order_type != SENTINEL
1618
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
1619
+ _body[:legs] = legs if legs != SENTINEL
1620
+ _body[:limit_price] = limit_price if limit_price != SENTINEL
1621
+ _body[:stop_price] = stop_price if stop_price != SENTINEL
1622
+ _body[:price_effect] = price_effect if price_effect != SENTINEL
1623
+ _body[:client_order_id] = client_order_id if client_order_id != SENTINEL
1624
+ _body[:expiry_date] = expiry_date if expiry_date != SENTINEL
1625
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
1626
+ _body[:trading_session] = trading_session if trading_session != SENTINEL
1627
+ simple_trade_form = _body
1628
+ data, _status_code, _headers = place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, extra)
1629
+ data
1630
+ end
1631
+
1632
+ # Place a simple order (beta)
1633
+ #
1634
+ # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. Breaking changes are possible while this endpoint is in beta.
1635
+ #
1636
+ # Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages).
1637
+ #
1638
+ # An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders.
1639
+ #
1640
+ # Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments.
1641
+ #
1642
+ # TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments.
1643
+ #
1644
+ # All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order.
1645
+ #
1646
+ # A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
1647
+ #
1648
+ # @param order_type [SimpleTradeFormOrderType]
1649
+ # @param time_in_force [SimpleTradeFormTimeInForce] Order duration, subject to brokerage and execution-path support. gtd requires expiry_date and a non-market single-leg equity/option order. Existing single-leg option routing does not support ioc. Futures and multi-leg orders do not support gtd through this endpoint. Webull US futures only support day and gtc. TradeStation futures and futures options accept day, gtc, ioc, and fok, subject to the contract and route's supported combinations.
1650
+ # @param legs [Array<SimpleTradeLeg>] Legs of one brokerage order. Use equity/option legs or future/future_option legs, without mixing the two families. Brokerage strategy and leg-count limits apply.
1651
+ # @param account_id [String] The ID of the account to execute the trade on.
1652
+ # @param user_id [String]
1653
+ # @param user_secret [String]
1654
+ # @param limit_price [Float] Required for limit and stop_limit orders, except that multi-leg price_effect even implies zero. Must be omitted or null for market and stop orders. For multi-leg orders this is the net strategy price. Negative prices are accepted only for futures-family orders, subject to brokerage support.
1655
+ # @param stop_price [Float] Required for stop and stop_limit orders. Must be omitted or null for market and limit orders. Must be positive for equity/option orders; futures-family trigger prices are subject to brokerage support.
1656
+ # @param price_effect [SimpleTradeFormPriceEffect] Only applicable to multi-leg limit and stop_limit orders. Requirements and supported values depend on the brokerage; tastytrade requires credit or debit. even implies a zero limit_price, which may be omitted and must be zero if supplied. Single-leg price effects are derived from the action.
1657
+ # @param client_order_id [String] Canonical UUID. Required for Wealthsimple multi-leg placement regardless of client-order-ID enablement; reuse it when retrying the same attempt. Wealthsimple multi-leg attempts retain the ID after success or failure, and reuse by the same user across accounts or placement endpoints returns 409 without another submission. A 409 does not establish whether the original attempt was accepted; reconcile it before creating a new order with a new ID. Optional for other orders, forwarded where the existing execution path supports it and for tastytrade, Webull US, and TradeStation futures-family orders. Other orders require the existing client-order-ID enablement; when disabled the value is ignored. Brokerage behavior on duplicates varies. OAuth requests also reject a client_order_id the user has already used with 409. Tastytrade uses this as external-identifier for correlation and does not deduplicate submissions. For Webull US futures, SnapTrade converts the supplied UUID (or its generated order UUID) to lowercase 32-character hexadecimal without hyphens. The original supplied UUID remains in SnapTrade's trade audit; the converted value is returned as brokerage_order_id for subsequent order reads. For TradeStation live and SIM, SnapTrade encodes the supplied UUID (or its generated order UUID) as 22-character URL-safe base64 without padding and sends it as OrderConfirmID for brokerage duplicate prevention; the response contains TradeStation's separate order ID.
1658
+ # @param expiry_date [Time] ISO 8601 expiry timestamp, required for gtd and invalid with other durations. A missing timezone is treated as UTC. Supported only through existing single-leg Public and Sandbox execution paths.
1659
+ # @param notional_value [Float] Positive order value, supported only for a single-equity market order on eligible brokerages and partners. Mutually exclusive with leg units. Omit or set units to null when supplied.
1660
+ # @param trading_session [SimpleTradeFormTradingSession] extended uses existing single-leg equity/option brokerage support and requires extended-hours enablement. Futures and multi-leg orders only accept regular.
1661
+ # @param body [SimpleTradeForm]
1662
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1663
+ def place_simple_order_with_http_info(order_type:, time_in_force:, legs:, account_id:, user_id:, user_secret:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, client_order_id: SENTINEL, expiry_date: SENTINEL, notional_value: SENTINEL, trading_session: 'regular', extra: {})
1664
+ _body = {}
1665
+ _body[:order_type] = order_type if order_type != SENTINEL
1666
+ _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
1667
+ _body[:legs] = legs if legs != SENTINEL
1668
+ _body[:limit_price] = limit_price if limit_price != SENTINEL
1669
+ _body[:stop_price] = stop_price if stop_price != SENTINEL
1670
+ _body[:price_effect] = price_effect if price_effect != SENTINEL
1671
+ _body[:client_order_id] = client_order_id if client_order_id != SENTINEL
1672
+ _body[:expiry_date] = expiry_date if expiry_date != SENTINEL
1673
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
1674
+ _body[:trading_session] = trading_session if trading_session != SENTINEL
1675
+ simple_trade_form = _body
1676
+ place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, extra)
1677
+ end
1678
+
1679
+ # Place a simple order (beta)
1680
+ # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. Breaking changes are possible while this endpoint is in beta. Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments. TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route's supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as `ESZ26 C6000`, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade's local instrument catalog to submit an order. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
1681
+ # @param account_id [String] The ID of the account to execute the trade on.
1682
+ # @param user_id [String]
1683
+ # @param user_secret [String]
1684
+ # @param simple_trade_form [SimpleTradeForm]
1685
+ # @param [Hash] opts the optional parameters
1686
+ # @return [SimpleTradeResponse]
1687
+ private def place_simple_order_impl(account_id, user_id, user_secret, simple_trade_form, opts = {})
1688
+ data, _status_code, _headers = place_simple_order_with_http_info(account_id, user_id, user_secret, simple_trade_form, opts)
1689
+ data
1690
+ end
1691
+
1692
+ # Place a simple order (beta)
1693
+ # **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. Breaking changes are possible while this endpoint is in beta. Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade, Webull US, and TradeStation (live and SIM); future options are supported on tastytrade and TradeStation (live and SIM). Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments. TradeStation and TradeStation SIM support single-leg futures and futures-option orders in Futures accounts, with positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day, gtc, ioc, or fok duration, subject to the contract and route&#39;s supported combinations. Futures use buy/sell; futures options use the open/close option actions. Multi-leg futures-family strategies are not supported. Prices are forwarded without rounding; TradeStation determines contract availability, permissions, margin requirements, and valid price increments. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. For TradeStation, use a specific two-digit-year contract such as ESZ26 or @ESZ26, or a futures-option symbol such as &#x60;ESZ26 C6000&#x60;, preserving the space and any session alias. The optional @ prefix is supported for dated futures contracts and is forwarded unchanged. Slash-prefixed aliases and root-only continuous symbols such as @ES are not accepted. A futures symbol does not need to be present in SnapTrade&#39;s local instrument catalog to submit an order. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
1694
+ # @param account_id [String] The ID of the account to execute the trade on.
1695
+ # @param user_id [String]
1696
+ # @param user_secret [String]
1697
+ # @param simple_trade_form [SimpleTradeForm]
1698
+ # @param [Hash] opts the optional parameters
1699
+ # @return [Array<(SimpleTradeResponse, Integer, Hash)>] SimpleTradeResponse data, response status code and response headers
1700
+ private def place_simple_order_with_http_info_impl(account_id, user_id, user_secret, simple_trade_form, opts = {})
1701
+ if @api_client.config.debugging
1702
+ @api_client.config.logger.debug 'Calling API: TradingApi.place_simple_order ...'
1703
+ end
1704
+ # verify the required parameter 'account_id' is set
1705
+ if @api_client.config.client_side_validation && account_id.nil?
1706
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling TradingApi.place_simple_order"
1707
+ end
1708
+ # verify the required parameter 'user_id' is set
1709
+ if @api_client.config.client_side_validation && user_id.nil?
1710
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling TradingApi.place_simple_order"
1711
+ end
1712
+ # verify the required parameter 'user_secret' is set
1713
+ if @api_client.config.client_side_validation && user_secret.nil?
1714
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling TradingApi.place_simple_order"
1715
+ end
1716
+ # verify the required parameter 'simple_trade_form' is set
1717
+ if @api_client.config.client_side_validation && simple_trade_form.nil?
1718
+ fail ArgumentError, "Missing the required parameter 'simple_trade_form' when calling TradingApi.place_simple_order"
1719
+ end
1720
+ # resource path
1721
+ local_var_path = '/accounts/{accountId}/trading/simple'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
1722
+
1723
+ # query parameters
1724
+ query_params = opts[:query_params] || {}
1725
+ query_params[:'userId'] = user_id
1726
+ query_params[:'userSecret'] = user_secret
1727
+
1728
+ # header parameters
1729
+ header_params = opts[:header_params] || {}
1730
+ # HTTP header 'Accept' (if needed)
1731
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1732
+ # HTTP header 'Content-Type'
1733
+ content_type = @api_client.select_header_content_type(['application/json'])
1734
+ if !content_type.nil?
1735
+ header_params['Content-Type'] = content_type
1736
+ end
1737
+
1738
+ # form parameters
1739
+ form_params = opts[:form_params] || {}
1740
+
1741
+ # http body (model)
1742
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(simple_trade_form)
1743
+
1744
+ # return_type
1745
+ return_type = opts[:debug_return_type] || 'SimpleTradeResponse'
1746
+
1747
+ # auth_names
1748
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1749
+
1750
+ new_options = opts.merge(
1751
+ :operation => :"TradingApi.place_simple_order",
1752
+ :header_params => header_params,
1753
+ :query_params => query_params,
1754
+ :form_params => form_params,
1755
+ :body => post_body,
1756
+ :auth_names => auth_names,
1757
+ :return_type => return_type
1758
+ )
1759
+
1760
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
1761
+ if @api_client.config.debugging
1762
+ @api_client.config.logger.debug "API called: TradingApi#place_simple_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1763
+ end
1764
+ return data, status_code, headers, response
1765
+ end
1766
+
1767
+
1584
1768
  # Preview crypto order
1585
1769
  #
1586
1770
  # Previews an order using the specified account.
@@ -13,6 +13,8 @@ require 'time'
13
13
  module SnapTrade
14
14
  # A transaction or activity from an institution
15
15
  class AccountUniversalActivity
16
+ attr_accessor :instrument
17
+
16
18
  # Unique identifier for the transaction. This is the ID used to reference the transaction in SnapTrade. Please note that this ID _can_ change if the transaction is deleted and re-added. Under normal circumstances, SnapTrade does not delete transactions. The only time this would happen is if SnapTrade re-fetches and reprocesses the data from the brokerage, which is rare. If you require a stable ID, please let us know and we can work with you to provide one.
17
19
  attr_accessor :id
18
20
 
@@ -33,7 +35,7 @@ module SnapTrade
33
35
 
34
36
  attr_accessor :currency
35
37
 
36
- # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of asset(s) from one account to another. - `EXTERNAL_ASSET_TRANSFER_IN` - Incoming transfer of an asset from an external account to this account. - `EXTERNAL_ASSET_TRANSFER_OUT` - Outgoing transfer of an asset from this account to an external account. - `SPLIT` - A stock share split. - `ADJUSTMENT` - A one time adjustment of the account's cash balance or shares of an asset
38
+ # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CAPITAL_GAINS_LONG` - Long-term capital-gain distribution. - `CAPITAL_GAINS_SHORT` - Short-term capital-gain distribution. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of asset(s) from one account to another. - `EXTERNAL_ASSET_TRANSFER_IN` - Incoming transfer of an asset from an external account to this account. - `EXTERNAL_ASSET_TRANSFER_OUT` - Outgoing transfer of an asset from this account to an external account. - `SPLIT` - A stock share split. - `ADJUSTMENT` - A one time adjustment of the account's cash balance or shares of an asset
37
39
  attr_accessor :type
38
40
 
39
41
  # If an option `BUY` or `SELL` transaction, this further specifies the type of action. The possible values are: - BUY_TO_OPEN - BUY_TO_CLOSE - SELL_TO_OPEN - SELL_TO_CLOSE
@@ -63,6 +65,7 @@ module SnapTrade
63
65
  # Attribute mapping from ruby-style variable name to JSON key.
64
66
  def self.attribute_map
65
67
  {
68
+ :'instrument' => :'instrument',
66
69
  :'id' => :'id',
67
70
  :'symbol' => :'symbol',
68
71
  :'currency_universal_symbol' => :'currency_universal_symbol',
@@ -91,6 +94,7 @@ module SnapTrade
91
94
  # Attribute type mapping.
92
95
  def self.openapi_types
93
96
  {
97
+ :'instrument' => :'Instrument',
94
98
  :'id' => :'String',
95
99
  :'symbol' => :'AccountUniversalActivitySymbol',
96
100
  :'currency_universal_symbol' => :'AccountUniversalActivityCurrencyUniversalSymbol',
@@ -114,6 +118,7 @@ module SnapTrade
114
118
  # List of attributes with nullable: true
115
119
  def self.openapi_nullable
116
120
  Set.new([
121
+ :'instrument',
117
122
  :'symbol',
118
123
  :'currency_universal_symbol',
119
124
  :'option_symbol',
@@ -140,6 +145,10 @@ module SnapTrade
140
145
  h[k.to_sym] = v
141
146
  }
142
147
 
148
+ if attributes.key?(:'instrument')
149
+ self.instrument = attributes[:'instrument']
150
+ end
151
+
143
152
  if attributes.key?(:'id')
144
153
  self.id = attributes[:'id']
145
154
  end
@@ -227,6 +236,7 @@ module SnapTrade
227
236
  def ==(o)
228
237
  return true if self.equal?(o)
229
238
  self.class == o.class &&
239
+ instrument == o.instrument &&
230
240
  id == o.id &&
231
241
  symbol == o.symbol &&
232
242
  currency_universal_symbol == o.currency_universal_symbol &&
@@ -255,7 +265,7 @@ module SnapTrade
255
265
  # Calculates hash code according to all attributes.
256
266
  # @return [Integer] Hash code
257
267
  def hash
258
- [id, symbol, currency_universal_symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
268
+ [instrument, id, symbol, currency_universal_symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
259
269
  end
260
270
 
261
271
  # Builds the object from hash
@@ -16,7 +16,7 @@ module SnapTrade
16
16
  # A stable and unique transaction id when available
17
17
  attr_accessor :transaction_id
18
18
 
19
- # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `BUY_TO_OPEN` - Option bought to open a long position. - `BUY_TO_CLOSE` - Option bought to close a short position. - `SELL_TO_OPEN` - Option sold to open a short position. - `SELL_TO_CLOSE` - Option sold to close a long position. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of asset(s) from one account to another. - `EXTERNAL_ASSET_TRANSFER_IN` - Incoming transfer of an asset from an external account to this account. - `EXTERNAL_ASSET_TRANSFER_OUT` - Outgoing transfer of an asset from this account to an external account. - `SPLIT` - A stock share split. - `ADJUSTMENT` - A one time adjustment of the account's cash balance or shares of an asset
19
+ # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `BUY_TO_OPEN` - Option bought to open a long position. - `BUY_TO_CLOSE` - Option bought to close a short position. - `SELL_TO_OPEN` - Option sold to open a short position. - `SELL_TO_CLOSE` - Option sold to close a long position. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CAPITAL_GAINS_LONG` - Long-term capital-gain distribution. - `CAPITAL_GAINS_SHORT` - Short-term capital-gain distribution. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of asset(s) from one account to another. - `EXTERNAL_ASSET_TRANSFER_IN` - Incoming transfer of an asset from an external account to this account. - `EXTERNAL_ASSET_TRANSFER_OUT` - Outgoing transfer of an asset from this account to an external account. - `SPLIT` - A stock share split. - `ADJUSTMENT` - A one time adjustment of the account's cash balance or shares of an asset
20
20
  attr_accessor :type
21
21
 
22
22
  # Recorded date and time in UTC. Precision depends on what the brokerage supplies.
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Future option (option on a futures contract) instrument metadata for a V2 position. **Beta:** currently returned only for tastytrade and Interactive Brokers connections, and only for partners it has been enabled for. This schema may change.
14
+ # Contract details for an option on a future, including its underlying futures contract. **Beta:** futures-option positions are currently returned only for tastytrade and Interactive Brokers connections, and only for partners enabled for those positions. Tastytrade activities can also identify futures-option contracts. This schema may change.
15
15
  class FutureOptionInstrument
16
16
  # Type of security instrument.
17
17
  attr_accessor :kind
@@ -35,7 +35,7 @@ module SnapTrade
35
35
 
36
36
  attr_accessor :currency
37
37
 
38
- # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. `option_symbol` contains the related option contract info. - `OPTIONASSIGNMENT` - Option assignment event. `option_symbol` contains the related option contract info. - `OPTIONEXERCISE` - Option exercise event. `option_symbol` contains the related option contract info.
38
+ # A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CAPITAL_GAINS_LONG` - Long-term capital-gain distribution. - `CAPITAL_GAINS_SHORT` - Short-term capital-gain distribution. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. `option_symbol` contains the related option contract info. - `OPTIONASSIGNMENT` - Option assignment event. `option_symbol` contains the related option contract info. - `OPTIONEXERCISE` - Option exercise event. `option_symbol` contains the related option contract info.
39
39
  attr_accessor :type
40
40
 
41
41
  # If an option `BUY` or `SELL` transaction, this further specifies the type of action. The possible values are: - BUY_TO_OPEN - BUY_TO_CLOSE - SELL_TO_OPEN - SELL_TO_CLOSE
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '3.0.65'
11
+ VERSION = '3.0.67'
12
12
  end