Class: SwaggerClient::SaleApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/sale_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SaleApi

Returns a new instance of SaleApi.



19
20
21
# File 'lib/swagger_client/api/sale_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/sale_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#sale_checkout_shopping_cart(request, site_id, version, opts = {}) ⇒ Object

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:

  • (Object)


30
31
32
33
# 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 = {}) ⇒ Array<(Object, Fixnum, Hash)>

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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 = {}) ⇒ Array<String>

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

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:

  • (Array<String>)


99
100
101
102
# 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 = {}) ⇒ Array<(Array<String>, Fixnum, Hash)>

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

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

  • (Array<(Array<String>, Fixnum, Hash)>)

    Array<String> data, response status code and response headers



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# 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 = {}) ⇒ GetContractsResponse

Get contracts available for purchase at a site.

Parameters:

  • request_location_id

    The ID of the location that has the requested contracts and AutoPay options.

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_consumer_id (Integer)

    The ID of the client.

  • :request_contract_ids (Array<Integer>)

    When included, the response only contains details about the specified contract IDs.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_sold_online (BOOLEAN)

    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**

Returns:



166
167
168
169
# 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 = {}) ⇒ Array<(GetContractsResponse, Fixnum, Hash)>

Get contracts available for purchase at a site.

Parameters:

  • request_location_id

    The ID of the location that has the requested contracts and AutoPay options.

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_consumer_id (Integer)

    The ID of the client.

  • :request_contract_ids (Array<Integer>)

    When included, the response only contains details about the specified contract IDs.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_sold_online (BOOLEAN)

    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**

Returns:

  • (Array<(GetContractsResponse, Fixnum, Hash)>)

    GetContractsResponse data, response status code and response headers



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# 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 = {}) ⇒ GetCustomPaymentMethodsResponse

Get payment methods that can be used to pay for sales at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

Returns:



244
245
246
247
# 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 = {}) ⇒ Array<(GetCustomPaymentMethodsResponse, Fixnum, Hash)>

Get payment methods that can be used to pay for sales at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

Returns:



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# 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 = {}) ⇒ GetGiftCardResponse

Get gift cards available for purchase at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_ids (Array<Integer>)

    Filters the results to the requested gift card IDs.&lt;br /&gt; Default: all gift cards.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    When included, returns gift cards that are sold at the provided location ID.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_sold_online (BOOLEAN)

    When &#x60;true&#x60;, only returns gift cards that are sold online.&lt;br /&gt; Default: false

Returns:



313
314
315
316
# 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 = {}) ⇒ Array<(GetGiftCardResponse, Fixnum, Hash)>

Get gift cards available for purchase at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_ids (Array<Integer>)

    Filters the results to the requested gift card IDs.&lt;br /&gt; Default: all gift cards.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    When included, returns gift cards that are sold at the provided location ID.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_sold_online (BOOLEAN)

    When &#x60;true&#x60;, only returns gift cards that are sold online.&lt;br /&gt; Default: false

Returns:

  • (Array<(GetGiftCardResponse, Fixnum, Hash)>)

    GetGiftCardResponse data, response status code and response headers



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# 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 = {}) ⇒ GetPackagesResponse

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.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_package_ids (Array<Integer>)

    A list of the packages IDs to filter by.

  • :request_sell_online (BOOLEAN)

    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

Returns:



388
389
390
391
# 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 = {}) ⇒ Array<(GetPackagesResponse, Fixnum, Hash)>

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.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_package_ids (Array<Integer>)

    A list of the packages IDs to filter by.

  • :request_sell_online (BOOLEAN)

    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

Returns:

  • (Array<(GetPackagesResponse, Fixnum, Hash)>)

    GetPackagesResponse data, response status code and response headers



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# 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 = {}) ⇒ GetProductsResponse

Get retail products available for purchase at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_category_ids (Array<Integer>)

    A list of category IDs to filter by.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    The location ID to use to determine the tax for the products that this request returns.&lt;br /&gt; Default: **online store**

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_product_ids (Array<String>)

    An ID filter for products.

  • :request_search_text (String)

    A search filter, used for searching by term.

  • :request_sell_online (BOOLEAN)

    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

  • :request_sub_category_ids (Array<Integer>)

    A list of subcategory IDs to filter by.

Returns:



465
466
467
468
# 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 = {}) ⇒ Array<(GetProductsResponse, Fixnum, Hash)>

Get retail products available for purchase at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_category_ids (Array<Integer>)

    A list of category IDs to filter by.

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    The location ID to use to determine the tax for the products that this request returns.&lt;br /&gt; Default: **online store**

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_product_ids (Array<String>)

    An ID filter for products.

  • :request_search_text (String)

    A search filter, used for searching by term.

  • :request_sell_online (BOOLEAN)

    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

  • :request_sub_category_ids (Array<Integer>)

    A list of subcategory IDs to filter by.

Returns:

  • (Array<(GetProductsResponse, Fixnum, Hash)>)

    GetProductsResponse data, response status code and response headers



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# 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 = {}) ⇒ GetSalesResponse

Get sales completed at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:



541
542
543
544
# 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 = {}) ⇒ Array<(GetSalesResponse, Fixnum, Hash)>

Get sales completed at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

  • (Array<(GetSalesResponse, Fixnum, Hash)>)

    GetSalesResponse data, response status code and response headers



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# 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 = {}) ⇒ GetServicesResponse

Get pricing options available for purchase at a site

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_class_id (Integer)

    Filters to the pricing options for the specified class ID.

  • :request_class_schedule_id (Integer)

    Filters to the pricing options for the specified class schedule ID.

  • :request_hide_related_programs (BOOLEAN)

    When &#x60;true&#x60;, indicates that pricing options of related programs are omitted from the response.&lt;br /&gt; Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    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.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_program_ids (Array<Integer>)

    Filters to pricing options with the specified program IDs.

  • :request_sell_online (BOOLEAN)

    When &#x60;true&#x60;, filters to the pricing options that can be sold online.&lt;br /&gt; Default: false

  • :request_service_ids (Array<String>)

    Filters to the pricing options with the specified IDs. In this context, service and pricing option are used interchangeably.

  • :request_session_type_ids (Array<Integer>)

    Filters to the pricing options with the specified session types IDs.

  • :request_staff_id (Integer)

    Sets &#x60;Price&#x60; and &#x60;OnlinePrice&#x60; to the particular pricing of a specific staff member, if allowed by the business.

Returns:



612
613
614
615
# 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 = {}) ⇒ Array<(GetServicesResponse, Fixnum, Hash)>

Get pricing options available for purchase at a site

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_class_id (Integer)

    Filters to the pricing options for the specified class ID.

  • :request_class_schedule_id (Integer)

    Filters to the pricing options for the specified class schedule ID.

  • :request_hide_related_programs (BOOLEAN)

    When &#x60;true&#x60;, indicates that pricing options of related programs are omitted from the response.&lt;br /&gt; Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    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.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_program_ids (Array<Integer>)

    Filters to pricing options with the specified program IDs.

  • :request_sell_online (BOOLEAN)

    When &#x60;true&#x60;, filters to the pricing options that can be sold online.&lt;br /&gt; Default: false

  • :request_service_ids (Array<String>)

    Filters to the pricing options with the specified IDs. In this context, service and pricing option are used interchangeably.

  • :request_session_type_ids (Array<Integer>)

    Filters to the pricing options with the specified session types IDs.

  • :request_staff_id (Integer)

    Sets &#x60;Price&#x60; and &#x60;OnlinePrice&#x60; to the particular pricing of a specific staff member, if allowed by the business.

Returns:

  • (Array<(GetServicesResponse, Fixnum, Hash)>)

    GetServicesResponse data, response status code and response headers



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# 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 = {}) ⇒ PurchaseContractResponse

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:



696
697
698
699
# 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 = {}) ⇒ Array<(PurchaseContractResponse, Fixnum, Hash)>

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

  • (Array<(PurchaseContractResponse, Fixnum, Hash)>)

    PurchaseContractResponse data, response status code and response headers



709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# 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 = {}) ⇒ PurchaseGiftCardResponse

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:



766
767
768
769
# 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 = {}) ⇒ Array<(PurchaseGiftCardResponse, Fixnum, Hash)>

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.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

  • (Array<(PurchaseGiftCardResponse, Fixnum, Hash)>)

    PurchaseGiftCardResponse data, response status code and response headers



779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
# 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