Class: SnapTrade::OptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/snaptrade/api/options_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OptionsApi

Returns a new instance of OptionsApi.



16
17
18
# File 'lib/snaptrade/api/options_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/snaptrade/api/options_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#list_option_holdings(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account option positions

Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the positions endpoint.

This endpoint is deprecated. Consider using the newer unified positions endpoint. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



34
35
36
37
# File 'lib/snaptrade/api/options_api.rb', line 34

def list_option_holdings(user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = list_option_holdings_with_http_info_impl(user_id, user_secret, , extra)
  data
end

#list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account option positions

Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the positions endpoint.

This endpoint is deprecated. Consider using the newer unified positions endpoint. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.

Check your API key on the Customer Dashboard billing page to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



53
54
55
# File 'lib/snaptrade/api/options_api.rb', line 53

def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {})
  list_option_holdings_with_http_info_impl(user_id, user_secret, , extra)
end