class SwaggerClient::SaleApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/swagger_client/api/sale_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

sale_checkout_shopping_cart(request, site_id, version, opts = {}) click to toggle source

Purchase pricing options, packages, retail products, or tips for a client. This endpoint provides a wide range of functionality. For example, you can use it when a client purchases new pricing options, retail products, packages, and tips. You can also combine purchasing a new pricing option and many other functions, such as booking a client into a class, booking a new appointment for a client, enrolling a client into an enrollment or course, or reconciling an unpaid, already booked appointment or class. Use this call when a client purchases: * a pricing option, after calling `GET Services` and choosing a specific pricing option’s ID * a retail product, after calling `GET Products` and choosing a specific retail product’s ID * a package, after calling `GET Packages` and choosing a specific package’s ID * a tip to give to a staff member, after calling `GET Staff` and choosing a specific staff member ID, and the amount that the client wants to tip The documentation provides explanations of the request body and response, as well as the cart item metadata, payment item metadata, and purchased cart items. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [Object]

# File lib/swagger_client/api/sale_api.rb, line 30
def sale_checkout_shopping_cart(request, site_id, version, opts = {})
  data, _status_code, _headers = sale_checkout_shopping_cart_with_http_info(request, site_id, version, opts)
  data
end
sale_checkout_shopping_cart_with_http_info(request, site_id, version, opts = {}) click to toggle source

Purchase pricing options, packages, retail products, or tips for a client. This endpoint provides a wide range of functionality. For example, you can use it when a client purchases new pricing options, retail products, packages, and tips. You can also combine purchasing a new pricing option and many other functions, such as booking a client into a class, booking a new appointment for a client, enrolling a client into an enrollment or course, or reconciling an unpaid, already booked appointment or class. Use this call when a client purchases: * a pricing option, after calling &#x60;GET Services&#x60; and choosing a specific pricing option’s ID * a retail product, after calling &#x60;GET Products&#x60; and choosing a specific retail product’s ID * a package, after calling &#x60;GET Packages&#x60; and choosing a specific package’s ID * a tip to give to a staff member, after calling &#x60;GET Staff&#x60; and choosing a specific staff member ID, and the amount that the client wants to tip The documentation provides explanations of the request body and response, as well as the cart item metadata, payment item metadata, and purchased cart items. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 43
def sale_checkout_shopping_cart_with_http_info(request, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_checkout_shopping_cart ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling SaleApi.sale_checkout_shopping_cart"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_checkout_shopping_cart"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_checkout_shopping_cart"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/checkoutshoppingcart'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_checkout_shopping_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_accepted_card_types(site_id, version, opts = {}) click to toggle source

Get credit cards types that a site accepts. Gets a list of card types that the site accepts. You can also use `GET Sites` to return the Site object, which contains individual accepted card types for requested sites. This endpoint has no query parameters.The response returns a list of strings. Possible values are: * Visa * MasterCard * Discover * AMEX @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [Array<String>]

# File lib/swagger_client/api/sale_api.rb, line 99
def sale_get_accepted_card_types(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_accepted_card_types_with_http_info(site_id, version, opts)
  data
end
sale_get_accepted_card_types_with_http_info(site_id, version, opts = {}) click to toggle source

Get credit cards types that a site accepts. Gets a list of card types that the site accepts. You can also use &#x60;GET Sites&#x60; to return the Site object, which contains individual accepted card types for requested sites. This endpoint has no query parameters.The response returns a list of strings. Possible values are: * Visa * MasterCard * Discover * AMEX @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(Array<String>, Fixnum, Hash)>] Array<String> data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 111
def sale_get_accepted_card_types_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_accepted_card_types ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_accepted_card_types"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_accepted_card_types"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/acceptedcardtypes'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<String>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_accepted_card_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_contracts(request_location_id, site_id, version, opts = {}) click to toggle source

Get contracts available for purchase at a site. @param request_location_id The ID of the location that has the requested contracts and AutoPay options. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Integer] :request_consumer_id The ID of the client. @option opts [Array<Integer>] :request_contract_ids When included, the response only contains details about the specified contract IDs. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [BOOLEAN] :request_sold_online When &#x60;true&#x60;, the response only contains details about contracts and AutoPay options that can be sold online.&lt;br /&gt; When &#x60;false&#x60;, only contracts that are not intended to be sold online are returned.&lt;br /&gt; Default: **all contracts** @return [GetContractsResponse]

# File lib/swagger_client/api/sale_api.rb, line 166
def sale_get_contracts(request_location_id, site_id, version, opts = {})
  data, _status_code, _headers = sale_get_contracts_with_http_info(request_location_id, site_id, version, opts)
  data
end
sale_get_contracts_with_http_info(request_location_id, site_id, version, opts = {}) click to toggle source

Get contracts available for purchase at a site. @param request_location_id The ID of the location that has the requested contracts and AutoPay options. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Integer] :request_consumer_id The ID of the client. @option opts [Array<Integer>] :request_contract_ids When included, the response only contains details about the specified contract IDs. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [BOOLEAN] :request_sold_online When &#x60;true&#x60;, the response only contains details about contracts and AutoPay options that can be sold online.&lt;br /&gt; When &#x60;false&#x60;, only contracts that are not intended to be sold online are returned.&lt;br /&gt; Default: **all contracts** @return [Array<(GetContractsResponse, Fixnum, Hash)>] GetContractsResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 183
def sale_get_contracts_with_http_info(request_location_id, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_contracts ...'
  end
  # verify the required parameter 'request_location_id' is set
  if @api_client.config.client_side_validation && request_location_id.nil?
    fail ArgumentError, "Missing the required parameter 'request_location_id' when calling SaleApi.sale_get_contracts"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_contracts"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_contracts"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/contracts'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.locationId'] = request_location_id
  query_params[:'request.consumerId'] = opts[:'request_consumer_id'] if !opts[:'request_consumer_id'].nil?
  query_params[:'request.contractIds'] = @api_client.build_collection_param(opts[:'request_contract_ids'], :multi) if !opts[:'request_contract_ids'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.soldOnline'] = opts[:'request_sold_online'] if !opts[:'request_sold_online'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetContractsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_contracts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_custom_payment_methods(site_id, version, opts = {}) click to toggle source

Get payment methods that can be used to pay for sales at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @return [GetCustomPaymentMethodsResponse]

# File lib/swagger_client/api/sale_api.rb, line 244
def sale_get_custom_payment_methods(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_custom_payment_methods_with_http_info(site_id, version, opts)
  data
end
sale_get_custom_payment_methods_with_http_info(site_id, version, opts = {}) click to toggle source

Get payment methods that can be used to pay for sales at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @return [Array<(GetCustomPaymentMethodsResponse, Fixnum, Hash)>] GetCustomPaymentMethodsResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 257
def sale_get_custom_payment_methods_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_custom_payment_methods ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_custom_payment_methods"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_custom_payment_methods"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/custompaymentmethods'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetCustomPaymentMethodsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_custom_payment_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_gift_cards(site_id, version, opts = {}) click to toggle source

Get gift cards available for purchase at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Array<Integer>] :request_ids Filters the results to the requested gift card IDs.&lt;br /&gt; Default: all gift cards. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id When included, returns gift cards that are sold at the provided location ID. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [BOOLEAN] :request_sold_online When &#x60;true&#x60;, only returns gift cards that are sold online.&lt;br /&gt; Default: false @return [GetGiftCardResponse]

# File lib/swagger_client/api/sale_api.rb, line 313
def sale_get_gift_cards(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_gift_cards_with_http_info(site_id, version, opts)
  data
end
sale_get_gift_cards_with_http_info(site_id, version, opts = {}) click to toggle source

Get gift cards available for purchase at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Array<Integer>] :request_ids Filters the results to the requested gift card IDs.&lt;br /&gt; Default: all gift cards. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id When included, returns gift cards that are sold at the provided location ID. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [BOOLEAN] :request_sold_online When &#x60;true&#x60;, only returns gift cards that are sold online.&lt;br /&gt; Default: false @return [Array<(GetGiftCardResponse, Fixnum, Hash)>] GetGiftCardResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 329
def sale_get_gift_cards_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_gift_cards ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_gift_cards"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_gift_cards"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/giftcards'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.ids'] = @api_client.build_collection_param(opts[:'request_ids'], :multi) if !opts[:'request_ids'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.locationId'] = opts[:'request_location_id'] if !opts[:'request_location_id'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.soldOnline'] = opts[:'request_sold_online'] if !opts[:'request_sold_online'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetGiftCardResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_gift_cards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_packages(site_id, version, opts = {}) click to toggle source

Get packages available for purchase at a site. A package is typically used to combine multiple services and/or products into a single offering. Staff members can check out multiple appointments while selling the package, and can discount the items included. For example, a spa might bundle a massage, a pedicure, a manicure, a facial, and a few selected beauty products into a package. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_package_ids A list of the packages IDs to filter by. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, only returns products that can be sold online.&lt;br /&gt; When &#x60;false&#x60;, all products are returned.&lt;br /&gt; Default: false @return [GetPackagesResponse]

# File lib/swagger_client/api/sale_api.rb, line 388
def sale_get_packages(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_packages_with_http_info(site_id, version, opts)
  data
end
sale_get_packages_with_http_info(site_id, version, opts = {}) click to toggle source

Get packages available for purchase at a site. A package is typically used to combine multiple services and/or products into a single offering. Staff members can check out multiple appointments while selling the package, and can discount the items included. For example, a spa might bundle a massage, a pedicure, a manicure, a facial, and a few selected beauty products into a package. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_package_ids A list of the packages IDs to filter by. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, only returns products that can be sold online.&lt;br /&gt; When &#x60;false&#x60;, all products are returned.&lt;br /&gt; Default: false @return [Array<(GetPackagesResponse, Fixnum, Hash)>] GetPackagesResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 404
def sale_get_packages_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_packages ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_packages"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_packages"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/packages'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.packageIds'] = @api_client.build_collection_param(opts[:'request_package_ids'], :multi) if !opts[:'request_package_ids'].nil?
  query_params[:'request.sellOnline'] = opts[:'request_sell_online'] if !opts[:'request_sell_online'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetPackagesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_packages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_products(site_id, version, opts = {}) click to toggle source

Get retail products available for purchase at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Array<Integer>] :request_category_ids A list of category IDs to filter by. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id The location ID to use to determine the tax for the products that this request returns.&lt;br /&gt; Default: **online store** @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<String>] :request_product_ids An ID filter for products. @option opts [String] :request_search_text A search filter, used for searching by term. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, only products that can be sold online are returned.&lt;br /&gt; When &#x60;false&#x60;, all products are returned.&lt;br /&gt; Default: false @option opts [Array<Integer>] :request_sub_category_ids A list of subcategory IDs to filter by. @return [GetProductsResponse]

# File lib/swagger_client/api/sale_api.rb, line 465
def sale_get_products(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_products_with_http_info(site_id, version, opts)
  data
end
sale_get_products_with_http_info(site_id, version, opts = {}) click to toggle source

Get retail products available for purchase at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Array<Integer>] :request_category_ids A list of category IDs to filter by. @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id The location ID to use to determine the tax for the products that this request returns.&lt;br /&gt; Default: **online store** @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<String>] :request_product_ids An ID filter for products. @option opts [String] :request_search_text A search filter, used for searching by term. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, only products that can be sold online are returned.&lt;br /&gt; When &#x60;false&#x60;, all products are returned.&lt;br /&gt; Default: false @option opts [Array<Integer>] :request_sub_category_ids A list of subcategory IDs to filter by. @return [Array<(GetProductsResponse, Fixnum, Hash)>] GetProductsResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 484
def sale_get_products_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_products ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_products"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_products"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/products'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.categoryIds'] = @api_client.build_collection_param(opts[:'request_category_ids'], :multi) if !opts[:'request_category_ids'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.locationId'] = opts[:'request_location_id'] if !opts[:'request_location_id'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.productIds'] = @api_client.build_collection_param(opts[:'request_product_ids'], :multi) if !opts[:'request_product_ids'].nil?
  query_params[:'request.searchText'] = opts[:'request_search_text'] if !opts[:'request_search_text'].nil?
  query_params[:'request.sellOnline'] = opts[:'request_sell_online'] if !opts[:'request_sell_online'].nil?
  query_params[:'request.subCategoryIds'] = @api_client.build_collection_param(opts[:'request_sub_category_ids'], :multi) if !opts[:'request_sub_category_ids'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetProductsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_sales(site_id, version, opts = {}) click to toggle source

Get sales completed at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [GetSalesResponse]

# File lib/swagger_client/api/sale_api.rb, line 541
def sale_get_sales(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_sales_with_http_info(site_id, version, opts)
  data
end
sale_get_sales_with_http_info(site_id, version, opts = {}) click to toggle source

Get sales completed at a site. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(GetSalesResponse, Fixnum, Hash)>] GetSalesResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 552
def sale_get_sales_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_sales ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_sales"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_sales"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/sales'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetSalesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_sales\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_get_services(site_id, version, opts = {}) click to toggle source

Get pricing options available for purchase at a site @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Integer] :request_class_id Filters to the pricing options for the specified class ID. @option opts [Integer] :request_class_schedule_id Filters to the pricing options for the specified class schedule ID. @option opts [BOOLEAN] :request_hide_related_programs When &#x60;true&#x60;, indicates that pricing options of related programs are omitted from the response.&lt;br /&gt; Default: false @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id When specified, for each returned pricing option, &#x60;TaxRate&#x60; and &#x60;TaxIncluded&#x60; are calculated according to the specified location. Note that this does not filter results to only services provided at the given location, and for locations where Value-Added Tax (VAT) rules apply, the &#x60;TaxRate&#x60; is set to zero. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_program_ids Filters to pricing options with the specified program IDs. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, filters to the pricing options that can be sold online.&lt;br /&gt; Default: false @option opts [Array<String>] :request_service_ids Filters to the pricing options with the specified IDs. In this context, service and pricing option are used interchangeably. @option opts [Array<Integer>] :request_session_type_ids Filters to the pricing options with the specified session types IDs. @option opts [Integer] :request_staff_id Sets &#x60;Price&#x60; and &#x60;OnlinePrice&#x60; to the particular pricing of a specific staff member, if allowed by the business. @return [GetServicesResponse]

# File lib/swagger_client/api/sale_api.rb, line 612
def sale_get_services(site_id, version, opts = {})
  data, _status_code, _headers = sale_get_services_with_http_info(site_id, version, opts)
  data
end
sale_get_services_with_http_info(site_id, version, opts = {}) click to toggle source

Get pricing options available for purchase at a site @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Integer] :request_class_id Filters to the pricing options for the specified class ID. @option opts [Integer] :request_class_schedule_id Filters to the pricing options for the specified class schedule ID. @option opts [BOOLEAN] :request_hide_related_programs When &#x60;true&#x60;, indicates that pricing options of related programs are omitted from the response.&lt;br /&gt; Default: false @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Integer] :request_location_id When specified, for each returned pricing option, &#x60;TaxRate&#x60; and &#x60;TaxIncluded&#x60; are calculated according to the specified location. Note that this does not filter results to only services provided at the given location, and for locations where Value-Added Tax (VAT) rules apply, the &#x60;TaxRate&#x60; is set to zero. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_program_ids Filters to pricing options with the specified program IDs. @option opts [BOOLEAN] :request_sell_online When &#x60;true&#x60;, filters to the pricing options that can be sold online.&lt;br /&gt; Default: false @option opts [Array<String>] :request_service_ids Filters to the pricing options with the specified IDs. In this context, service and pricing option are used interchangeably. @option opts [Array<Integer>] :request_session_type_ids Filters to the pricing options with the specified session types IDs. @option opts [Integer] :request_staff_id Sets &#x60;Price&#x60; and &#x60;OnlinePrice&#x60; to the particular pricing of a specific staff member, if allowed by the business. @return [Array<(GetServicesResponse, Fixnum, Hash)>] GetServicesResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 634
def sale_get_services_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_get_services ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_get_services"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_get_services"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/services'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.classId'] = opts[:'request_class_id'] if !opts[:'request_class_id'].nil?
  query_params[:'request.classScheduleId'] = opts[:'request_class_schedule_id'] if !opts[:'request_class_schedule_id'].nil?
  query_params[:'request.hideRelatedPrograms'] = opts[:'request_hide_related_programs'] if !opts[:'request_hide_related_programs'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.locationId'] = opts[:'request_location_id'] if !opts[:'request_location_id'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.programIds'] = @api_client.build_collection_param(opts[:'request_program_ids'], :multi) if !opts[:'request_program_ids'].nil?
  query_params[:'request.sellOnline'] = opts[:'request_sell_online'] if !opts[:'request_sell_online'].nil?
  query_params[:'request.serviceIds'] = @api_client.build_collection_param(opts[:'request_service_ids'], :multi) if !opts[:'request_service_ids'].nil?
  query_params[:'request.sessionTypeIds'] = @api_client.build_collection_param(opts[:'request_session_type_ids'], :multi) if !opts[:'request_session_type_ids'].nil?
  query_params[:'request.staffId'] = opts[:'request_staff_id'] if !opts[:'request_staff_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetServicesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_get_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_purchase_contract(request, site_id, version, opts = {}) click to toggle source

Purchase a contract for a client. Allows a client to sign up for a contract or autopay using the information returned from the `GET Contracts` endpoint. The client can pay with a new credit card or with a stored credit card. The client must exist at the site specified before this call is made. This endpoint allows a developer to specify whether a client pays now or pays on the `StartDate`.If you are building a client-facing experience, you should talk with the business owner to understand the owner’s policies before you give clients a choice of the two payment types. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [PurchaseContractResponse]

# File lib/swagger_client/api/sale_api.rb, line 696
def sale_purchase_contract(request, site_id, version, opts = {})
  data, _status_code, _headers = sale_purchase_contract_with_http_info(request, site_id, version, opts)
  data
end
sale_purchase_contract_with_http_info(request, site_id, version, opts = {}) click to toggle source

Purchase a contract for a client. Allows a client to sign up for a contract or autopay using the information returned from the &#x60;GET Contracts&#x60; endpoint. The client can pay with a new credit card or with a stored credit card. The client must exist at the site specified before this call is made. This endpoint allows a developer to specify whether a client pays now or pays on the &#x60;StartDate&#x60;.If you are building a client-facing experience, you should talk with the business owner to understand the owner’s policies before you give clients a choice of the two payment types. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(PurchaseContractResponse, Fixnum, Hash)>] PurchaseContractResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 709
def sale_purchase_contract_with_http_info(request, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_purchase_contract ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling SaleApi.sale_purchase_contract"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_purchase_contract"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_purchase_contract"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/purchasecontract'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PurchaseContractResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_purchase_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sale_purchase_gift_card(request, site_id, version, opts = {}) click to toggle source

Purchase a gift card for a client. Allows a client to purchase a gift card from a business in a variety of designs. The card can be emailed to the recipient on a specific day, and a card title and a personal message can be added. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [PurchaseGiftCardResponse]

# File lib/swagger_client/api/sale_api.rb, line 766
def sale_purchase_gift_card(request, site_id, version, opts = {})
  data, _status_code, _headers = sale_purchase_gift_card_with_http_info(request, site_id, version, opts)
  data
end
sale_purchase_gift_card_with_http_info(request, site_id, version, opts = {}) click to toggle source

Purchase a gift card for a client. Allows a client to purchase a gift card from a business in a variety of designs. The card can be emailed to the recipient on a specific day, and a card title and a personal message can be added. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(PurchaseGiftCardResponse, Fixnum, Hash)>] PurchaseGiftCardResponse data, response status code and response headers

# File lib/swagger_client/api/sale_api.rb, line 779
def sale_purchase_gift_card_with_http_info(request, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SaleApi.sale_purchase_gift_card ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling SaleApi.sale_purchase_gift_card"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling SaleApi.sale_purchase_gift_card"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling SaleApi.sale_purchase_gift_card"
  end
  # resource path
  local_var_path = '/public/v{version}/sale/purchasegiftcard'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PurchaseGiftCardResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SaleApi#sale_purchase_gift_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end