Class: UltracartClient::ItemApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/item_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ItemApi

Returns a new instance of ItemApi.



19
20
21
# File 'lib/ultracart_api/api/item_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/ultracart_api/api/item_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/item_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::ItemApi.new(api_client)
end

Instance Method Details

#delete_digital_item(digital_item_oid, opts = {}) ⇒ nil

Delete a digital item, which is a file within the digital library, not an actual merchant item Delete a digital item on the UltraCart account.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to delete.

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

    the optional parameters

Returns:

  • (nil)


40
41
42
43
# File 'lib/ultracart_api/api/item_api.rb', line 40

def delete_digital_item(digital_item_oid, opts = {})
  delete_digital_item_with_http_info(digital_item_oid, opts)
  nil
end

#delete_digital_item_with_http_info(digital_item_oid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a digital item, which is a file within the digital library, not an actual merchant item Delete a digital item on the UltraCart account.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to delete.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
92
93
94
95
96
97
# File 'lib/ultracart_api/api/item_api.rb', line 50

def delete_digital_item_with_http_info(digital_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.delete_digital_item ...'
  end
  # verify the required parameter 'digital_item_oid' is set
  if @api_client.config.client_side_validation && digital_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'digital_item_oid' when calling ItemApi.delete_digital_item"
  end
  # resource path
  local_var_path = '/item/digital_library/{digital_item_oid}'.sub('{' + 'digital_item_oid' + '}', CGI.escape(digital_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.delete_digital_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#delete_digital_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_item(merchant_item_oid, opts = {}) ⇒ nil

Delete an item Delete an item on the UltraCart account.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to delete.

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

    the optional parameters

Returns:

  • (nil)


104
105
106
107
# File 'lib/ultracart_api/api/item_api.rb', line 104

def delete_item(merchant_item_oid, opts = {})
  delete_item_with_http_info(merchant_item_oid, opts)
  nil
end

#delete_item_with_http_info(merchant_item_oid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an item Delete an item on the UltraCart account.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to delete.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
154
155
156
157
158
159
160
161
# File 'lib/ultracart_api/api/item_api.rb', line 114

def delete_item_with_http_info(merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.delete_item ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.delete_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.delete_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_review(review_oid, merchant_item_oid, opts = {}) ⇒ nil

Delete a review Delete an item review.

Parameters:

  • review_oid (Integer)

    The review oid to delete.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:

  • (nil)


169
170
171
172
# File 'lib/ultracart_api/api/item_api.rb', line 169

def delete_review(review_oid, merchant_item_oid, opts = {})
  delete_review_with_http_info(review_oid, merchant_item_oid, opts)
  nil
end

#delete_review_with_http_info(review_oid, merchant_item_oid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a review Delete an item review.

Parameters:

  • review_oid (Integer)

    The review oid to delete.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



180
181
182
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
# File 'lib/ultracart_api/api/item_api.rb', line 180

def delete_review_with_http_info(review_oid, merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.delete_review ...'
  end
  # verify the required parameter 'review_oid' is set
  if @api_client.config.client_side_validation && review_oid.nil?
    fail ArgumentError, "Missing the required parameter 'review_oid' when calling ItemApi.delete_review"
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.delete_review"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/reviews/{review_oid}'.sub('{' + 'review_oid' + '}', CGI.escape(review_oid.to_s)).sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.delete_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#delete_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_digital_item(digital_item_oid, opts = {}) ⇒ ItemDigitalItemResponse

Retrieve a digital item from the digital library, which are digital files that may be attached to normal items Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to retrieve.

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

    the optional parameters

Returns:



238
239
240
241
# File 'lib/ultracart_api/api/item_api.rb', line 238

def get_digital_item(digital_item_oid, opts = {})
  data, _status_code, _headers = get_digital_item_with_http_info(digital_item_oid, opts)
  data
end

#get_digital_item_with_http_info(digital_item_oid, opts = {}) ⇒ Array<(ItemDigitalItemResponse, Integer, Hash)>

Retrieve a digital item from the digital library, which are digital files that may be attached to normal items Retrieves a digital item (file information) from the account. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to retrieve.

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

    the optional parameters

Returns:

  • (Array<(ItemDigitalItemResponse, Integer, Hash)>)

    ItemDigitalItemResponse data, response status code and response headers



248
249
250
251
252
253
254
255
256
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
# File 'lib/ultracart_api/api/item_api.rb', line 248

def get_digital_item_with_http_info(digital_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_digital_item ...'
  end
  # verify the required parameter 'digital_item_oid' is set
  if @api_client.config.client_side_validation && digital_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'digital_item_oid' when calling ItemApi.get_digital_item"
  end
  # resource path
  local_var_path = '/item/digital_library/{digital_item_oid}'.sub('{' + 'digital_item_oid' + '}', CGI.escape(digital_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_digital_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_digital_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_digital_items(opts = {}) ⇒ ItemDigitalItemsResponse

Retrieve digital items from the digital library which are digital files that may be attached to normal items Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



307
308
309
310
# File 'lib/ultracart_api/api/item_api.rb', line 307

def get_digital_items(opts = {})
  data, _status_code, _headers = get_digital_items_with_http_info(opts)
  data
end

#get_digital_items_by_external_id(external_id, opts = {}) ⇒ ItemDigitalItemsResponse

Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.

Parameters:

  • external_id (String)

    The external id to match against.

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

    the optional parameters

Returns:



378
379
380
381
# File 'lib/ultracart_api/api/item_api.rb', line 378

def get_digital_items_by_external_id(external_id, opts = {})
  data, _status_code, _headers = get_digital_items_by_external_id_with_http_info(external_id, opts)
  data
end

#get_digital_items_by_external_id_with_http_info(external_id, opts = {}) ⇒ Array<(ItemDigitalItemsResponse, Integer, Hash)>

Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items.

Parameters:

  • external_id (String)

    The external id to match against.

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

    the optional parameters

Returns:

  • (Array<(ItemDigitalItemsResponse, Integer, Hash)>)

    ItemDigitalItemsResponse data, response status code and response headers



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
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
# File 'lib/ultracart_api/api/item_api.rb', line 388

def get_digital_items_by_external_id_with_http_info(external_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_digital_items_by_external_id ...'
  end
  # verify the required parameter 'external_id' is set
  if @api_client.config.client_side_validation && external_id.nil?
    fail ArgumentError, "Missing the required parameter 'external_id' when calling ItemApi.get_digital_items_by_external_id"
  end
  # resource path
  local_var_path = '/item/digital_library/by_external/{external_id}'.sub('{' + 'external_id' + '}', CGI.escape(external_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_digital_items_by_external_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_digital_items_by_external_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_digital_items_with_http_info(opts = {}) ⇒ Array<(ItemDigitalItemsResponse, Integer, Hash)>

Retrieve digital items from the digital library which are digital files that may be attached to normal items Retrieves a group of digital items (file information) from the account. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemDigitalItemsResponse, Integer, Hash)>)

    ItemDigitalItemsResponse data, response status code and response headers



322
323
324
325
326
327
328
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
# File 'lib/ultracart_api/api/item_api.rb', line 322

def get_digital_items_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_digital_items ...'
  end
  # resource path
  local_var_path = '/item/digital_library'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_digital_items",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_digital_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_inventory_snapshot(opts = {}) ⇒ ItemInventorySnapshotResponse

Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response. Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.

Parameters:

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

    the optional parameters

Returns:



441
442
443
444
# File 'lib/ultracart_api/api/item_api.rb', line 441

def get_inventory_snapshot(opts = {})
  data, _status_code, _headers = get_inventory_snapshot_with_http_info(opts)
  data
end

#get_inventory_snapshot_with_http_info(opts = {}) ⇒ Array<(ItemInventorySnapshotResponse, Integer, Hash)>

Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response. Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.

Parameters:

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

    the optional parameters

Returns:



450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/ultracart_api/api/item_api.rb', line 450

def get_inventory_snapshot_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_inventory_snapshot ...'
  end
  # resource path
  local_var_path = '/item/items/inventory_snapshot'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemInventorySnapshotResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_inventory_snapshot",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_inventory_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_item(merchant_item_oid, opts = {}) ⇒ ItemResponse

Retrieve an item Retrieves a single item using the specified item oid.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



502
503
504
505
# File 'lib/ultracart_api/api/item_api.rb', line 502

def get_item(merchant_item_oid, opts = {})
  data, _status_code, _headers = get_item_with_http_info(merchant_item_oid, opts)
  data
end

#get_item_by_merchant_item_id(merchant_item_id, opts = {}) ⇒ ItemResponse

Retrieve an item by item id Retrieves a single item using the specified item id.

Parameters:

  • merchant_item_id (String)

    The item id to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



572
573
574
575
# File 'lib/ultracart_api/api/item_api.rb', line 572

def get_item_by_merchant_item_id(merchant_item_id, opts = {})
  data, _status_code, _headers = get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
  data
end

#get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts = {}) ⇒ Array<(ItemResponse, Integer, Hash)>

Retrieve an item by item id Retrieves a single item using the specified item id.

Parameters:

  • merchant_item_id (String)

    The item id to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Integer, Hash)>)

    ItemResponse data, response status code and response headers



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
# File 'lib/ultracart_api/api/item_api.rb', line 584

def get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_item_by_merchant_item_id ...'
  end
  # verify the required parameter 'merchant_item_id' is set
  if @api_client.config.client_side_validation && merchant_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_id' when calling ItemApi.get_item_by_merchant_item_id"
  end
  # resource path
  local_var_path = '/item/items/merchant_item_id/{merchant_item_id}'.sub('{' + 'merchant_item_id' + '}', CGI.escape(merchant_item_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_item_by_merchant_item_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_item_by_merchant_item_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_item_with_http_info(merchant_item_oid, opts = {}) ⇒ Array<(ItemResponse, Integer, Hash)>

Retrieve an item Retrieves a single item using the specified item oid.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Integer, Hash)>)

    ItemResponse data, response status code and response headers



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/ultracart_api/api/item_api.rb', line 514

def get_item_with_http_info(merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_item ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_items(opts = {}) ⇒ ItemsResponse

Retrieve items Retrieves a group of items from the account. If no parameters are specified, all items will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :parent_category_id (Integer)

    The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root

  • :parent_category_path (String)

    The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



647
648
649
650
# File 'lib/ultracart_api/api/item_api.rb', line 647

def get_items(opts = {})
  data, _status_code, _headers = get_items_with_http_info(opts)
  data
end

#get_items_with_http_info(opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>

Retrieve items Retrieves a group of items from the account. If no parameters are specified, all items will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :parent_category_id (Integer)

    The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root

  • :parent_category_path (String)

    The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemsResponse, Integer, Hash)>)

    ItemsResponse data, response status code and response headers



664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/ultracart_api/api/item_api.rb', line 664

def get_items_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_items ...'
  end
  # resource path
  local_var_path = '/item/items'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'parent_category_id'] = opts[:'parent_category_id'] if !opts[:'parent_category_id'].nil?
  query_params[:'parent_category_path'] = opts[:'parent_category_path'] if !opts[:'parent_category_path'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_items",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_pricing_tiers(opts = {}) ⇒ PricingTiersResponse

Retrieve pricing tiers Retrieves the pricing tiers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



722
723
724
725
# File 'lib/ultracart_api/api/item_api.rb', line 722

def get_pricing_tiers(opts = {})
  data, _status_code, _headers = get_pricing_tiers_with_http_info(opts)
  data
end

#get_pricing_tiers_with_http_info(opts = {}) ⇒ Array<(PricingTiersResponse, Integer, Hash)>

Retrieve pricing tiers Retrieves the pricing tiers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(PricingTiersResponse, Integer, Hash)>)

    PricingTiersResponse data, response status code and response headers



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
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/ultracart_api/api/item_api.rb', line 732

def get_pricing_tiers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_pricing_tiers ...'
  end
  # resource path
  local_var_path = '/item/pricing_tiers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PricingTiersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_pricing_tiers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_pricing_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_review(review_oid, merchant_item_oid, opts = {}) ⇒ ItemReviewResponse

Get a review Retrieve an item review.

Parameters:

  • review_oid (Integer)

    The review oid to retrieve.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:



784
785
786
787
# File 'lib/ultracart_api/api/item_api.rb', line 784

def get_review(review_oid, merchant_item_oid, opts = {})
  data, _status_code, _headers = get_review_with_http_info(review_oid, merchant_item_oid, opts)
  data
end

#get_review_with_http_info(review_oid, merchant_item_oid, opts = {}) ⇒ Array<(ItemReviewResponse, Integer, Hash)>

Get a review Retrieve an item review.

Parameters:

  • review_oid (Integer)

    The review oid to retrieve.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:

  • (Array<(ItemReviewResponse, Integer, Hash)>)

    ItemReviewResponse data, response status code and response headers



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
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
# File 'lib/ultracart_api/api/item_api.rb', line 795

def get_review_with_http_info(review_oid, merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_review ...'
  end
  # verify the required parameter 'review_oid' is set
  if @api_client.config.client_side_validation && review_oid.nil?
    fail ArgumentError, "Missing the required parameter 'review_oid' when calling ItemApi.get_review"
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_review"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/reviews/{review_oid}'.sub('{' + 'review_oid' + '}', CGI.escape(review_oid.to_s)).sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemReviewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reviews(merchant_item_oid, opts = {}) ⇒ ItemReviewsResponse

Get reviews for an item Retrieve item reviews.

Parameters:

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:



853
854
855
856
# File 'lib/ultracart_api/api/item_api.rb', line 853

def get_reviews(merchant_item_oid, opts = {})
  data, _status_code, _headers = get_reviews_with_http_info(merchant_item_oid, opts)
  data
end

#get_reviews_with_http_info(merchant_item_oid, opts = {}) ⇒ Array<(ItemReviewsResponse, Integer, Hash)>

Get reviews for an item Retrieve item reviews.

Parameters:

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

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

    the optional parameters

Returns:

  • (Array<(ItemReviewsResponse, Integer, Hash)>)

    ItemReviewsResponse data, response status code and response headers



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
# File 'lib/ultracart_api/api/item_api.rb', line 863

def get_reviews_with_http_info(merchant_item_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_reviews ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.get_reviews"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/reviews'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemReviewsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_reviews",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unassociated_digital_items(opts = {}) ⇒ ItemDigitalItemsResponse

Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items Retrieves a group of digital items (file information) from the account that are not yet associated with any actual items. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



922
923
924
925
# File 'lib/ultracart_api/api/item_api.rb', line 922

def get_unassociated_digital_items(opts = {})
  data, _status_code, _headers = get_unassociated_digital_items_with_http_info(opts)
  data
end

#get_unassociated_digital_items_with_http_info(opts = {}) ⇒ Array<(ItemDigitalItemsResponse, Integer, Hash)>

Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items Retrieves a group of digital items (file information) from the account that are not yet associated with any actual items. If no parameters are specified, all digital items will be returned. Be aware that these are not normal items that can be added to a shopping cart. Rather, they are digital files that may be associated with normal items. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Default 100, Max 2000) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch items that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemDigitalItemsResponse, Integer, Hash)>)

    ItemDigitalItemsResponse data, response status code and response headers



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
# File 'lib/ultracart_api/api/item_api.rb', line 937

def get_unassociated_digital_items_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.get_unassociated_digital_items ...'
  end
  # resource path
  local_var_path = '/item/digital_library/unassociated'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.get_unassociated_digital_items",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#get_unassociated_digital_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_digital_item(digital_item, opts = {}) ⇒ ItemDigitalItemResponse

Create a file within the digital library Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.

Parameters:

  • digital_item (ItemDigitalItem)

    Digital item to create

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

    the optional parameters

Returns:



993
994
995
996
# File 'lib/ultracart_api/api/item_api.rb', line 993

def insert_digital_item(digital_item, opts = {})
  data, _status_code, _headers = insert_digital_item_with_http_info(digital_item, opts)
  data
end

#insert_digital_item_with_http_info(digital_item, opts = {}) ⇒ Array<(ItemDigitalItemResponse, Integer, Hash)>

Create a file within the digital library Create a file within the digital library. This does not create an item, but makes this digital file available and selectable as part (or all) of an item.

Parameters:

  • digital_item (ItemDigitalItem)

    Digital item to create

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

    the optional parameters

Returns:

  • (Array<(ItemDigitalItemResponse, Integer, Hash)>)

    ItemDigitalItemResponse data, response status code and response headers



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
# File 'lib/ultracart_api/api/item_api.rb', line 1003

def insert_digital_item_with_http_info(digital_item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.insert_digital_item ...'
  end
  # verify the required parameter 'digital_item' is set
  if @api_client.config.client_side_validation && digital_item.nil?
    fail ArgumentError, "Missing the required parameter 'digital_item' when calling ItemApi.insert_digital_item"
  end
  # resource path
  local_var_path = '/item/digital_library'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(digital_item)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.insert_digital_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#insert_digital_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_item(item, opts = {}) ⇒ ItemResponse

Create an item Create a new item on the UltraCart account.

Parameters:

  • item (Item)

    Item to create

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



1064
1065
1066
1067
# File 'lib/ultracart_api/api/item_api.rb', line 1064

def insert_item(item, opts = {})
  data, _status_code, _headers = insert_item_with_http_info(item, opts)
  data
end

#insert_item_with_http_info(item, opts = {}) ⇒ Array<(ItemResponse, Integer, Hash)>

Create an item Create a new item on the UltraCart account.

Parameters:

  • item (Item)

    Item to create

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Integer, Hash)>)

    ItemResponse data, response status code and response headers



1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'lib/ultracart_api/api/item_api.rb', line 1076

def insert_item_with_http_info(item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.insert_item ...'
  end
  # verify the required parameter 'item' is set
  if @api_client.config.client_side_validation && item.nil?
    fail ArgumentError, "Missing the required parameter 'item' when calling ItemApi.insert_item"
  end
  # resource path
  local_var_path = '/item/items'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(item)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.insert_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#insert_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_review(merchant_item_oid, review, opts = {}) ⇒ ItemReviewResponse

Insert a review Insert a item review.

Parameters:

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

  • review (ItemReview)

    Review to insert

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

    the optional parameters

Returns:



1138
1139
1140
1141
# File 'lib/ultracart_api/api/item_api.rb', line 1138

def insert_review(merchant_item_oid, review, opts = {})
  data, _status_code, _headers = insert_review_with_http_info(merchant_item_oid, review, opts)
  data
end

#insert_review_with_http_info(merchant_item_oid, review, opts = {}) ⇒ Array<(ItemReviewResponse, Integer, Hash)>

Insert a review Insert a item review.

Parameters:

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

  • review (ItemReview)

    Review to insert

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

    the optional parameters

Returns:

  • (Array<(ItemReviewResponse, Integer, Hash)>)

    ItemReviewResponse data, response status code and response headers



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
# File 'lib/ultracart_api/api/item_api.rb', line 1149

def insert_review_with_http_info(merchant_item_oid, review, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.insert_review ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.insert_review"
  end
  # verify the required parameter 'review' is set
  if @api_client.config.client_side_validation && review.nil?
    fail ArgumentError, "Missing the required parameter 'review' when calling ItemApi.insert_review"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/reviews'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(review)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemReviewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.insert_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#insert_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_update_item_content_attribute(merchant_item_oid, item_attribute, opts = {}) ⇒ nil

Upsert an item content attribute Update an item content attribute, creating it new if it does not yet exist.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to modify.

  • item_attribute (ItemContentAttribute)

    Item content attribute to upsert

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

    the optional parameters

Returns:

  • (nil)


1213
1214
1215
1216
# File 'lib/ultracart_api/api/item_api.rb', line 1213

def insert_update_item_content_attribute(merchant_item_oid, item_attribute, opts = {})
  insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute, opts)
  nil
end

#insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Upsert an item content attribute Update an item content attribute, creating it new if it does not yet exist.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to modify.

  • item_attribute (ItemContentAttribute)

    Item content attribute to upsert

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
# File 'lib/ultracart_api/api/item_api.rb', line 1224

def insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.insert_update_item_content_attribute ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.insert_update_item_content_attribute"
  end
  # verify the required parameter 'item_attribute' is set
  if @api_client.config.client_side_validation && item_attribute.nil?
    fail ArgumentError, "Missing the required parameter 'item_attribute' when calling ItemApi.insert_update_item_content_attribute"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/content/attributes'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(item_attribute)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.insert_update_item_content_attribute",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#insert_update_item_content_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_digital_item(digital_item_oid, digital_item, opts = {}) ⇒ ItemDigitalItemResponse

Updates a file within the digital library Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to update.

  • digital_item (ItemDigitalItem)

    Digital item to update

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

    the optional parameters

Returns:



1288
1289
1290
1291
# File 'lib/ultracart_api/api/item_api.rb', line 1288

def update_digital_item(digital_item_oid, digital_item, opts = {})
  data, _status_code, _headers = update_digital_item_with_http_info(digital_item_oid, digital_item, opts)
  data
end

#update_digital_item_with_http_info(digital_item_oid, digital_item, opts = {}) ⇒ Array<(ItemDigitalItemResponse, Integer, Hash)>

Updates a file within the digital library Updates a file within the digital library. This does not update an item, but updates a digital file available and selectable as part (or all) of an item.

Parameters:

  • digital_item_oid (Integer)

    The digital item oid to update.

  • digital_item (ItemDigitalItem)

    Digital item to update

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

    the optional parameters

Returns:

  • (Array<(ItemDigitalItemResponse, Integer, Hash)>)

    ItemDigitalItemResponse data, response status code and response headers



1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
# File 'lib/ultracart_api/api/item_api.rb', line 1299

def update_digital_item_with_http_info(digital_item_oid, digital_item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_digital_item ...'
  end
  # verify the required parameter 'digital_item_oid' is set
  if @api_client.config.client_side_validation && digital_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'digital_item_oid' when calling ItemApi.update_digital_item"
  end
  # verify the required parameter 'digital_item' is set
  if @api_client.config.client_side_validation && digital_item.nil?
    fail ArgumentError, "Missing the required parameter 'digital_item' when calling ItemApi.update_digital_item"
  end
  # resource path
  local_var_path = '/item/digital_library/{digital_item_oid}'.sub('{' + 'digital_item_oid' + '}', CGI.escape(digital_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(digital_item)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemDigitalItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.update_digital_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_digital_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_item(merchant_item_oid, item, opts = {}) ⇒ ItemResponse

Update an item Update a new item on the UltraCart account.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to update.

  • item (Item)

    Item to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:



1365
1366
1367
1368
# File 'lib/ultracart_api/api/item_api.rb', line 1365

def update_item(merchant_item_oid, item, opts = {})
  data, _status_code, _headers = update_item_with_http_info(merchant_item_oid, item, opts)
  data
end

#update_item_with_http_info(merchant_item_oid, item, opts = {}) ⇒ Array<(ItemResponse, Integer, Hash)>

Update an item Update a new item on the UltraCart account.

Parameters:

  • merchant_item_oid (Integer)

    The item oid to update.

  • item (Item)

    Item to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

Returns:

  • (Array<(ItemResponse, Integer, Hash)>)

    ItemResponse data, response status code and response headers



1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
# File 'lib/ultracart_api/api/item_api.rb', line 1378

def update_item_with_http_info(merchant_item_oid, item, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_item ...'
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.update_item"
  end
  # verify the required parameter 'item' is set
  if @api_client.config.client_side_validation && item.nil?
    fail ArgumentError, "Missing the required parameter 'item' when calling ItemApi.update_item"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}'.sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(item)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.update_item",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_items(items_request, opts = {}) ⇒ ItemsResponse

Update multiple items Update multiple item on the UltraCart account.

Parameters:

  • items_request (ItemsRequest)

    Items to update (synchronous maximum 20 / asynchronous maximum 100)

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (Boolean)

    True if the operation should be run async. No result returned

Returns:



1446
1447
1448
1449
# File 'lib/ultracart_api/api/item_api.rb', line 1446

def update_items(items_request, opts = {})
  data, _status_code, _headers = update_items_with_http_info(items_request, opts)
  data
end

#update_items_with_http_info(items_request, opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>

Update multiple items Update multiple item on the UltraCart account.

Parameters:

  • items_request (ItemsRequest)

    Items to update (synchronous maximum 20 / asynchronous maximum 100)

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

  • :_placeholders (Boolean)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (Boolean)

    True if the operation should be run async. No result returned

Returns:

  • (Array<(ItemsResponse, Integer, Hash)>)

    ItemsResponse data, response status code and response headers



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
# File 'lib/ultracart_api/api/item_api.rb', line 1459

def update_items_with_http_info(items_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_items ...'
  end
  # verify the required parameter 'items_request' is set
  if @api_client.config.client_side_validation && items_request.nil?
    fail ArgumentError, "Missing the required parameter 'items_request' when calling ItemApi.update_items"
  end
  # resource path
  local_var_path = '/item/items/batch'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
  query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?
  query_params[:'_async'] = opts[:'_async'] if !opts[:'_async'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(items_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.update_items",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_review(review_oid, merchant_item_oid, review, opts = {}) ⇒ ItemReviewResponse

Update a review Update an item review.

Parameters:

  • review_oid (Integer)

    The review oid to update.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

  • review (ItemReview)

    Review to update

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

    the optional parameters

Returns:



1523
1524
1525
1526
# File 'lib/ultracart_api/api/item_api.rb', line 1523

def update_review(review_oid, merchant_item_oid, review, opts = {})
  data, _status_code, _headers = update_review_with_http_info(review_oid, merchant_item_oid, review, opts)
  data
end

#update_review_with_http_info(review_oid, merchant_item_oid, review, opts = {}) ⇒ Array<(ItemReviewResponse, Integer, Hash)>

Update a review Update an item review.

Parameters:

  • review_oid (Integer)

    The review oid to update.

  • merchant_item_oid (Integer)

    The item oid the review is associated with.

  • review (ItemReview)

    Review to update

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

    the optional parameters

Returns:

  • (Array<(ItemReviewResponse, Integer, Hash)>)

    ItemReviewResponse data, response status code and response headers



1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
# File 'lib/ultracart_api/api/item_api.rb', line 1535

def update_review_with_http_info(review_oid, merchant_item_oid, review, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.update_review ...'
  end
  # verify the required parameter 'review_oid' is set
  if @api_client.config.client_side_validation && review_oid.nil?
    fail ArgumentError, "Missing the required parameter 'review_oid' when calling ItemApi.update_review"
  end
  # verify the required parameter 'merchant_item_oid' is set
  if @api_client.config.client_side_validation && merchant_item_oid.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_item_oid' when calling ItemApi.update_review"
  end
  # verify the required parameter 'review' is set
  if @api_client.config.client_side_validation && review.nil?
    fail ArgumentError, "Missing the required parameter 'review' when calling ItemApi.update_review"
  end
  # resource path
  local_var_path = '/item/items/{merchant_item_oid}/reviews/{review_oid}'.sub('{' + 'review_oid' + '}', CGI.escape(review_oid.to_s)).sub('{' + 'merchant_item_oid' + '}', CGI.escape(merchant_item_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(review)

  # return_type
  return_type = opts[:debug_return_type] || 'ItemReviewResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.update_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#update_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_temporary_multimedia(file, opts = {}) ⇒ TempMultimediaResponse

Upload an image to the temporary multimedia. Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.

Parameters:

  • file (File)

    File to upload

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

    the optional parameters

Returns:



1602
1603
1604
1605
# File 'lib/ultracart_api/api/item_api.rb', line 1602

def upload_temporary_multimedia(file, opts = {})
  data, _status_code, _headers = upload_temporary_multimedia_with_http_info(file, opts)
  data
end

#upload_temporary_multimedia_with_http_info(file, opts = {}) ⇒ Array<(TempMultimediaResponse, Integer, Hash)>

Upload an image to the temporary multimedia. Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.

Parameters:

  • file (File)

    File to upload

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

    the optional parameters

Returns:

  • (Array<(TempMultimediaResponse, Integer, Hash)>)

    TempMultimediaResponse data, response status code and response headers



1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
# File 'lib/ultracart_api/api/item_api.rb', line 1612

def upload_temporary_multimedia_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ItemApi.upload_temporary_multimedia ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling ItemApi.upload_temporary_multimedia"
  end
  # resource path
  local_var_path = '/item/temp_multimedia'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TempMultimediaResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ItemApi.upload_temporary_multimedia",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ItemApi#upload_temporary_multimedia\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end