ultracart_api 4.1.12 → 4.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/docs/ItemApi.md CHANGED
@@ -1,1746 +1,2174 @@
1
- # UltracartClient::ItemApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**delete_digital_item**](ItemApi.md#delete_digital_item) | **DELETE** /item/digital_library/{digital_item_oid} | Delete a digital item, which is a file within the digital library, not an actual merchant item |
8
- | [**delete_item**](ItemApi.md#delete_item) | **DELETE** /item/items/{merchant_item_oid} | Delete an item |
9
- | [**delete_review**](ItemApi.md#delete_review) | **DELETE** /item/items/{merchant_item_oid}/reviews/{review_oid} | Delete a review |
10
- | [**get_digital_item**](ItemApi.md#get_digital_item) | **GET** /item/digital_library/{digital_item_oid} | Retrieve a digital item from the digital library, which are digital files that may be attached to normal items |
11
- | [**get_digital_items**](ItemApi.md#get_digital_items) | **GET** /item/digital_library | Retrieve digital items from the digital library which are digital files that may be attached to normal items |
12
- | [**get_digital_items_by_external_id**](ItemApi.md#get_digital_items_by_external_id) | **GET** /item/digital_library/by_external/{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 |
13
- | [**get_inventory_snapshot**](ItemApi.md#get_inventory_snapshot) | **GET** /item/items/inventory_snapshot | Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response. |
14
- | [**get_item**](ItemApi.md#get_item) | **GET** /item/items/{merchant_item_oid} | Retrieve an item |
15
- | [**get_item_by_merchant_item_id**](ItemApi.md#get_item_by_merchant_item_id) | **GET** /item/items/merchant_item_id/{merchant_item_id} | Retrieve an item by item id |
16
- | [**get_items**](ItemApi.md#get_items) | **GET** /item/items | Retrieve items |
17
- | [**get_pricing_tiers**](ItemApi.md#get_pricing_tiers) | **GET** /item/pricing_tiers | Retrieve pricing tiers |
18
- | [**get_review**](ItemApi.md#get_review) | **GET** /item/items/{merchant_item_oid}/reviews/{review_oid} | Get a review |
19
- | [**get_reviews**](ItemApi.md#get_reviews) | **GET** /item/items/{merchant_item_oid}/reviews | Get reviews for an item |
20
- | [**get_unassociated_digital_items**](ItemApi.md#get_unassociated_digital_items) | **GET** /item/digital_library/unassociated | Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items |
21
- | [**insert_digital_item**](ItemApi.md#insert_digital_item) | **POST** /item/digital_library | Create a file within the digital library |
22
- | [**insert_item**](ItemApi.md#insert_item) | **POST** /item/items | Create an item |
23
- | [**insert_review**](ItemApi.md#insert_review) | **POST** /item/items/{merchant_item_oid}/reviews | Insert a review |
24
- | [**insert_update_item_content_attribute**](ItemApi.md#insert_update_item_content_attribute) | **POST** /item/items/{merchant_item_oid}/content/attributes | Upsert an item content attribute |
25
- | [**update_digital_item**](ItemApi.md#update_digital_item) | **PUT** /item/digital_library/{digital_item_oid} | Updates a file within the digital library |
26
- | [**update_item**](ItemApi.md#update_item) | **PUT** /item/items/{merchant_item_oid} | Update an item |
27
- | [**update_items**](ItemApi.md#update_items) | **PUT** /item/items/batch | Update multiple items |
28
- | [**update_review**](ItemApi.md#update_review) | **PUT** /item/items/{merchant_item_oid}/reviews/{review_oid} | Update a review |
29
- | [**upload_temporary_multimedia**](ItemApi.md#upload_temporary_multimedia) | **POST** /item/temp_multimedia | Upload an image to the temporary multimedia. |
30
-
31
-
32
- ## delete_digital_item
33
-
34
- > delete_digital_item(digital_item_oid)
35
-
36
- Delete a digital item, which is a file within the digital library, not an actual merchant item
37
-
38
- Delete a digital item on the UltraCart account.
39
-
40
- ### Examples
41
-
42
- ```ruby
43
- require 'time'
44
- require 'ultracart_api'
45
- require 'json'
46
- require 'yaml'
47
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
48
-
49
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
50
- # As such, this might not be the best way to use this object.
51
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
52
-
53
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
54
- digital_item_oid = 56 # Integer | The digital item oid to delete.
55
-
56
- begin
57
- # Delete a digital item, which is a file within the digital library, not an actual merchant item
58
- api_instance.delete_digital_item(digital_item_oid)
59
- rescue UltracartClient::ApiError => e
60
- puts "Error when calling ItemApi->delete_digital_item: #{e}"
61
- end
62
- ```
63
-
64
- #### Using the delete_digital_item_with_http_info variant
65
-
66
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
67
-
68
- > <Array(nil, Integer, Hash)> delete_digital_item_with_http_info(digital_item_oid)
69
-
70
- ```ruby
71
- begin
72
- # Delete a digital item, which is a file within the digital library, not an actual merchant item
73
- data, status_code, headers = api_instance.delete_digital_item_with_http_info(digital_item_oid)
74
- p status_code # => 2xx
75
- p headers # => { ... }
76
- p data # => nil
77
- rescue UltracartClient::ApiError => e
78
- puts "Error when calling ItemApi->delete_digital_item_with_http_info: #{e}"
79
- end
80
- ```
81
-
82
- ### Parameters
83
-
84
- | Name | Type | Description | Notes |
85
- | ---- | ---- | ----------- | ----- |
86
- | **digital_item_oid** | **Integer** | The digital item oid to delete. | |
87
-
88
- ### Return type
89
-
90
- nil (empty response body)
91
-
92
- ### Authorization
93
-
94
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
95
-
96
- ### HTTP request headers
97
-
98
- - **Content-Type**: Not defined
99
- - **Accept**: application/json
100
-
101
-
102
- ## delete_item
103
-
104
- > delete_item(merchant_item_oid)
105
-
106
- Delete an item
107
-
108
- Delete an item on the UltraCart account.
109
-
110
- ### Examples
111
-
112
- ```ruby
113
- require 'time'
114
- require 'ultracart_api'
115
- require 'json'
116
- require 'yaml'
117
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
118
-
119
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
120
- # As such, this might not be the best way to use this object.
121
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
122
-
123
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
124
- merchant_item_oid = 56 # Integer | The item oid to delete.
125
-
126
- begin
127
- # Delete an item
128
- api_instance.delete_item(merchant_item_oid)
129
- rescue UltracartClient::ApiError => e
130
- puts "Error when calling ItemApi->delete_item: #{e}"
131
- end
132
- ```
133
-
134
- #### Using the delete_item_with_http_info variant
135
-
136
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
137
-
138
- > <Array(nil, Integer, Hash)> delete_item_with_http_info(merchant_item_oid)
139
-
140
- ```ruby
141
- begin
142
- # Delete an item
143
- data, status_code, headers = api_instance.delete_item_with_http_info(merchant_item_oid)
144
- p status_code # => 2xx
145
- p headers # => { ... }
146
- p data # => nil
147
- rescue UltracartClient::ApiError => e
148
- puts "Error when calling ItemApi->delete_item_with_http_info: #{e}"
149
- end
150
- ```
151
-
152
- ### Parameters
153
-
154
- | Name | Type | Description | Notes |
155
- | ---- | ---- | ----------- | ----- |
156
- | **merchant_item_oid** | **Integer** | The item oid to delete. | |
157
-
158
- ### Return type
159
-
160
- nil (empty response body)
161
-
162
- ### Authorization
163
-
164
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
165
-
166
- ### HTTP request headers
167
-
168
- - **Content-Type**: Not defined
169
- - **Accept**: application/json
170
-
171
-
172
- ## delete_review
173
-
174
- > delete_review(review_oid, merchant_item_oid)
175
-
176
- Delete a review
177
-
178
- Delete an item review.
179
-
180
- ### Examples
181
-
182
- ```ruby
183
- require 'time'
184
- require 'ultracart_api'
185
- require 'json'
186
- require 'yaml'
187
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
188
-
189
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
190
- # As such, this might not be the best way to use this object.
191
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
192
-
193
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
194
- review_oid = 56 # Integer | The review oid to delete.
195
- merchant_item_oid = 56 # Integer | The item oid the review is associated with.
196
-
197
- begin
198
- # Delete a review
199
- api_instance.delete_review(review_oid, merchant_item_oid)
200
- rescue UltracartClient::ApiError => e
201
- puts "Error when calling ItemApi->delete_review: #{e}"
202
- end
203
- ```
204
-
205
- #### Using the delete_review_with_http_info variant
206
-
207
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
208
-
209
- > <Array(nil, Integer, Hash)> delete_review_with_http_info(review_oid, merchant_item_oid)
210
-
211
- ```ruby
212
- begin
213
- # Delete a review
214
- data, status_code, headers = api_instance.delete_review_with_http_info(review_oid, merchant_item_oid)
215
- p status_code # => 2xx
216
- p headers # => { ... }
217
- p data # => nil
218
- rescue UltracartClient::ApiError => e
219
- puts "Error when calling ItemApi->delete_review_with_http_info: #{e}"
220
- end
221
- ```
222
-
223
- ### Parameters
224
-
225
- | Name | Type | Description | Notes |
226
- | ---- | ---- | ----------- | ----- |
227
- | **review_oid** | **Integer** | The review oid to delete. | |
228
- | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
229
-
230
- ### Return type
231
-
232
- nil (empty response body)
233
-
234
- ### Authorization
235
-
236
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
237
-
238
- ### HTTP request headers
239
-
240
- - **Content-Type**: Not defined
241
- - **Accept**: application/json
242
-
243
-
244
- ## get_digital_item
245
-
246
- > <ItemDigitalItemResponse> get_digital_item(digital_item_oid)
247
-
248
- Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
249
-
250
- 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.
251
-
252
- ### Examples
253
-
254
- ```ruby
255
- require 'time'
256
- require 'ultracart_api'
257
- require 'json'
258
- require 'yaml'
259
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
260
-
261
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
262
- # As such, this might not be the best way to use this object.
263
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
264
-
265
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
266
- digital_item_oid = 56 # Integer | The digital item oid to retrieve.
267
-
268
- begin
269
- # Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
270
- result = api_instance.get_digital_item(digital_item_oid)
271
- p result
272
- rescue UltracartClient::ApiError => e
273
- puts "Error when calling ItemApi->get_digital_item: #{e}"
274
- end
275
- ```
276
-
277
- #### Using the get_digital_item_with_http_info variant
278
-
279
- This returns an Array which contains the response data, status code and headers.
280
-
281
- > <Array(<ItemDigitalItemResponse>, Integer, Hash)> get_digital_item_with_http_info(digital_item_oid)
282
-
283
- ```ruby
284
- begin
285
- # Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
286
- data, status_code, headers = api_instance.get_digital_item_with_http_info(digital_item_oid)
287
- p status_code # => 2xx
288
- p headers # => { ... }
289
- p data # => <ItemDigitalItemResponse>
290
- rescue UltracartClient::ApiError => e
291
- puts "Error when calling ItemApi->get_digital_item_with_http_info: #{e}"
292
- end
293
- ```
294
-
295
- ### Parameters
296
-
297
- | Name | Type | Description | Notes |
298
- | ---- | ---- | ----------- | ----- |
299
- | **digital_item_oid** | **Integer** | The digital item oid to retrieve. | |
300
-
301
- ### Return type
302
-
303
- [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
304
-
305
- ### Authorization
306
-
307
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
308
-
309
- ### HTTP request headers
310
-
311
- - **Content-Type**: Not defined
312
- - **Accept**: application/json
313
-
314
-
315
- ## get_digital_items
316
-
317
- > <ItemDigitalItemsResponse> get_digital_items(opts)
318
-
319
- Retrieve digital items from the digital library which are digital files that may be attached to normal items
320
-
321
- 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.
322
-
323
- ### Examples
324
-
325
- ```ruby
326
- require 'time'
327
- require 'ultracart_api'
328
- require 'json'
329
- require 'yaml'
330
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
331
-
332
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
333
- # As such, this might not be the best way to use this object.
334
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
335
-
336
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
337
- opts = {
338
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Default 100, Max 2000)
339
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
340
- _since: '_since_example', # String | Fetch items that have been created/modified since this date/time.
341
- _sort: '_sort_example', # String | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
342
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
343
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
344
- }
345
-
346
- begin
347
- # Retrieve digital items from the digital library which are digital files that may be attached to normal items
348
- result = api_instance.get_digital_items(opts)
349
- p result
350
- rescue UltracartClient::ApiError => e
351
- puts "Error when calling ItemApi->get_digital_items: #{e}"
352
- end
353
- ```
354
-
355
- #### Using the get_digital_items_with_http_info variant
356
-
357
- This returns an Array which contains the response data, status code and headers.
358
-
359
- > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_digital_items_with_http_info(opts)
360
-
361
- ```ruby
362
- begin
363
- # Retrieve digital items from the digital library which are digital files that may be attached to normal items
364
- data, status_code, headers = api_instance.get_digital_items_with_http_info(opts)
365
- p status_code # => 2xx
366
- p headers # => { ... }
367
- p data # => <ItemDigitalItemsResponse>
368
- rescue UltracartClient::ApiError => e
369
- puts "Error when calling ItemApi->get_digital_items_with_http_info: #{e}"
370
- end
371
- ```
372
-
373
- ### Parameters
374
-
375
- | Name | Type | Description | Notes |
376
- | ---- | ---- | ----------- | ----- |
377
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
378
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
379
- | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
380
- | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
381
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
382
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
383
-
384
- ### Return type
385
-
386
- [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
387
-
388
- ### Authorization
389
-
390
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
391
-
392
- ### HTTP request headers
393
-
394
- - **Content-Type**: Not defined
395
- - **Accept**: application/json
396
-
397
-
398
- ## get_digital_items_by_external_id
399
-
400
- > <ItemDigitalItemsResponse> get_digital_items_by_external_id(external_id)
401
-
402
- Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id
403
-
404
- 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.
405
-
406
- ### Examples
407
-
408
- ```ruby
409
- require 'time'
410
- require 'ultracart_api'
411
- require 'json'
412
- require 'yaml'
413
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
414
-
415
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
416
- # As such, this might not be the best way to use this object.
417
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
418
-
419
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
420
- external_id = 'external_id_example' # String | The external id to match against.
421
-
422
- begin
423
- # Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id
424
- result = api_instance.get_digital_items_by_external_id(external_id)
425
- p result
426
- rescue UltracartClient::ApiError => e
427
- puts "Error when calling ItemApi->get_digital_items_by_external_id: #{e}"
428
- end
429
- ```
430
-
431
- #### Using the get_digital_items_by_external_id_with_http_info variant
432
-
433
- This returns an Array which contains the response data, status code and headers.
434
-
435
- > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_digital_items_by_external_id_with_http_info(external_id)
436
-
437
- ```ruby
438
- begin
439
- # Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id
440
- data, status_code, headers = api_instance.get_digital_items_by_external_id_with_http_info(external_id)
441
- p status_code # => 2xx
442
- p headers # => { ... }
443
- p data # => <ItemDigitalItemsResponse>
444
- rescue UltracartClient::ApiError => e
445
- puts "Error when calling ItemApi->get_digital_items_by_external_id_with_http_info: #{e}"
446
- end
447
- ```
448
-
449
- ### Parameters
450
-
451
- | Name | Type | Description | Notes |
452
- | ---- | ---- | ----------- | ----- |
453
- | **external_id** | **String** | The external id to match against. | |
454
-
455
- ### Return type
456
-
457
- [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
458
-
459
- ### Authorization
460
-
461
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
462
-
463
- ### HTTP request headers
464
-
465
- - **Content-Type**: Not defined
466
- - **Accept**: application/json
467
-
468
-
469
- ## get_inventory_snapshot
470
-
471
- > <ItemInventorySnapshotResponse> get_inventory_snapshot
472
-
473
- Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
474
-
475
- Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
476
-
477
- ### Examples
478
-
479
- ```ruby
480
- require 'time'
481
- require 'ultracart_api'
482
- require 'json'
483
- require 'yaml'
484
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
485
-
486
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
487
- # As such, this might not be the best way to use this object.
488
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
489
-
490
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
491
-
492
- begin
493
- # Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
494
- result = api_instance.get_inventory_snapshot
495
- p result
496
- rescue UltracartClient::ApiError => e
497
- puts "Error when calling ItemApi->get_inventory_snapshot: #{e}"
498
- end
499
- ```
500
-
501
- #### Using the get_inventory_snapshot_with_http_info variant
502
-
503
- This returns an Array which contains the response data, status code and headers.
504
-
505
- > <Array(<ItemInventorySnapshotResponse>, Integer, Hash)> get_inventory_snapshot_with_http_info
506
-
507
- ```ruby
508
- begin
509
- # Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
510
- data, status_code, headers = api_instance.get_inventory_snapshot_with_http_info
511
- p status_code # => 2xx
512
- p headers # => { ... }
513
- p data # => <ItemInventorySnapshotResponse>
514
- rescue UltracartClient::ApiError => e
515
- puts "Error when calling ItemApi->get_inventory_snapshot_with_http_info: #{e}"
516
- end
517
- ```
518
-
519
- ### Parameters
520
-
521
- This endpoint does not need any parameter.
522
-
523
- ### Return type
524
-
525
- [**ItemInventorySnapshotResponse**](ItemInventorySnapshotResponse.md)
526
-
527
- ### Authorization
528
-
529
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
530
-
531
- ### HTTP request headers
532
-
533
- - **Content-Type**: Not defined
534
- - **Accept**: application/json
535
-
536
-
537
- ## get_item
538
-
539
- > <ItemResponse> get_item(merchant_item_oid, opts)
540
-
541
- Retrieve an item
542
-
543
- Retrieves a single item using the specified item oid.
544
-
545
- ### Examples
546
-
547
- ```ruby
548
- require 'time'
549
- require 'ultracart_api'
550
- require 'json'
551
- require 'yaml'
552
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
553
-
554
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
555
- # As such, this might not be the best way to use this object.
556
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
557
-
558
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
559
- merchant_item_oid = 56 # Integer | The item oid to retrieve.
560
- opts = {
561
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
562
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
563
- }
564
-
565
- begin
566
- # Retrieve an item
567
- result = api_instance.get_item(merchant_item_oid, opts)
568
- p result
569
- rescue UltracartClient::ApiError => e
570
- puts "Error when calling ItemApi->get_item: #{e}"
571
- end
572
- ```
573
-
574
- #### Using the get_item_with_http_info variant
575
-
576
- This returns an Array which contains the response data, status code and headers.
577
-
578
- > <Array(<ItemResponse>, Integer, Hash)> get_item_with_http_info(merchant_item_oid, opts)
579
-
580
- ```ruby
581
- begin
582
- # Retrieve an item
583
- data, status_code, headers = api_instance.get_item_with_http_info(merchant_item_oid, opts)
584
- p status_code # => 2xx
585
- p headers # => { ... }
586
- p data # => <ItemResponse>
587
- rescue UltracartClient::ApiError => e
588
- puts "Error when calling ItemApi->get_item_with_http_info: #{e}"
589
- end
590
- ```
591
-
592
- ### Parameters
593
-
594
- | Name | Type | Description | Notes |
595
- | ---- | ---- | ----------- | ----- |
596
- | **merchant_item_oid** | **Integer** | The item oid to retrieve. | |
597
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
598
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
599
-
600
- ### Return type
601
-
602
- [**ItemResponse**](ItemResponse.md)
603
-
604
- ### Authorization
605
-
606
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
607
-
608
- ### HTTP request headers
609
-
610
- - **Content-Type**: Not defined
611
- - **Accept**: application/json
612
-
613
-
614
- ## get_item_by_merchant_item_id
615
-
616
- > <ItemResponse> get_item_by_merchant_item_id(merchant_item_id, opts)
617
-
618
- Retrieve an item by item id
619
-
620
- Retrieves a single item using the specified item id.
621
-
622
- ### Examples
623
-
624
- ```ruby
625
- require 'time'
626
- require 'ultracart_api'
627
- require 'json'
628
- require 'yaml'
629
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
630
-
631
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
632
- # As such, this might not be the best way to use this object.
633
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
634
-
635
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
636
- merchant_item_id = 'merchant_item_id_example' # String | The item id to retrieve.
637
- opts = {
638
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
639
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
640
- }
641
-
642
- begin
643
- # Retrieve an item by item id
644
- result = api_instance.get_item_by_merchant_item_id(merchant_item_id, opts)
645
- p result
646
- rescue UltracartClient::ApiError => e
647
- puts "Error when calling ItemApi->get_item_by_merchant_item_id: #{e}"
648
- end
649
- ```
650
-
651
- #### Using the get_item_by_merchant_item_id_with_http_info variant
652
-
653
- This returns an Array which contains the response data, status code and headers.
654
-
655
- > <Array(<ItemResponse>, Integer, Hash)> get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
656
-
657
- ```ruby
658
- begin
659
- # Retrieve an item by item id
660
- data, status_code, headers = api_instance.get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
661
- p status_code # => 2xx
662
- p headers # => { ... }
663
- p data # => <ItemResponse>
664
- rescue UltracartClient::ApiError => e
665
- puts "Error when calling ItemApi->get_item_by_merchant_item_id_with_http_info: #{e}"
666
- end
667
- ```
668
-
669
- ### Parameters
670
-
671
- | Name | Type | Description | Notes |
672
- | ---- | ---- | ----------- | ----- |
673
- | **merchant_item_id** | **String** | The item id to retrieve. | |
674
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
675
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
676
-
677
- ### Return type
678
-
679
- [**ItemResponse**](ItemResponse.md)
680
-
681
- ### Authorization
682
-
683
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
684
-
685
- ### HTTP request headers
686
-
687
- - **Content-Type**: Not defined
688
- - **Accept**: application/json
689
-
690
-
691
- ## get_items
692
-
693
- > <ItemsResponse> get_items(opts)
694
-
695
- Retrieve items
696
-
697
- 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.
698
-
699
- ### Examples
700
-
701
- ```ruby
702
- require 'time'
703
- require 'ultracart_api'
704
- require 'json'
705
- require 'yaml'
706
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
707
-
708
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
709
- # As such, this might not be the best way to use this object.
710
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
711
-
712
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
713
- opts = {
714
- parent_category_id: 56, # Integer | The parent category object id to retrieve items for. Unspecified means all items on the account. 0 = root
715
- parent_category_path: 'parent_category_path_example', # String | The parent category path to retrieve items for. Unspecified means all items on the account. / = root
716
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Default 100, Max 2000)
717
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
718
- _since: '_since_example', # String | Fetch items that have been created/modified since this date/time.
719
- _sort: '_sort_example', # String | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
720
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
721
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
722
- }
723
-
724
- begin
725
- # Retrieve items
726
- result = api_instance.get_items(opts)
727
- p result
728
- rescue UltracartClient::ApiError => e
729
- puts "Error when calling ItemApi->get_items: #{e}"
730
- end
731
- ```
732
-
733
- #### Using the get_items_with_http_info variant
734
-
735
- This returns an Array which contains the response data, status code and headers.
736
-
737
- > <Array(<ItemsResponse>, Integer, Hash)> get_items_with_http_info(opts)
738
-
739
- ```ruby
740
- begin
741
- # Retrieve items
742
- data, status_code, headers = api_instance.get_items_with_http_info(opts)
743
- p status_code # => 2xx
744
- p headers # => { ... }
745
- p data # => <ItemsResponse>
746
- rescue UltracartClient::ApiError => e
747
- puts "Error when calling ItemApi->get_items_with_http_info: #{e}"
748
- end
749
- ```
750
-
751
- ### Parameters
752
-
753
- | Name | Type | Description | Notes |
754
- | ---- | ---- | ----------- | ----- |
755
- | **parent_category_id** | **Integer** | The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root | [optional] |
756
- | **parent_category_path** | **String** | The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root | [optional] |
757
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
758
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
759
- | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
760
- | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
761
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
762
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
763
-
764
- ### Return type
765
-
766
- [**ItemsResponse**](ItemsResponse.md)
767
-
768
- ### Authorization
769
-
770
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
771
-
772
- ### HTTP request headers
773
-
774
- - **Content-Type**: Not defined
775
- - **Accept**: application/json
776
-
777
-
778
- ## get_pricing_tiers
779
-
780
- > <PricingTiersResponse> get_pricing_tiers(opts)
781
-
782
- Retrieve pricing tiers
783
-
784
- Retrieves the pricing tiers
785
-
786
- ### Examples
787
-
788
- ```ruby
789
- require 'time'
790
- require 'ultracart_api'
791
- require 'json'
792
- require 'yaml'
793
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
794
-
795
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
796
- # As such, this might not be the best way to use this object.
797
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
798
-
799
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
800
- opts = {
801
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
802
- }
803
-
804
- begin
805
- # Retrieve pricing tiers
806
- result = api_instance.get_pricing_tiers(opts)
807
- p result
808
- rescue UltracartClient::ApiError => e
809
- puts "Error when calling ItemApi->get_pricing_tiers: #{e}"
810
- end
811
- ```
812
-
813
- #### Using the get_pricing_tiers_with_http_info variant
814
-
815
- This returns an Array which contains the response data, status code and headers.
816
-
817
- > <Array(<PricingTiersResponse>, Integer, Hash)> get_pricing_tiers_with_http_info(opts)
818
-
819
- ```ruby
820
- begin
821
- # Retrieve pricing tiers
822
- data, status_code, headers = api_instance.get_pricing_tiers_with_http_info(opts)
823
- p status_code # => 2xx
824
- p headers # => { ... }
825
- p data # => <PricingTiersResponse>
826
- rescue UltracartClient::ApiError => e
827
- puts "Error when calling ItemApi->get_pricing_tiers_with_http_info: #{e}"
828
- end
829
- ```
830
-
831
- ### Parameters
832
-
833
- | Name | Type | Description | Notes |
834
- | ---- | ---- | ----------- | ----- |
835
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
836
-
837
- ### Return type
838
-
839
- [**PricingTiersResponse**](PricingTiersResponse.md)
840
-
841
- ### Authorization
842
-
843
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
844
-
845
- ### HTTP request headers
846
-
847
- - **Content-Type**: Not defined
848
- - **Accept**: application/json
849
-
850
-
851
- ## get_review
852
-
853
- > <ItemReviewResponse> get_review(review_oid, merchant_item_oid)
854
-
855
- Get a review
856
-
857
- Retrieve an item review.
858
-
859
- ### Examples
860
-
861
- ```ruby
862
- require 'time'
863
- require 'ultracart_api'
864
- require 'json'
865
- require 'yaml'
866
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
867
-
868
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
869
- # As such, this might not be the best way to use this object.
870
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
871
-
872
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
873
- review_oid = 56 # Integer | The review oid to retrieve.
874
- merchant_item_oid = 56 # Integer | The item oid the review is associated with.
875
-
876
- begin
877
- # Get a review
878
- result = api_instance.get_review(review_oid, merchant_item_oid)
879
- p result
880
- rescue UltracartClient::ApiError => e
881
- puts "Error when calling ItemApi->get_review: #{e}"
882
- end
883
- ```
884
-
885
- #### Using the get_review_with_http_info variant
886
-
887
- This returns an Array which contains the response data, status code and headers.
888
-
889
- > <Array(<ItemReviewResponse>, Integer, Hash)> get_review_with_http_info(review_oid, merchant_item_oid)
890
-
891
- ```ruby
892
- begin
893
- # Get a review
894
- data, status_code, headers = api_instance.get_review_with_http_info(review_oid, merchant_item_oid)
895
- p status_code # => 2xx
896
- p headers # => { ... }
897
- p data # => <ItemReviewResponse>
898
- rescue UltracartClient::ApiError => e
899
- puts "Error when calling ItemApi->get_review_with_http_info: #{e}"
900
- end
901
- ```
902
-
903
- ### Parameters
904
-
905
- | Name | Type | Description | Notes |
906
- | ---- | ---- | ----------- | ----- |
907
- | **review_oid** | **Integer** | The review oid to retrieve. | |
908
- | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
909
-
910
- ### Return type
911
-
912
- [**ItemReviewResponse**](ItemReviewResponse.md)
913
-
914
- ### Authorization
915
-
916
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
917
-
918
- ### HTTP request headers
919
-
920
- - **Content-Type**: Not defined
921
- - **Accept**: application/json
922
-
923
-
924
- ## get_reviews
925
-
926
- > <ItemReviewsResponse> get_reviews(merchant_item_oid)
927
-
928
- Get reviews for an item
929
-
930
- Retrieve item reviews.
931
-
932
- ### Examples
933
-
934
- ```ruby
935
- require 'time'
936
- require 'ultracart_api'
937
- require 'json'
938
- require 'yaml'
939
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
940
-
941
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
942
- # As such, this might not be the best way to use this object.
943
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
944
-
945
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
946
- merchant_item_oid = 56 # Integer | The item oid the review is associated with.
947
-
948
- begin
949
- # Get reviews for an item
950
- result = api_instance.get_reviews(merchant_item_oid)
951
- p result
952
- rescue UltracartClient::ApiError => e
953
- puts "Error when calling ItemApi->get_reviews: #{e}"
954
- end
955
- ```
956
-
957
- #### Using the get_reviews_with_http_info variant
958
-
959
- This returns an Array which contains the response data, status code and headers.
960
-
961
- > <Array(<ItemReviewsResponse>, Integer, Hash)> get_reviews_with_http_info(merchant_item_oid)
962
-
963
- ```ruby
964
- begin
965
- # Get reviews for an item
966
- data, status_code, headers = api_instance.get_reviews_with_http_info(merchant_item_oid)
967
- p status_code # => 2xx
968
- p headers # => { ... }
969
- p data # => <ItemReviewsResponse>
970
- rescue UltracartClient::ApiError => e
971
- puts "Error when calling ItemApi->get_reviews_with_http_info: #{e}"
972
- end
973
- ```
974
-
975
- ### Parameters
976
-
977
- | Name | Type | Description | Notes |
978
- | ---- | ---- | ----------- | ----- |
979
- | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
980
-
981
- ### Return type
982
-
983
- [**ItemReviewsResponse**](ItemReviewsResponse.md)
984
-
985
- ### Authorization
986
-
987
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
988
-
989
- ### HTTP request headers
990
-
991
- - **Content-Type**: Not defined
992
- - **Accept**: application/json
993
-
994
-
995
- ## get_unassociated_digital_items
996
-
997
- > <ItemDigitalItemsResponse> get_unassociated_digital_items(opts)
998
-
999
- Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items
1000
-
1001
- 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.
1002
-
1003
- ### Examples
1004
-
1005
- ```ruby
1006
- require 'time'
1007
- require 'ultracart_api'
1008
- require 'json'
1009
- require 'yaml'
1010
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1011
-
1012
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1013
- # As such, this might not be the best way to use this object.
1014
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1015
-
1016
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1017
- opts = {
1018
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Default 100, Max 2000)
1019
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
1020
- _since: '_since_example', # String | Fetch items that have been created/modified since this date/time.
1021
- _sort: '_sort_example', # String | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
1022
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
1023
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
1024
- }
1025
-
1026
- begin
1027
- # Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items
1028
- result = api_instance.get_unassociated_digital_items(opts)
1029
- p result
1030
- rescue UltracartClient::ApiError => e
1031
- puts "Error when calling ItemApi->get_unassociated_digital_items: #{e}"
1032
- end
1033
- ```
1034
-
1035
- #### Using the get_unassociated_digital_items_with_http_info variant
1036
-
1037
- This returns an Array which contains the response data, status code and headers.
1038
-
1039
- > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_unassociated_digital_items_with_http_info(opts)
1040
-
1041
- ```ruby
1042
- begin
1043
- # Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items
1044
- data, status_code, headers = api_instance.get_unassociated_digital_items_with_http_info(opts)
1045
- p status_code # => 2xx
1046
- p headers # => { ... }
1047
- p data # => <ItemDigitalItemsResponse>
1048
- rescue UltracartClient::ApiError => e
1049
- puts "Error when calling ItemApi->get_unassociated_digital_items_with_http_info: #{e}"
1050
- end
1051
- ```
1052
-
1053
- ### Parameters
1054
-
1055
- | Name | Type | Description | Notes |
1056
- | ---- | ---- | ----------- | ----- |
1057
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
1058
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
1059
- | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
1060
- | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
1061
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1062
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1063
-
1064
- ### Return type
1065
-
1066
- [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
1067
-
1068
- ### Authorization
1069
-
1070
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1071
-
1072
- ### HTTP request headers
1073
-
1074
- - **Content-Type**: Not defined
1075
- - **Accept**: application/json
1076
-
1077
-
1078
- ## insert_digital_item
1079
-
1080
- > <ItemDigitalItemResponse> insert_digital_item(digital_item)
1081
-
1082
- Create a file within the digital library
1083
-
1084
- 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.
1085
-
1086
- ### Examples
1087
-
1088
- ```ruby
1089
- require 'time'
1090
- require 'ultracart_api'
1091
- require 'json'
1092
- require 'yaml'
1093
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1094
-
1095
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1096
- # As such, this might not be the best way to use this object.
1097
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1098
-
1099
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1100
- digital_item = UltracartClient::ItemDigitalItem.new # ItemDigitalItem | Digital item to create
1101
-
1102
- begin
1103
- # Create a file within the digital library
1104
- result = api_instance.insert_digital_item(digital_item)
1105
- p result
1106
- rescue UltracartClient::ApiError => e
1107
- puts "Error when calling ItemApi->insert_digital_item: #{e}"
1108
- end
1109
- ```
1110
-
1111
- #### Using the insert_digital_item_with_http_info variant
1112
-
1113
- This returns an Array which contains the response data, status code and headers.
1114
-
1115
- > <Array(<ItemDigitalItemResponse>, Integer, Hash)> insert_digital_item_with_http_info(digital_item)
1116
-
1117
- ```ruby
1118
- begin
1119
- # Create a file within the digital library
1120
- data, status_code, headers = api_instance.insert_digital_item_with_http_info(digital_item)
1121
- p status_code # => 2xx
1122
- p headers # => { ... }
1123
- p data # => <ItemDigitalItemResponse>
1124
- rescue UltracartClient::ApiError => e
1125
- puts "Error when calling ItemApi->insert_digital_item_with_http_info: #{e}"
1126
- end
1127
- ```
1128
-
1129
- ### Parameters
1130
-
1131
- | Name | Type | Description | Notes |
1132
- | ---- | ---- | ----------- | ----- |
1133
- | **digital_item** | [**ItemDigitalItem**](ItemDigitalItem.md) | Digital item to create | |
1134
-
1135
- ### Return type
1136
-
1137
- [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
1138
-
1139
- ### Authorization
1140
-
1141
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1142
-
1143
- ### HTTP request headers
1144
-
1145
- - **Content-Type**: application/json; charset=UTF-8
1146
- - **Accept**: application/json
1147
-
1148
-
1149
- ## insert_item
1150
-
1151
- > <ItemResponse> insert_item(item, opts)
1152
-
1153
- Create an item
1154
-
1155
- Create a new item on the UltraCart account.
1156
-
1157
- ### Examples
1158
-
1159
- ```ruby
1160
- require 'time'
1161
- require 'ultracart_api'
1162
- require 'json'
1163
- require 'yaml'
1164
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1165
-
1166
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1167
- # As such, this might not be the best way to use this object.
1168
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1169
-
1170
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1171
- item = UltracartClient::Item.new # Item | Item to create
1172
- opts = {
1173
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
1174
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
1175
- }
1176
-
1177
- begin
1178
- # Create an item
1179
- result = api_instance.insert_item(item, opts)
1180
- p result
1181
- rescue UltracartClient::ApiError => e
1182
- puts "Error when calling ItemApi->insert_item: #{e}"
1183
- end
1184
- ```
1185
-
1186
- #### Using the insert_item_with_http_info variant
1187
-
1188
- This returns an Array which contains the response data, status code and headers.
1189
-
1190
- > <Array(<ItemResponse>, Integer, Hash)> insert_item_with_http_info(item, opts)
1191
-
1192
- ```ruby
1193
- begin
1194
- # Create an item
1195
- data, status_code, headers = api_instance.insert_item_with_http_info(item, opts)
1196
- p status_code # => 2xx
1197
- p headers # => { ... }
1198
- p data # => <ItemResponse>
1199
- rescue UltracartClient::ApiError => e
1200
- puts "Error when calling ItemApi->insert_item_with_http_info: #{e}"
1201
- end
1202
- ```
1203
-
1204
- ### Parameters
1205
-
1206
- | Name | Type | Description | Notes |
1207
- | ---- | ---- | ----------- | ----- |
1208
- | **item** | [**Item**](Item.md) | Item to create | |
1209
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1210
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1211
-
1212
- ### Return type
1213
-
1214
- [**ItemResponse**](ItemResponse.md)
1215
-
1216
- ### Authorization
1217
-
1218
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1219
-
1220
- ### HTTP request headers
1221
-
1222
- - **Content-Type**: application/json; charset=UTF-8
1223
- - **Accept**: application/json
1224
-
1225
-
1226
- ## insert_review
1227
-
1228
- > <ItemReviewResponse> insert_review(merchant_item_oid, review)
1229
-
1230
- Insert a review
1231
-
1232
- Insert a item review.
1233
-
1234
- ### Examples
1235
-
1236
- ```ruby
1237
- require 'time'
1238
- require 'ultracart_api'
1239
- require 'json'
1240
- require 'yaml'
1241
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1242
-
1243
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1244
- # As such, this might not be the best way to use this object.
1245
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1246
-
1247
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1248
- merchant_item_oid = 56 # Integer | The item oid the review is associated with.
1249
- review = UltracartClient::ItemReview.new # ItemReview | Review to insert
1250
-
1251
- begin
1252
- # Insert a review
1253
- result = api_instance.insert_review(merchant_item_oid, review)
1254
- p result
1255
- rescue UltracartClient::ApiError => e
1256
- puts "Error when calling ItemApi->insert_review: #{e}"
1257
- end
1258
- ```
1259
-
1260
- #### Using the insert_review_with_http_info variant
1261
-
1262
- This returns an Array which contains the response data, status code and headers.
1263
-
1264
- > <Array(<ItemReviewResponse>, Integer, Hash)> insert_review_with_http_info(merchant_item_oid, review)
1265
-
1266
- ```ruby
1267
- begin
1268
- # Insert a review
1269
- data, status_code, headers = api_instance.insert_review_with_http_info(merchant_item_oid, review)
1270
- p status_code # => 2xx
1271
- p headers # => { ... }
1272
- p data # => <ItemReviewResponse>
1273
- rescue UltracartClient::ApiError => e
1274
- puts "Error when calling ItemApi->insert_review_with_http_info: #{e}"
1275
- end
1276
- ```
1277
-
1278
- ### Parameters
1279
-
1280
- | Name | Type | Description | Notes |
1281
- | ---- | ---- | ----------- | ----- |
1282
- | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
1283
- | **review** | [**ItemReview**](ItemReview.md) | Review to insert | |
1284
-
1285
- ### Return type
1286
-
1287
- [**ItemReviewResponse**](ItemReviewResponse.md)
1288
-
1289
- ### Authorization
1290
-
1291
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1292
-
1293
- ### HTTP request headers
1294
-
1295
- - **Content-Type**: application/json; charset=UTF-8
1296
- - **Accept**: application/json
1297
-
1298
-
1299
- ## insert_update_item_content_attribute
1300
-
1301
- > insert_update_item_content_attribute(merchant_item_oid, item_attribute)
1302
-
1303
- Upsert an item content attribute
1304
-
1305
- Update an item content attribute, creating it new if it does not yet exist.
1306
-
1307
- ### Examples
1308
-
1309
- ```ruby
1310
- require 'time'
1311
- require 'ultracart_api'
1312
- require 'json'
1313
- require 'yaml'
1314
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1315
-
1316
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1317
- # As such, this might not be the best way to use this object.
1318
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1319
-
1320
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1321
- merchant_item_oid = 56 # Integer | The item oid to modify.
1322
- item_attribute = UltracartClient::ItemContentAttribute.new # ItemContentAttribute | Item content attribute to upsert
1323
-
1324
- begin
1325
- # Upsert an item content attribute
1326
- api_instance.insert_update_item_content_attribute(merchant_item_oid, item_attribute)
1327
- rescue UltracartClient::ApiError => e
1328
- puts "Error when calling ItemApi->insert_update_item_content_attribute: #{e}"
1329
- end
1330
- ```
1331
-
1332
- #### Using the insert_update_item_content_attribute_with_http_info variant
1333
-
1334
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
1335
-
1336
- > <Array(nil, Integer, Hash)> insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute)
1337
-
1338
- ```ruby
1339
- begin
1340
- # Upsert an item content attribute
1341
- data, status_code, headers = api_instance.insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute)
1342
- p status_code # => 2xx
1343
- p headers # => { ... }
1344
- p data # => nil
1345
- rescue UltracartClient::ApiError => e
1346
- puts "Error when calling ItemApi->insert_update_item_content_attribute_with_http_info: #{e}"
1347
- end
1348
- ```
1349
-
1350
- ### Parameters
1351
-
1352
- | Name | Type | Description | Notes |
1353
- | ---- | ---- | ----------- | ----- |
1354
- | **merchant_item_oid** | **Integer** | The item oid to modify. | |
1355
- | **item_attribute** | [**ItemContentAttribute**](ItemContentAttribute.md) | Item content attribute to upsert | |
1356
-
1357
- ### Return type
1358
-
1359
- nil (empty response body)
1360
-
1361
- ### Authorization
1362
-
1363
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1364
-
1365
- ### HTTP request headers
1366
-
1367
- - **Content-Type**: application/json; charset=UTF-8
1368
- - **Accept**: application/json
1369
-
1370
-
1371
- ## update_digital_item
1372
-
1373
- > <ItemDigitalItemResponse> update_digital_item(digital_item_oid, digital_item)
1374
-
1375
- Updates a file within the digital library
1376
-
1377
- 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.
1378
-
1379
- ### Examples
1380
-
1381
- ```ruby
1382
- require 'time'
1383
- require 'ultracart_api'
1384
- require 'json'
1385
- require 'yaml'
1386
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1387
-
1388
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1389
- # As such, this might not be the best way to use this object.
1390
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1391
-
1392
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1393
- digital_item_oid = 56 # Integer | The digital item oid to update.
1394
- digital_item = UltracartClient::ItemDigitalItem.new # ItemDigitalItem | Digital item to update
1395
-
1396
- begin
1397
- # Updates a file within the digital library
1398
- result = api_instance.update_digital_item(digital_item_oid, digital_item)
1399
- p result
1400
- rescue UltracartClient::ApiError => e
1401
- puts "Error when calling ItemApi->update_digital_item: #{e}"
1402
- end
1403
- ```
1404
-
1405
- #### Using the update_digital_item_with_http_info variant
1406
-
1407
- This returns an Array which contains the response data, status code and headers.
1408
-
1409
- > <Array(<ItemDigitalItemResponse>, Integer, Hash)> update_digital_item_with_http_info(digital_item_oid, digital_item)
1410
-
1411
- ```ruby
1412
- begin
1413
- # Updates a file within the digital library
1414
- data, status_code, headers = api_instance.update_digital_item_with_http_info(digital_item_oid, digital_item)
1415
- p status_code # => 2xx
1416
- p headers # => { ... }
1417
- p data # => <ItemDigitalItemResponse>
1418
- rescue UltracartClient::ApiError => e
1419
- puts "Error when calling ItemApi->update_digital_item_with_http_info: #{e}"
1420
- end
1421
- ```
1422
-
1423
- ### Parameters
1424
-
1425
- | Name | Type | Description | Notes |
1426
- | ---- | ---- | ----------- | ----- |
1427
- | **digital_item_oid** | **Integer** | The digital item oid to update. | |
1428
- | **digital_item** | [**ItemDigitalItem**](ItemDigitalItem.md) | Digital item to update | |
1429
-
1430
- ### Return type
1431
-
1432
- [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
1433
-
1434
- ### Authorization
1435
-
1436
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1437
-
1438
- ### HTTP request headers
1439
-
1440
- - **Content-Type**: application/json; charset=UTF-8
1441
- - **Accept**: application/json
1442
-
1443
-
1444
- ## update_item
1445
-
1446
- > <ItemResponse> update_item(merchant_item_oid, item, opts)
1447
-
1448
- Update an item
1449
-
1450
- Update a new item on the UltraCart account.
1451
-
1452
- ### Examples
1453
-
1454
- ```ruby
1455
- require 'time'
1456
- require 'ultracart_api'
1457
- require 'json'
1458
- require 'yaml'
1459
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1460
-
1461
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1462
- # As such, this might not be the best way to use this object.
1463
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1464
-
1465
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1466
- merchant_item_oid = 56 # Integer | The item oid to update.
1467
- item = UltracartClient::Item.new # Item | Item to update
1468
- opts = {
1469
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
1470
- _placeholders: true # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
1471
- }
1472
-
1473
- begin
1474
- # Update an item
1475
- result = api_instance.update_item(merchant_item_oid, item, opts)
1476
- p result
1477
- rescue UltracartClient::ApiError => e
1478
- puts "Error when calling ItemApi->update_item: #{e}"
1479
- end
1480
- ```
1481
-
1482
- #### Using the update_item_with_http_info variant
1483
-
1484
- This returns an Array which contains the response data, status code and headers.
1485
-
1486
- > <Array(<ItemResponse>, Integer, Hash)> update_item_with_http_info(merchant_item_oid, item, opts)
1487
-
1488
- ```ruby
1489
- begin
1490
- # Update an item
1491
- data, status_code, headers = api_instance.update_item_with_http_info(merchant_item_oid, item, opts)
1492
- p status_code # => 2xx
1493
- p headers # => { ... }
1494
- p data # => <ItemResponse>
1495
- rescue UltracartClient::ApiError => e
1496
- puts "Error when calling ItemApi->update_item_with_http_info: #{e}"
1497
- end
1498
- ```
1499
-
1500
- ### Parameters
1501
-
1502
- | Name | Type | Description | Notes |
1503
- | ---- | ---- | ----------- | ----- |
1504
- | **merchant_item_oid** | **Integer** | The item oid to update. | |
1505
- | **item** | [**Item**](Item.md) | Item to update | |
1506
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1507
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1508
-
1509
- ### Return type
1510
-
1511
- [**ItemResponse**](ItemResponse.md)
1512
-
1513
- ### Authorization
1514
-
1515
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1516
-
1517
- ### HTTP request headers
1518
-
1519
- - **Content-Type**: application/json; charset=UTF-8
1520
- - **Accept**: application/json
1521
-
1522
-
1523
- ## update_items
1524
-
1525
- > <ItemsResponse> update_items(items_request, opts)
1526
-
1527
- Update multiple items
1528
-
1529
- Update multiple item on the UltraCart account.
1530
-
1531
- ### Examples
1532
-
1533
- ```ruby
1534
- require 'time'
1535
- require 'ultracart_api'
1536
- require 'json'
1537
- require 'yaml'
1538
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1539
-
1540
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1541
- # As such, this might not be the best way to use this object.
1542
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1543
-
1544
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1545
- items_request = UltracartClient::ItemsRequest.new # ItemsRequest | Items to update (synchronous maximum 20 / asynchronous maximum 100)
1546
- opts = {
1547
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
1548
- _placeholders: true, # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
1549
- _async: true # Boolean | True if the operation should be run async. No result returned
1550
- }
1551
-
1552
- begin
1553
- # Update multiple items
1554
- result = api_instance.update_items(items_request, opts)
1555
- p result
1556
- rescue UltracartClient::ApiError => e
1557
- puts "Error when calling ItemApi->update_items: #{e}"
1558
- end
1559
- ```
1560
-
1561
- #### Using the update_items_with_http_info variant
1562
-
1563
- This returns an Array which contains the response data, status code and headers.
1564
-
1565
- > <Array(<ItemsResponse>, Integer, Hash)> update_items_with_http_info(items_request, opts)
1566
-
1567
- ```ruby
1568
- begin
1569
- # Update multiple items
1570
- data, status_code, headers = api_instance.update_items_with_http_info(items_request, opts)
1571
- p status_code # => 2xx
1572
- p headers # => { ... }
1573
- p data # => <ItemsResponse>
1574
- rescue UltracartClient::ApiError => e
1575
- puts "Error when calling ItemApi->update_items_with_http_info: #{e}"
1576
- end
1577
- ```
1578
-
1579
- ### Parameters
1580
-
1581
- | Name | Type | Description | Notes |
1582
- | ---- | ---- | ----------- | ----- |
1583
- | **items_request** | [**ItemsRequest**](ItemsRequest.md) | Items to update (synchronous maximum 20 / asynchronous maximum 100) | |
1584
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1585
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1586
- | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
1587
-
1588
- ### Return type
1589
-
1590
- [**ItemsResponse**](ItemsResponse.md)
1591
-
1592
- ### Authorization
1593
-
1594
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1595
-
1596
- ### HTTP request headers
1597
-
1598
- - **Content-Type**: application/json; charset=UTF-8
1599
- - **Accept**: application/json
1600
-
1601
-
1602
- ## update_review
1603
-
1604
- > <ItemReviewResponse> update_review(review_oid, merchant_item_oid, review)
1605
-
1606
- Update a review
1607
-
1608
- Update an item review.
1609
-
1610
- ### Examples
1611
-
1612
- ```ruby
1613
- require 'time'
1614
- require 'ultracart_api'
1615
- require 'json'
1616
- require 'yaml'
1617
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1618
-
1619
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1620
- # As such, this might not be the best way to use this object.
1621
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1622
-
1623
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1624
- review_oid = 56 # Integer | The review oid to update.
1625
- merchant_item_oid = 56 # Integer | The item oid the review is associated with.
1626
- review = UltracartClient::ItemReview.new # ItemReview | Review to update
1627
-
1628
- begin
1629
- # Update a review
1630
- result = api_instance.update_review(review_oid, merchant_item_oid, review)
1631
- p result
1632
- rescue UltracartClient::ApiError => e
1633
- puts "Error when calling ItemApi->update_review: #{e}"
1634
- end
1635
- ```
1636
-
1637
- #### Using the update_review_with_http_info variant
1638
-
1639
- This returns an Array which contains the response data, status code and headers.
1640
-
1641
- > <Array(<ItemReviewResponse>, Integer, Hash)> update_review_with_http_info(review_oid, merchant_item_oid, review)
1642
-
1643
- ```ruby
1644
- begin
1645
- # Update a review
1646
- data, status_code, headers = api_instance.update_review_with_http_info(review_oid, merchant_item_oid, review)
1647
- p status_code # => 2xx
1648
- p headers # => { ... }
1649
- p data # => <ItemReviewResponse>
1650
- rescue UltracartClient::ApiError => e
1651
- puts "Error when calling ItemApi->update_review_with_http_info: #{e}"
1652
- end
1653
- ```
1654
-
1655
- ### Parameters
1656
-
1657
- | Name | Type | Description | Notes |
1658
- | ---- | ---- | ----------- | ----- |
1659
- | **review_oid** | **Integer** | The review oid to update. | |
1660
- | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
1661
- | **review** | [**ItemReview**](ItemReview.md) | Review to update | |
1662
-
1663
- ### Return type
1664
-
1665
- [**ItemReviewResponse**](ItemReviewResponse.md)
1666
-
1667
- ### Authorization
1668
-
1669
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1670
-
1671
- ### HTTP request headers
1672
-
1673
- - **Content-Type**: application/json; charset=UTF-8
1674
- - **Accept**: application/json
1675
-
1676
-
1677
- ## upload_temporary_multimedia
1678
-
1679
- > <TempMultimediaResponse> upload_temporary_multimedia(file)
1680
-
1681
- Upload an image to the temporary multimedia.
1682
-
1683
- Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.
1684
-
1685
- ### Examples
1686
-
1687
- ```ruby
1688
- require 'time'
1689
- require 'ultracart_api'
1690
- require 'json'
1691
- require 'yaml'
1692
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1693
-
1694
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1695
- # As such, this might not be the best way to use this object.
1696
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1697
-
1698
- api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1699
- file = File.new('/path/to/some/file') # File | File to upload
1700
-
1701
- begin
1702
- # Upload an image to the temporary multimedia.
1703
- result = api_instance.upload_temporary_multimedia(file)
1704
- p result
1705
- rescue UltracartClient::ApiError => e
1706
- puts "Error when calling ItemApi->upload_temporary_multimedia: #{e}"
1707
- end
1708
- ```
1709
-
1710
- #### Using the upload_temporary_multimedia_with_http_info variant
1711
-
1712
- This returns an Array which contains the response data, status code and headers.
1713
-
1714
- > <Array(<TempMultimediaResponse>, Integer, Hash)> upload_temporary_multimedia_with_http_info(file)
1715
-
1716
- ```ruby
1717
- begin
1718
- # Upload an image to the temporary multimedia.
1719
- data, status_code, headers = api_instance.upload_temporary_multimedia_with_http_info(file)
1720
- p status_code # => 2xx
1721
- p headers # => { ... }
1722
- p data # => <TempMultimediaResponse>
1723
- rescue UltracartClient::ApiError => e
1724
- puts "Error when calling ItemApi->upload_temporary_multimedia_with_http_info: #{e}"
1725
- end
1726
- ```
1727
-
1728
- ### Parameters
1729
-
1730
- | Name | Type | Description | Notes |
1731
- | ---- | ---- | ----------- | ----- |
1732
- | **file** | **File** | File to upload | |
1733
-
1734
- ### Return type
1735
-
1736
- [**TempMultimediaResponse**](TempMultimediaResponse.md)
1737
-
1738
- ### Authorization
1739
-
1740
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1741
-
1742
- ### HTTP request headers
1743
-
1744
- - **Content-Type**: multipart/form-data
1745
- - **Accept**: application/json
1746
-
1
+ # UltracartClient::ItemApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**delete_digital_item**](ItemApi.md#delete_digital_item) | **DELETE** /item/digital_library/{digital_item_oid} | Delete a digital item, which is a file within the digital library, not an actual merchant item |
8
+ | [**delete_item**](ItemApi.md#delete_item) | **DELETE** /item/items/{merchant_item_oid} | Delete an item |
9
+ | [**delete_review**](ItemApi.md#delete_review) | **DELETE** /item/items/{merchant_item_oid}/reviews/{review_oid} | Delete a review |
10
+ | [**get_digital_item**](ItemApi.md#get_digital_item) | **GET** /item/digital_library/{digital_item_oid} | Retrieve a digital item from the digital library, which are digital files that may be attached to normal items |
11
+ | [**get_digital_items**](ItemApi.md#get_digital_items) | **GET** /item/digital_library | Retrieve digital items from the digital library which are digital files that may be attached to normal items |
12
+ | [**get_digital_items_by_external_id**](ItemApi.md#get_digital_items_by_external_id) | **GET** /item/digital_library/by_external/{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 |
13
+ | [**get_inventory_snapshot**](ItemApi.md#get_inventory_snapshot) | **GET** /item/items/inventory_snapshot | Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response. |
14
+ | [**get_item**](ItemApi.md#get_item) | **GET** /item/items/{merchant_item_oid} | Retrieve an item |
15
+ | [**get_item_by_merchant_item_id**](ItemApi.md#get_item_by_merchant_item_id) | **GET** /item/items/merchant_item_id/{merchant_item_id} | Retrieve an item by item id |
16
+ | [**get_items**](ItemApi.md#get_items) | **GET** /item/items | Retrieve items |
17
+ | [**get_pricing_tiers**](ItemApi.md#get_pricing_tiers) | **GET** /item/pricing_tiers | Retrieve pricing tiers |
18
+ | [**get_review**](ItemApi.md#get_review) | **GET** /item/items/{merchant_item_oid}/reviews/{review_oid} | Get a review |
19
+ | [**get_reviews**](ItemApi.md#get_reviews) | **GET** /item/items/{merchant_item_oid}/reviews | Get reviews for an item |
20
+ | [**get_unassociated_digital_items**](ItemApi.md#get_unassociated_digital_items) | **GET** /item/digital_library/unassociated | Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items |
21
+ | [**insert_digital_item**](ItemApi.md#insert_digital_item) | **POST** /item/digital_library | Create a file within the digital library |
22
+ | [**insert_item**](ItemApi.md#insert_item) | **POST** /item/items | Create an item |
23
+ | [**insert_review**](ItemApi.md#insert_review) | **POST** /item/items/{merchant_item_oid}/reviews | Insert a review |
24
+ | [**insert_update_item_content_attribute**](ItemApi.md#insert_update_item_content_attribute) | **POST** /item/items/{merchant_item_oid}/content/attributes | Upsert an item content attribute |
25
+ | [**update_digital_item**](ItemApi.md#update_digital_item) | **PUT** /item/digital_library/{digital_item_oid} | Updates a file within the digital library |
26
+ | [**update_item**](ItemApi.md#update_item) | **PUT** /item/items/{merchant_item_oid} | Update an item |
27
+ | [**update_items**](ItemApi.md#update_items) | **PUT** /item/items/batch | Update multiple items |
28
+ | [**update_review**](ItemApi.md#update_review) | **PUT** /item/items/{merchant_item_oid}/reviews/{review_oid} | Update a review |
29
+ | [**upload_temporary_multimedia**](ItemApi.md#upload_temporary_multimedia) | **POST** /item/temp_multimedia | Upload an image to the temporary multimedia. |
30
+
31
+
32
+ ## delete_digital_item
33
+
34
+ > delete_digital_item(digital_item_oid)
35
+
36
+ Delete a digital item, which is a file within the digital library, not an actual merchant item
37
+
38
+ Delete a digital item on the UltraCart account.
39
+
40
+
41
+ ### Examples
42
+
43
+ ```ruby
44
+ require 'ultracart_api'
45
+ require_relative '../constants'
46
+ require_relative './item_functions'
47
+
48
+ begin
49
+ digital_item_oid = insert_sample_digital_item
50
+ delete_sample_digital_item(digital_item_oid)
51
+ rescue UltracartClient::ApiException => e
52
+ puts 'An ApiException occurred. Please review the following error:'
53
+ p e
54
+ exit(1)
55
+ end
56
+ ```
57
+
58
+
59
+ #### Using the delete_digital_item_with_http_info variant
60
+
61
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
62
+
63
+ > <Array(nil, Integer, Hash)> delete_digital_item_with_http_info(digital_item_oid)
64
+
65
+ ```ruby
66
+ begin
67
+ # Delete a digital item, which is a file within the digital library, not an actual merchant item
68
+ data, status_code, headers = api_instance.delete_digital_item_with_http_info(digital_item_oid)
69
+ p status_code # => 2xx
70
+ p headers # => { ... }
71
+ p data # => nil
72
+ rescue UltracartClient::ApiError => e
73
+ puts "Error when calling ItemApi->delete_digital_item_with_http_info: #{e}"
74
+ end
75
+ ```
76
+
77
+ ### Parameters
78
+
79
+ | Name | Type | Description | Notes |
80
+ | ---- | ---- | ----------- | ----- |
81
+ | **digital_item_oid** | **Integer** | The digital item oid to delete. | |
82
+
83
+ ### Return type
84
+
85
+ nil (empty response body)
86
+
87
+ ### Authorization
88
+
89
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
90
+
91
+ ### HTTP request headers
92
+
93
+ - **Content-Type**: Not defined
94
+ - **Accept**: application/json
95
+
96
+
97
+ ## delete_item
98
+
99
+ > delete_item(merchant_item_oid)
100
+
101
+ Delete an item
102
+
103
+ Delete an item on the UltraCart account.
104
+
105
+
106
+ ### Examples
107
+
108
+ ```ruby
109
+ require 'ultracart_api'
110
+ require_relative '../constants'
111
+ require_relative './item_functions'
112
+
113
+ begin
114
+ item_id = insert_sample_item
115
+ delete_sample_item(item_id)
116
+ rescue UltracartClient::ApiException => e
117
+ puts 'An ApiException occurred. Please review the following error:'
118
+ p e
119
+ exit(1)
120
+ end
121
+ ```
122
+
123
+
124
+ #### Using the delete_item_with_http_info variant
125
+
126
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
127
+
128
+ > <Array(nil, Integer, Hash)> delete_item_with_http_info(merchant_item_oid)
129
+
130
+ ```ruby
131
+ begin
132
+ # Delete an item
133
+ data, status_code, headers = api_instance.delete_item_with_http_info(merchant_item_oid)
134
+ p status_code # => 2xx
135
+ p headers # => { ... }
136
+ p data # => nil
137
+ rescue UltracartClient::ApiError => e
138
+ puts "Error when calling ItemApi->delete_item_with_http_info: #{e}"
139
+ end
140
+ ```
141
+
142
+ ### Parameters
143
+
144
+ | Name | Type | Description | Notes |
145
+ | ---- | ---- | ----------- | ----- |
146
+ | **merchant_item_oid** | **Integer** | The item oid to delete. | |
147
+
148
+ ### Return type
149
+
150
+ nil (empty response body)
151
+
152
+ ### Authorization
153
+
154
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
155
+
156
+ ### HTTP request headers
157
+
158
+ - **Content-Type**: Not defined
159
+ - **Accept**: application/json
160
+
161
+
162
+ ## delete_review
163
+
164
+ > delete_review(review_oid, merchant_item_oid)
165
+
166
+ Delete a review
167
+
168
+ Delete an item review.
169
+
170
+
171
+ ### Examples
172
+
173
+ ```ruby
174
+ require 'ultracart_api'
175
+ require_relative '../constants'
176
+
177
+ # Deletes a specific user review for an item. This would most likely be used by a merchant who has cached all
178
+ # reviews on a separate site and then wishes to remove a particular review.
179
+ #
180
+ # The merchant_item_oid is a unique identifier used by UltraCart. If you do not know your item's oid, call
181
+ # ItemApi.get_item_by_merchant_item_id() to retrieve the item, and then it's oid item.merchant_item_oid
182
+ #
183
+ # The review_oid is a unique identifier used by UltraCart. If you do not know a review's oid, call
184
+ # ItemApi.get_reviews() to get all reviews where you can then grab the oid from an item.
185
+ #
186
+ # Success returns back a status code of 204 (No Content)
187
+
188
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
189
+ merchant_item_oid = 123456
190
+ review_oid = 987654
191
+ item_api.delete_review(review_oid, merchant_item_oid)
192
+ ```
193
+
194
+
195
+ #### Using the delete_review_with_http_info variant
196
+
197
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
198
+
199
+ > <Array(nil, Integer, Hash)> delete_review_with_http_info(review_oid, merchant_item_oid)
200
+
201
+ ```ruby
202
+ begin
203
+ # Delete a review
204
+ data, status_code, headers = api_instance.delete_review_with_http_info(review_oid, merchant_item_oid)
205
+ p status_code # => 2xx
206
+ p headers # => { ... }
207
+ p data # => nil
208
+ rescue UltracartClient::ApiError => e
209
+ puts "Error when calling ItemApi->delete_review_with_http_info: #{e}"
210
+ end
211
+ ```
212
+
213
+ ### Parameters
214
+
215
+ | Name | Type | Description | Notes |
216
+ | ---- | ---- | ----------- | ----- |
217
+ | **review_oid** | **Integer** | The review oid to delete. | |
218
+ | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
219
+
220
+ ### Return type
221
+
222
+ nil (empty response body)
223
+
224
+ ### Authorization
225
+
226
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
227
+
228
+ ### HTTP request headers
229
+
230
+ - **Content-Type**: Not defined
231
+ - **Accept**: application/json
232
+
233
+
234
+ ## get_digital_item
235
+
236
+ > <ItemDigitalItemResponse> get_digital_item(digital_item_oid)
237
+
238
+ Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
239
+
240
+ 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.
241
+
242
+
243
+ ### Examples
244
+
245
+ ```ruby
246
+ require 'ultracart_api'
247
+ require_relative '../constants'
248
+ require_relative './item_functions'
249
+
250
+ begin
251
+ # Digital Items are not normal items you sell on your site. They are digital files that you may add to
252
+ # a library and then attach to a normal item as an accessory or the main item itself.
253
+ # See: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1376485/Digital+Items
254
+
255
+ digital_item_oid = insert_sample_digital_item # create an item so I can get an item
256
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
257
+
258
+ opts = { '_expand' => nil }
259
+ api_response = item_api.get_digital_item(digital_item_oid, opts)
260
+ digital_item = api_response.digital_item # assuming this succeeded
261
+
262
+ puts 'The following item was retrieved via get_digital_item():'
263
+ p digital_item
264
+
265
+ delete_sample_digital_item(digital_item_oid)
266
+
267
+ rescue UltracartClient::ApiException => e
268
+ puts 'An ApiException occurred. Please review the following error:'
269
+ p e
270
+ exit(1)
271
+ end
272
+ ```
273
+
274
+
275
+ #### Using the get_digital_item_with_http_info variant
276
+
277
+ This returns an Array which contains the response data, status code and headers.
278
+
279
+ > <Array(<ItemDigitalItemResponse>, Integer, Hash)> get_digital_item_with_http_info(digital_item_oid)
280
+
281
+ ```ruby
282
+ begin
283
+ # Retrieve a digital item from the digital library, which are digital files that may be attached to normal items
284
+ data, status_code, headers = api_instance.get_digital_item_with_http_info(digital_item_oid)
285
+ p status_code # => 2xx
286
+ p headers # => { ... }
287
+ p data # => <ItemDigitalItemResponse>
288
+ rescue UltracartClient::ApiError => e
289
+ puts "Error when calling ItemApi->get_digital_item_with_http_info: #{e}"
290
+ end
291
+ ```
292
+
293
+ ### Parameters
294
+
295
+ | Name | Type | Description | Notes |
296
+ | ---- | ---- | ----------- | ----- |
297
+ | **digital_item_oid** | **Integer** | The digital item oid to retrieve. | |
298
+
299
+ ### Return type
300
+
301
+ [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
302
+
303
+ ### Authorization
304
+
305
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
306
+
307
+ ### HTTP request headers
308
+
309
+ - **Content-Type**: Not defined
310
+ - **Accept**: application/json
311
+
312
+
313
+ ## get_digital_items
314
+
315
+ > <ItemDigitalItemsResponse> get_digital_items(opts)
316
+
317
+ Retrieve digital items from the digital library which are digital files that may be attached to normal items
318
+
319
+ 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.
320
+
321
+
322
+ ### Examples
323
+
324
+ ```ruby
325
+ require 'ultracart_api'
326
+ require_relative '../constants'
327
+ require_relative './item_functions'
328
+
329
+ begin
330
+ # Please Note!
331
+ # Digital Items are not normal items you sell on your site. They are digital files that you may add to
332
+ # a library and then attach to a normal item as an accessory or the main item itself.
333
+ # See: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1376485/Digital+Items
334
+
335
+ # Create a sample digital item to retrieve
336
+ digital_item_oid = insert_sample_digital_item
337
+
338
+ # Initialize the item API
339
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
340
+
341
+ # Prepare API call parameters
342
+ opts = {
343
+ '_limit' => 100,
344
+ '_offset' => 0,
345
+ '_since' => nil, # digital items do not use since. leave as nil.
346
+ '_sort' => nil, # if nil, use default of original_filename
347
+ '_expand' => nil, # digital items have no expansion. leave as nil. this value is ignored
348
+ '_placeholders' => nil # digital items have no placeholders. leave as nil.
349
+ }
350
+
351
+ # Retrieve digital items
352
+ api_response = item_api.get_digital_items(opts)
353
+ digital_items = api_response.digital_items # assuming this succeeded
354
+
355
+ # Output retrieved digital items
356
+ puts 'The following items were retrieved via getDigitalItems():'
357
+ digital_items.each do |digital_item|
358
+ p digital_item
359
+ end
360
+
361
+ rescue UltracartClient::ApiException => e
362
+ puts 'An ApiException occurred. Please review the following error:'
363
+ p e # change_me: handle gracefully
364
+ exit 1
365
+ end
366
+ ```
367
+
368
+
369
+ #### Using the get_digital_items_with_http_info variant
370
+
371
+ This returns an Array which contains the response data, status code and headers.
372
+
373
+ > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_digital_items_with_http_info(opts)
374
+
375
+ ```ruby
376
+ begin
377
+ # Retrieve digital items from the digital library which are digital files that may be attached to normal items
378
+ data, status_code, headers = api_instance.get_digital_items_with_http_info(opts)
379
+ p status_code # => 2xx
380
+ p headers # => { ... }
381
+ p data # => <ItemDigitalItemsResponse>
382
+ rescue UltracartClient::ApiError => e
383
+ puts "Error when calling ItemApi->get_digital_items_with_http_info: #{e}"
384
+ end
385
+ ```
386
+
387
+ ### Parameters
388
+
389
+ | Name | Type | Description | Notes |
390
+ | ---- | ---- | ----------- | ----- |
391
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
392
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
393
+ | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
394
+ | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
395
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
396
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
397
+
398
+ ### Return type
399
+
400
+ [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
401
+
402
+ ### Authorization
403
+
404
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
405
+
406
+ ### HTTP request headers
407
+
408
+ - **Content-Type**: Not defined
409
+ - **Accept**: application/json
410
+
411
+
412
+ ## get_digital_items_by_external_id
413
+
414
+ > <ItemDigitalItemsResponse> get_digital_items_by_external_id(external_id)
415
+
416
+ Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id
417
+
418
+ 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.
419
+
420
+
421
+ ### Examples
422
+
423
+ ```ruby
424
+ require 'ultracart_api'
425
+ require_relative '../constants'
426
+ require_relative './item_functions'
427
+
428
+ begin
429
+ # Please Note!
430
+ # Digital Items are not normal items you sell on your site. They are digital files that you may add to
431
+ # a library and then attach to a normal item as an accessory or the main item itself.
432
+ # See: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1376485/Digital+Items
433
+
434
+ # Generate a unique external ID
435
+ external_id = SecureRandom.uuid
436
+ puts "My external id is #{external_id}"
437
+
438
+ # Create digital item with a specific external id for later use
439
+ digital_item_oid = insert_sample_digital_item(external_id)
440
+
441
+ # Initialize the item API
442
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
443
+
444
+ # Retrieve digital items by external ID
445
+ api_response = item_api.get_digital_items_by_external_id(external_id)
446
+ digital_items = api_response.digital_items # assuming this succeeded
447
+
448
+ # Output retrieved items
449
+ puts 'The following item was retrieved via getDigitalItem():'
450
+ p digital_items
451
+
452
+ # Delete the sample digital item
453
+ delete_sample_digital_item(digital_item_oid)
454
+
455
+ rescue UltracartClient::ApiException => e
456
+ puts 'An ApiException occurred. Please review the following error:'
457
+ p e # change_me: handle gracefully
458
+ exit 1
459
+ end
460
+ ```
461
+
462
+
463
+ #### Using the get_digital_items_by_external_id_with_http_info variant
464
+
465
+ This returns an Array which contains the response data, status code and headers.
466
+
467
+ > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_digital_items_by_external_id_with_http_info(external_id)
468
+
469
+ ```ruby
470
+ begin
471
+ # Retrieves digital items from the digital library (which are digital files that may be attached to normal items) that having a matching external id
472
+ data, status_code, headers = api_instance.get_digital_items_by_external_id_with_http_info(external_id)
473
+ p status_code # => 2xx
474
+ p headers # => { ... }
475
+ p data # => <ItemDigitalItemsResponse>
476
+ rescue UltracartClient::ApiError => e
477
+ puts "Error when calling ItemApi->get_digital_items_by_external_id_with_http_info: #{e}"
478
+ end
479
+ ```
480
+
481
+ ### Parameters
482
+
483
+ | Name | Type | Description | Notes |
484
+ | ---- | ---- | ----------- | ----- |
485
+ | **external_id** | **String** | The external id to match against. | |
486
+
487
+ ### Return type
488
+
489
+ [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
490
+
491
+ ### Authorization
492
+
493
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
494
+
495
+ ### HTTP request headers
496
+
497
+ - **Content-Type**: Not defined
498
+ - **Accept**: application/json
499
+
500
+
501
+ ## get_inventory_snapshot
502
+
503
+ > <ItemInventorySnapshotResponse> get_inventory_snapshot
504
+
505
+ Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
506
+
507
+ Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
508
+
509
+
510
+ ### Examples
511
+
512
+ ```ruby
513
+ require 'ultracart_api'
514
+ require_relative '../constants'
515
+
516
+ # Retrieve a list of item inventories.
517
+ # This method may be called once every 15 minutes. More than that will result in a 429 response.
518
+
519
+ begin
520
+ # Initialize the item API
521
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
522
+
523
+ # Retrieve inventory snapshot
524
+ api_response = item_api.get_inventory_snapshot
525
+ inventories = api_response.inventories
526
+
527
+ # Output each inventory item
528
+ inventories.each do |inventory|
529
+ p inventory
530
+ end
531
+
532
+ rescue UltracartClient::ApiException => e
533
+ puts 'An ApiException occurred. Please review the following error:'
534
+ p e # change_me: handle gracefully
535
+ exit 1
536
+ end
537
+ ```
538
+
539
+
540
+ #### Using the get_inventory_snapshot_with_http_info variant
541
+
542
+ This returns an Array which contains the response data, status code and headers.
543
+
544
+ > <Array(<ItemInventorySnapshotResponse>, Integer, Hash)> get_inventory_snapshot_with_http_info
545
+
546
+ ```ruby
547
+ begin
548
+ # Retrieve a list of item inventories. This method may be called once every 15 minutes. More than that will result in a 429 response.
549
+ data, status_code, headers = api_instance.get_inventory_snapshot_with_http_info
550
+ p status_code # => 2xx
551
+ p headers # => { ... }
552
+ p data # => <ItemInventorySnapshotResponse>
553
+ rescue UltracartClient::ApiError => e
554
+ puts "Error when calling ItemApi->get_inventory_snapshot_with_http_info: #{e}"
555
+ end
556
+ ```
557
+
558
+ ### Parameters
559
+
560
+ This endpoint does not need any parameter.
561
+
562
+ ### Return type
563
+
564
+ [**ItemInventorySnapshotResponse**](ItemInventorySnapshotResponse.md)
565
+
566
+ ### Authorization
567
+
568
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
569
+
570
+ ### HTTP request headers
571
+
572
+ - **Content-Type**: Not defined
573
+ - **Accept**: application/json
574
+
575
+
576
+ ## get_item
577
+
578
+ > <ItemResponse> get_item(merchant_item_oid, opts)
579
+
580
+ Retrieve an item
581
+
582
+ Retrieves a single item using the specified item oid.
583
+
584
+
585
+ ### Examples
586
+
587
+ ```ruby
588
+ require 'ultracart_api'
589
+ require_relative '../constants'
590
+ require_relative './item_functions'
591
+
592
+ begin
593
+ # Of the two getItem methods, you'll probably always use getItemByMerchantItemId instead of this one.
594
+ # Most item work is done with the item id, not the item oid. The latter is only meaningful as a primary
595
+ # key in the UltraCart databases. But here is an example of using getItem(). We take the long route here
596
+ # of retrieving the item using getItemByMerchantItemId to obtain the oid rather than hard-coding it.
597
+ # We do this because these samples are used in our quality control system and run repeatedly.
598
+
599
+ # Insert a sample item
600
+ item_id = insert_sample_item
601
+
602
+ # Initialize APIs
603
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
604
+ customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
605
+
606
+ # Retrieve item by merchant item ID (base object only)
607
+ base_response = item_api.get_item_by_merchant_item_id(item_id, opts = { '_expand' => nil, '_placeholders' => false })
608
+ item = base_response.item
609
+
610
+ merchant_item_oid = item.merchant_item_oid
611
+
612
+ # Possible expansion values documented in comments
613
+ # Expansion demonstrates accessing product reviews
614
+ expand_options = "reviews,reviews.individual_reviews"
615
+
616
+ # Retrieve full item details with expansions
617
+ full_response = item_api.get_item(merchant_item_oid, opts = { '_expand' => expand_options, '_placeholders' => false })
618
+ full_item = full_response.item
619
+
620
+ # Access item reviews
621
+ item_reviews = full_item.reviews
622
+ individual_reviews = item_reviews.individual_reviews
623
+
624
+ # Iterate through individual reviews
625
+ individual_reviews.each do |individual_review|
626
+ # Access rating names and scores (configurable by merchant)
627
+ rating_name = individual_review.get_rating_name1
628
+ rating_score = individual_review.get_rating_score1
629
+
630
+ # Retrieve reviewer information (cautiously to avoid API call limits)
631
+ customer_response = customer_api.get_customer(
632
+ individual_review.customer_profile_oid,
633
+ opts = { '_expand' => "reviewer" }
634
+ )
635
+ customer = customer_response.customer
636
+ reviewer = customer.reviewer
637
+ end
638
+
639
+ # Output the retrieved item
640
+ puts 'The following item was retrieved via getItem():'
641
+ p full_item
642
+
643
+ # Clean up sample item
644
+ delete_sample_item(merchant_item_oid)
645
+
646
+ rescue UltracartClient::ApiException => e
647
+ puts 'An ApiException occurred. Please review the following error:'
648
+ p e # change_me: handle gracefully
649
+ exit 1
650
+ end
651
+ ```
652
+
653
+
654
+ #### Using the get_item_with_http_info variant
655
+
656
+ This returns an Array which contains the response data, status code and headers.
657
+
658
+ > <Array(<ItemResponse>, Integer, Hash)> get_item_with_http_info(merchant_item_oid, opts)
659
+
660
+ ```ruby
661
+ begin
662
+ # Retrieve an item
663
+ data, status_code, headers = api_instance.get_item_with_http_info(merchant_item_oid, opts)
664
+ p status_code # => 2xx
665
+ p headers # => { ... }
666
+ p data # => <ItemResponse>
667
+ rescue UltracartClient::ApiError => e
668
+ puts "Error when calling ItemApi->get_item_with_http_info: #{e}"
669
+ end
670
+ ```
671
+
672
+ ### Parameters
673
+
674
+ | Name | Type | Description | Notes |
675
+ | ---- | ---- | ----------- | ----- |
676
+ | **merchant_item_oid** | **Integer** | The item oid to retrieve. | |
677
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
678
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
679
+
680
+ ### Return type
681
+
682
+ [**ItemResponse**](ItemResponse.md)
683
+
684
+ ### Authorization
685
+
686
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
687
+
688
+ ### HTTP request headers
689
+
690
+ - **Content-Type**: Not defined
691
+ - **Accept**: application/json
692
+
693
+
694
+ ## get_item_by_merchant_item_id
695
+
696
+ > <ItemResponse> get_item_by_merchant_item_id(merchant_item_id, opts)
697
+
698
+ Retrieve an item by item id
699
+
700
+ Retrieves a single item using the specified item id.
701
+
702
+
703
+ ### Examples
704
+
705
+ ```ruby
706
+ require 'ultracart_api'
707
+ require_relative '../constants'
708
+ require_relative './item_functions'
709
+
710
+ begin
711
+ # Of the two getItem methods, you'll probably always use getItemByMerchantItemId instead of this one.
712
+ # Most item work is done with the item id, not the item oid. The latter is only meaningful as a primary
713
+ # key in the UltraCart databases. But here is an example of using getItem(). We take the long route here
714
+ # of retrieving the item using getItemByMerchantItemId to obtain the oid rather than hard-coding it. We do this
715
+ # because these samples are used in our quality control system and run repeatedly.
716
+
717
+ # Insert a sample item
718
+ item_id = insert_sample_item
719
+
720
+ # Initialize item API
721
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
722
+
723
+ # The real devil in the getItem calls is the expansion, making sure you return everything you need without
724
+ # returning everything since these objects are extremely large.
725
+ # These are the possible expansion values:
726
+ #
727
+ # accounting
728
+ # amember
729
+ # auto_order
730
+ # auto_order.steps
731
+ # ccbill
732
+ # channel_partner_mappings
733
+ # chargeback
734
+ # checkout
735
+ # content
736
+ # content.assignments
737
+ # content.attributes
738
+ # content.multimedia
739
+ # content.multimedia.thumbnails
740
+ # digital_delivery
741
+ # ebay
742
+ # email_notifications
743
+ # enrollment123
744
+ # gift_certificate
745
+ # google_product_search
746
+ # kit_definition
747
+ # identifiers
748
+ # instant_payment_notifications
749
+ # internal
750
+ # options
751
+ # payment_processing
752
+ # physical
753
+ # pricing
754
+ # pricing.tiers
755
+ # realtime_pricing
756
+ # related
757
+ # reporting
758
+ # restriction
759
+ # reviews
760
+ # salesforce
761
+ # shipping
762
+ # shipping.cases
763
+ # shipping.destination_markups
764
+ # shipping.destination_restrictions
765
+ # shipping.distribution_centers
766
+ # shipping.methods
767
+ # shipping.package_requirements
768
+ # tax
769
+ # third_party_email_marketing
770
+ # variations
771
+ # wishlist_member
772
+ #
773
+ # just some random ones. contact us if you're unsure
774
+ expand = "kit_definition,options,shipping,tax,variations"
775
+
776
+ # Retrieve item by merchant item ID with expansions
777
+ api_response = item_api.get_item_by_merchant_item_id(
778
+ item_id,
779
+ opts = { '_expand' => expand, '_placeholders' => false }
780
+ )
781
+ item = api_response.item
782
+
783
+ # Output the retrieved item
784
+ puts 'The following item was retrieved via getItemByMerchantItemId():'
785
+ p item
786
+
787
+ # Clean up sample item
788
+ delete_sample_item(item_id)
789
+
790
+ rescue UltracartClient::ApiException => e
791
+ puts 'An ApiException occurred. Please review the following error:'
792
+ p e # change_me: handle gracefully
793
+ exit 1
794
+ end
795
+ ```
796
+
797
+
798
+ #### Using the get_item_by_merchant_item_id_with_http_info variant
799
+
800
+ This returns an Array which contains the response data, status code and headers.
801
+
802
+ > <Array(<ItemResponse>, Integer, Hash)> get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
803
+
804
+ ```ruby
805
+ begin
806
+ # Retrieve an item by item id
807
+ data, status_code, headers = api_instance.get_item_by_merchant_item_id_with_http_info(merchant_item_id, opts)
808
+ p status_code # => 2xx
809
+ p headers # => { ... }
810
+ p data # => <ItemResponse>
811
+ rescue UltracartClient::ApiError => e
812
+ puts "Error when calling ItemApi->get_item_by_merchant_item_id_with_http_info: #{e}"
813
+ end
814
+ ```
815
+
816
+ ### Parameters
817
+
818
+ | Name | Type | Description | Notes |
819
+ | ---- | ---- | ----------- | ----- |
820
+ | **merchant_item_id** | **String** | The item id to retrieve. | |
821
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
822
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
823
+
824
+ ### Return type
825
+
826
+ [**ItemResponse**](ItemResponse.md)
827
+
828
+ ### Authorization
829
+
830
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
831
+
832
+ ### HTTP request headers
833
+
834
+ - **Content-Type**: Not defined
835
+ - **Accept**: application/json
836
+
837
+
838
+ ## get_items
839
+
840
+ > <ItemsResponse> get_items(opts)
841
+
842
+ Retrieve items
843
+
844
+ 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.
845
+
846
+
847
+ ### Examples
848
+
849
+ ```ruby
850
+ require 'ultracart_api'
851
+ require_relative '../constants'
852
+
853
+ # Increase execution time for potentially long-running script
854
+ # Note: Ruby uses different methods for timeout management
855
+ # You may need to adjust based on your specific Ruby environment
856
+
857
+ # This example illustrates how to retrieve items. When dealing with items, please note that categories are
858
+ # essentially folders to organize and store items. They are only used for that purpose and play no role in
859
+ # the checkout process or in the storefront display of items. So you may organize your items as best serves
860
+ # you. We're often asked why we use the word 'category' instead of 'folder'. We started down the road of
861
+ # item management 27 years ago with the word 'category', and it's too much trouble to change. So items are
862
+ # managed by categories, not folders. But they are folders. :)
863
+ #
864
+ # The call takes two possible parameters:
865
+ # 1) parentCategoryId: This is a number which uniquely identifies a category in our system. Not easy to determine.
866
+ # 2) parentCategoryPath: This is the folder path you wish to retrieve, starting with a forward slash "/"
867
+ # If you provide neither of these values, all items are returned.
868
+
869
+ # Method to retrieve a chunk of items
870
+ def get_item_chunk(item_api, offset, limit)
871
+ # The real devil in the getItem calls is the expansion, making sure you return everything you need without
872
+ # returning everything since these objects are extremely large.
873
+ # These are the possible expansion values:
874
+ #
875
+ # accounting amember auto_order auto_order.steps
876
+ # ccbill channel_partner_mappings chargeback checkout
877
+ # content content.assignments content.attributes content.multimedia
878
+ # content.multimedia.thumbnails digital_delivery ebay email_notifications
879
+ # enrollment123 gift_certificate google_product_search kit_definition
880
+ # identifiers instant_payment_notifications internal options
881
+ # payment_processing physical pricing pricing.tiers
882
+ # realtime_pricing related reporting restriction
883
+ # reviews salesforce shipping shipping.cases
884
+ # tax third_party_email_marketing variations wishlist_member
885
+ # shipping.destination_markups
886
+ # shipping.destination_restrictions
887
+ # shipping.distribution_centers
888
+ # shipping.methods
889
+ # shipping.package_requirements
890
+
891
+ # Just some random ones. Contact us if you're unsure
892
+ expand = "kit_definition,options,shipping,tax,variations"
893
+
894
+ # Prepare options for API call
895
+ opts = {
896
+ '_parent_category_id' => nil,
897
+ '_parent_category_path' => nil,
898
+ '_limit' => limit,
899
+ '_offset' => offset,
900
+ '_since' => nil,
901
+ '_sort' => nil,
902
+ '_expand' => expand,
903
+ '_placeholders' => false
904
+ }
905
+
906
+ # Retrieve items
907
+ api_response = item_api.get_items(opts)
908
+
909
+ # Return items or empty array if none found
910
+ api_response.items || []
911
+ end
912
+
913
+ begin
914
+ # Initialize item API
915
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
916
+
917
+ # Pagination variables
918
+ items = []
919
+ iteration = 1
920
+ offset = 0
921
+ limit = 200
922
+ more_records_to_fetch = true
923
+
924
+ # Fetch items in chunks
925
+ while more_records_to_fetch
926
+ puts "executing iteration #{iteration}"
927
+
928
+ chunk_of_items = get_item_chunk(item_api, offset, limit)
929
+ items += chunk_of_items
930
+ offset += limit
931
+ more_records_to_fetch = chunk_of_items.length == limit
932
+ iteration += 1
933
+ end
934
+
935
+ # Output will be verbose...
936
+ p items
937
+
938
+ rescue UltracartClient::ApiException => e
939
+ puts "ApiException occurred on iteration #{iteration}"
940
+ p e
941
+ exit 1
942
+ end
943
+ ```
944
+
945
+
946
+ #### Using the get_items_with_http_info variant
947
+
948
+ This returns an Array which contains the response data, status code and headers.
949
+
950
+ > <Array(<ItemsResponse>, Integer, Hash)> get_items_with_http_info(opts)
951
+
952
+ ```ruby
953
+ begin
954
+ # Retrieve items
955
+ data, status_code, headers = api_instance.get_items_with_http_info(opts)
956
+ p status_code # => 2xx
957
+ p headers # => { ... }
958
+ p data # => <ItemsResponse>
959
+ rescue UltracartClient::ApiError => e
960
+ puts "Error when calling ItemApi->get_items_with_http_info: #{e}"
961
+ end
962
+ ```
963
+
964
+ ### Parameters
965
+
966
+ | Name | Type | Description | Notes |
967
+ | ---- | ---- | ----------- | ----- |
968
+ | **parent_category_id** | **Integer** | The parent category object id to retrieve items for. Unspecified means all items on the account. 0 &#x3D; root | [optional] |
969
+ | **parent_category_path** | **String** | The parent category path to retrieve items for. Unspecified means all items on the account. / &#x3D; root | [optional] |
970
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
971
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
972
+ | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
973
+ | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
974
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
975
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
976
+
977
+ ### Return type
978
+
979
+ [**ItemsResponse**](ItemsResponse.md)
980
+
981
+ ### Authorization
982
+
983
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
984
+
985
+ ### HTTP request headers
986
+
987
+ - **Content-Type**: Not defined
988
+ - **Accept**: application/json
989
+
990
+
991
+ ## get_pricing_tiers
992
+
993
+ > <PricingTiersResponse> get_pricing_tiers(opts)
994
+
995
+ Retrieve pricing tiers
996
+
997
+ Retrieves the pricing tiers
998
+
999
+
1000
+ ### Examples
1001
+
1002
+ ```ruby
1003
+ require 'ultracart_api'
1004
+ require_relative '../constants'
1005
+
1006
+ # Possible expansion values for PricingTier object:
1007
+ # - approval_notification
1008
+ # - signup_notification
1009
+
1010
+ begin
1011
+ # Initialize the item API using the API key from constants
1012
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1013
+
1014
+ # Define expand options in the opts hash
1015
+ opts = {
1016
+ '_expand' => 'approval_notification,signup_notification'
1017
+ }
1018
+
1019
+ # Get pricing tiers with expand options
1020
+ api_response = item_api.get_pricing_tiers(opts)
1021
+
1022
+ # Print the pricing tiers
1023
+ p api_response.pricing_tiers
1024
+
1025
+ rescue UltracartClient::ApiError => e
1026
+ puts 'ApiException occurred.'
1027
+ p e
1028
+ exit(1)
1029
+ end
1030
+ ```
1031
+
1032
+
1033
+ #### Using the get_pricing_tiers_with_http_info variant
1034
+
1035
+ This returns an Array which contains the response data, status code and headers.
1036
+
1037
+ > <Array(<PricingTiersResponse>, Integer, Hash)> get_pricing_tiers_with_http_info(opts)
1038
+
1039
+ ```ruby
1040
+ begin
1041
+ # Retrieve pricing tiers
1042
+ data, status_code, headers = api_instance.get_pricing_tiers_with_http_info(opts)
1043
+ p status_code # => 2xx
1044
+ p headers # => { ... }
1045
+ p data # => <PricingTiersResponse>
1046
+ rescue UltracartClient::ApiError => e
1047
+ puts "Error when calling ItemApi->get_pricing_tiers_with_http_info: #{e}"
1048
+ end
1049
+ ```
1050
+
1051
+ ### Parameters
1052
+
1053
+ | Name | Type | Description | Notes |
1054
+ | ---- | ---- | ----------- | ----- |
1055
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1056
+
1057
+ ### Return type
1058
+
1059
+ [**PricingTiersResponse**](PricingTiersResponse.md)
1060
+
1061
+ ### Authorization
1062
+
1063
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1064
+
1065
+ ### HTTP request headers
1066
+
1067
+ - **Content-Type**: Not defined
1068
+ - **Accept**: application/json
1069
+
1070
+
1071
+ ## get_review
1072
+
1073
+ > <ItemReviewResponse> get_review(review_oid, merchant_item_oid)
1074
+
1075
+ Get a review
1076
+
1077
+ Retrieve an item review.
1078
+
1079
+
1080
+ ### Examples
1081
+
1082
+ ```ruby
1083
+ require 'ultracart_api'
1084
+ require_relative '../constants'
1085
+
1086
+ =begin
1087
+ Retrieves a specific user review for an item. This would most likely be used by a merchant who has cached all
1088
+ reviews on a separate site and then wishes to update a particular review. It's always best to "get" the object,
1089
+ make changes to it, then call the update instead of trying to recreate the object from scratch.
1090
+
1091
+ The merchant_item_oid is a unique identifier used by UltraCart. If you do not know your item's oid, call
1092
+ ItemApi.get_item_by_merchant_item_id() to retrieve the item, and then it's oid item.merchant_item_oid
1093
+
1094
+ The review_oid is a unique identifier used by UltraCart. If you do not know a review's oid, call
1095
+ ItemApi.get_reviews() to get all reviews where you can then grab the oid from an item.
1096
+ =end
1097
+
1098
+ # Initialize the item API
1099
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1100
+
1101
+ # Set merchant item and review OIDs
1102
+ merchant_item_oid = 123456
1103
+ review_oid = 987654
1104
+
1105
+ # Get the review with opts hash
1106
+ begin
1107
+ api_response = item_api.get_review(review_oid, merchant_item_oid)
1108
+
1109
+ # Check for errors
1110
+ if api_response.error
1111
+ warn api_response.error.developer_message
1112
+ warn api_response.error.user_message
1113
+ exit
1114
+ end
1115
+
1116
+ # Print the review
1117
+ p api_response.review
1118
+
1119
+ rescue UltracartClient::ApiError => e
1120
+ warn "API Error: #{e.message}"
1121
+ exit(1)
1122
+ end
1123
+ ```
1124
+
1125
+
1126
+ #### Using the get_review_with_http_info variant
1127
+
1128
+ This returns an Array which contains the response data, status code and headers.
1129
+
1130
+ > <Array(<ItemReviewResponse>, Integer, Hash)> get_review_with_http_info(review_oid, merchant_item_oid)
1131
+
1132
+ ```ruby
1133
+ begin
1134
+ # Get a review
1135
+ data, status_code, headers = api_instance.get_review_with_http_info(review_oid, merchant_item_oid)
1136
+ p status_code # => 2xx
1137
+ p headers # => { ... }
1138
+ p data # => <ItemReviewResponse>
1139
+ rescue UltracartClient::ApiError => e
1140
+ puts "Error when calling ItemApi->get_review_with_http_info: #{e}"
1141
+ end
1142
+ ```
1143
+
1144
+ ### Parameters
1145
+
1146
+ | Name | Type | Description | Notes |
1147
+ | ---- | ---- | ----------- | ----- |
1148
+ | **review_oid** | **Integer** | The review oid to retrieve. | |
1149
+ | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
1150
+
1151
+ ### Return type
1152
+
1153
+ [**ItemReviewResponse**](ItemReviewResponse.md)
1154
+
1155
+ ### Authorization
1156
+
1157
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1158
+
1159
+ ### HTTP request headers
1160
+
1161
+ - **Content-Type**: Not defined
1162
+ - **Accept**: application/json
1163
+
1164
+
1165
+ ## get_reviews
1166
+
1167
+ > <ItemReviewsResponse> get_reviews(merchant_item_oid)
1168
+
1169
+ Get reviews for an item
1170
+
1171
+ Retrieve item reviews.
1172
+
1173
+
1174
+ ### Examples
1175
+
1176
+ ```ruby
1177
+ require 'ultracart_api'
1178
+ require_relative '../constants'
1179
+
1180
+ =begin
1181
+ Retrieves all user reviews for an item.
1182
+
1183
+ The merchant_item_oid is a unique identifier used by UltraCart. If you do not know your item's oid, call
1184
+ ItemApi.get_item_by_merchant_item_id() to retrieve the item, and then its oid item.merchant_item_oid
1185
+ =end
1186
+
1187
+ # Initialize the item API
1188
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1189
+
1190
+ # Set merchant item OID
1191
+ merchant_item_oid = 123456
1192
+
1193
+ begin
1194
+ # Get reviews for the specified merchant item
1195
+ api_response = item_api.get_reviews(merchant_item_oid)
1196
+
1197
+ # Check for errors
1198
+ if api_response.error
1199
+ warn api_response.error.developer_message
1200
+ warn api_response.error.user_message
1201
+ exit
1202
+ end
1203
+
1204
+ # Print each review
1205
+ api_response.reviews.each do |review|
1206
+ p review
1207
+ end
1208
+
1209
+ rescue UltracartClient::ApiError => e
1210
+ warn "API Error: #{e.message}"
1211
+ exit(1)
1212
+ end
1213
+ ```
1214
+
1215
+
1216
+ #### Using the get_reviews_with_http_info variant
1217
+
1218
+ This returns an Array which contains the response data, status code and headers.
1219
+
1220
+ > <Array(<ItemReviewsResponse>, Integer, Hash)> get_reviews_with_http_info(merchant_item_oid)
1221
+
1222
+ ```ruby
1223
+ begin
1224
+ # Get reviews for an item
1225
+ data, status_code, headers = api_instance.get_reviews_with_http_info(merchant_item_oid)
1226
+ p status_code # => 2xx
1227
+ p headers # => { ... }
1228
+ p data # => <ItemReviewsResponse>
1229
+ rescue UltracartClient::ApiError => e
1230
+ puts "Error when calling ItemApi->get_reviews_with_http_info: #{e}"
1231
+ end
1232
+ ```
1233
+
1234
+ ### Parameters
1235
+
1236
+ | Name | Type | Description | Notes |
1237
+ | ---- | ---- | ----------- | ----- |
1238
+ | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
1239
+
1240
+ ### Return type
1241
+
1242
+ [**ItemReviewsResponse**](ItemReviewsResponse.md)
1243
+
1244
+ ### Authorization
1245
+
1246
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1247
+
1248
+ ### HTTP request headers
1249
+
1250
+ - **Content-Type**: Not defined
1251
+ - **Accept**: application/json
1252
+
1253
+
1254
+ ## get_unassociated_digital_items
1255
+
1256
+ > <ItemDigitalItemsResponse> get_unassociated_digital_items(opts)
1257
+
1258
+ Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items
1259
+
1260
+ 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.
1261
+
1262
+
1263
+ ### Examples
1264
+
1265
+ ```ruby
1266
+ require 'ultracart_api'
1267
+ require_relative '../constants'
1268
+ require_relative './item_functions'
1269
+
1270
+ =begin
1271
+ Digital Items are not normal items you sell on your site. They are digital files that you may add to
1272
+ a library and then attach to a normal item as an accessory or the main item itself.
1273
+ See: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1376485/Digital+Items
1274
+
1275
+ Retrieves a group of digital items (file information) from the account that are not yet associated with any
1276
+ actual items. If no parameters are specified, all digital items will be returned. These are
1277
+ digital files that may be associated with normal items.
1278
+
1279
+ Default sort order: original_filename
1280
+ Possible sort orders: original_filename, description, file_size
1281
+ =end
1282
+
1283
+ begin
1284
+ # Create an unassociated digital item
1285
+ digital_item_oid = insert_sample_digital_item
1286
+
1287
+ # Initialize the item API
1288
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1289
+
1290
+ # Prepare options for API call
1291
+ opts = {
1292
+ '_limit' => 100,
1293
+ '_offset' => 0,
1294
+ '_since' => nil, # digital items do not use since
1295
+ '_sort' => nil, # defaults to original_filename
1296
+ '_expand' => nil, # digital items have no expansion
1297
+ '_placeholders' => nil
1298
+ }
1299
+
1300
+ # Get unassociated digital items
1301
+ api_response = item_api.get_unassociated_digital_items(opts)
1302
+
1303
+ # Print retrieved digital items
1304
+ puts 'The following items were retrieved via get_unassociated_digital_items():'
1305
+ api_response.digital_items.each do |digital_item|
1306
+ p digital_item
1307
+ end
1308
+
1309
+ rescue UltracartClient::ApiError => e
1310
+ warn 'An ApiException occurred. Please review the following error:'
1311
+ p e
1312
+ exit(1)
1313
+ end
1314
+ ```
1315
+
1316
+
1317
+ #### Using the get_unassociated_digital_items_with_http_info variant
1318
+
1319
+ This returns an Array which contains the response data, status code and headers.
1320
+
1321
+ > <Array(<ItemDigitalItemsResponse>, Integer, Hash)> get_unassociated_digital_items_with_http_info(opts)
1322
+
1323
+ ```ruby
1324
+ begin
1325
+ # Retrieve digital items from the digital library (which are digital files that may be attached to normal items) not yet associated with actual items
1326
+ data, status_code, headers = api_instance.get_unassociated_digital_items_with_http_info(opts)
1327
+ p status_code # => 2xx
1328
+ p headers # => { ... }
1329
+ p data # => <ItemDigitalItemsResponse>
1330
+ rescue UltracartClient::ApiError => e
1331
+ puts "Error when calling ItemApi->get_unassociated_digital_items_with_http_info: #{e}"
1332
+ end
1333
+ ```
1334
+
1335
+ ### Parameters
1336
+
1337
+ | Name | Type | Description | Notes |
1338
+ | ---- | ---- | ----------- | ----- |
1339
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional][default to 100] |
1340
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
1341
+ | **_since** | **String** | Fetch items that have been created/modified since this date/time. | [optional] |
1342
+ | **_sort** | **String** | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
1343
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1344
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1345
+
1346
+ ### Return type
1347
+
1348
+ [**ItemDigitalItemsResponse**](ItemDigitalItemsResponse.md)
1349
+
1350
+ ### Authorization
1351
+
1352
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1353
+
1354
+ ### HTTP request headers
1355
+
1356
+ - **Content-Type**: Not defined
1357
+ - **Accept**: application/json
1358
+
1359
+
1360
+ ## insert_digital_item
1361
+
1362
+ > <ItemDigitalItemResponse> insert_digital_item(digital_item)
1363
+
1364
+ Create a file within the digital library
1365
+
1366
+ 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.
1367
+
1368
+
1369
+ ### Examples
1370
+
1371
+ ```ruby
1372
+ require 'ultracart_api'
1373
+ require_relative '../constants'
1374
+ require_relative './item_functions'
1375
+
1376
+ begin
1377
+ # Create and then delete a sample digital item
1378
+ digital_item_oid = insert_sample_digital_item
1379
+ delete_sample_digital_item(digital_item_oid)
1380
+
1381
+ rescue UltracartClient::ApiError => e
1382
+ warn 'An ApiException occurred. Please review the following error:'
1383
+ p e
1384
+ exit(1)
1385
+ end
1386
+ ```
1387
+
1388
+
1389
+ #### Using the insert_digital_item_with_http_info variant
1390
+
1391
+ This returns an Array which contains the response data, status code and headers.
1392
+
1393
+ > <Array(<ItemDigitalItemResponse>, Integer, Hash)> insert_digital_item_with_http_info(digital_item)
1394
+
1395
+ ```ruby
1396
+ begin
1397
+ # Create a file within the digital library
1398
+ data, status_code, headers = api_instance.insert_digital_item_with_http_info(digital_item)
1399
+ p status_code # => 2xx
1400
+ p headers # => { ... }
1401
+ p data # => <ItemDigitalItemResponse>
1402
+ rescue UltracartClient::ApiError => e
1403
+ puts "Error when calling ItemApi->insert_digital_item_with_http_info: #{e}"
1404
+ end
1405
+ ```
1406
+
1407
+ ### Parameters
1408
+
1409
+ | Name | Type | Description | Notes |
1410
+ | ---- | ---- | ----------- | ----- |
1411
+ | **digital_item** | [**ItemDigitalItem**](ItemDigitalItem.md) | Digital item to create | |
1412
+
1413
+ ### Return type
1414
+
1415
+ [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
1416
+
1417
+ ### Authorization
1418
+
1419
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1420
+
1421
+ ### HTTP request headers
1422
+
1423
+ - **Content-Type**: application/json; charset=UTF-8
1424
+ - **Accept**: application/json
1425
+
1426
+
1427
+ ## insert_item
1428
+
1429
+ > <ItemResponse> insert_item(item, opts)
1430
+
1431
+ Create an item
1432
+
1433
+ Create a new item on the UltraCart account.
1434
+
1435
+
1436
+ ### Examples
1437
+
1438
+ ```ruby
1439
+ require 'ultracart_api'
1440
+ require_relative '../constants'
1441
+ require_relative './item_functions'
1442
+
1443
+ begin
1444
+ # Create and then delete a sample item
1445
+ item_id = insert_sample_item
1446
+ delete_sample_item(item_id)
1447
+
1448
+ rescue UltracartClient::ApiError => e
1449
+ warn 'An ApiException occurred. Please review the following error:'
1450
+ p e
1451
+ exit(1)
1452
+ end
1453
+ ```
1454
+
1455
+
1456
+ #### Using the insert_item_with_http_info variant
1457
+
1458
+ This returns an Array which contains the response data, status code and headers.
1459
+
1460
+ > <Array(<ItemResponse>, Integer, Hash)> insert_item_with_http_info(item, opts)
1461
+
1462
+ ```ruby
1463
+ begin
1464
+ # Create an item
1465
+ data, status_code, headers = api_instance.insert_item_with_http_info(item, opts)
1466
+ p status_code # => 2xx
1467
+ p headers # => { ... }
1468
+ p data # => <ItemResponse>
1469
+ rescue UltracartClient::ApiError => e
1470
+ puts "Error when calling ItemApi->insert_item_with_http_info: #{e}"
1471
+ end
1472
+ ```
1473
+
1474
+ ### Parameters
1475
+
1476
+ | Name | Type | Description | Notes |
1477
+ | ---- | ---- | ----------- | ----- |
1478
+ | **item** | [**Item**](Item.md) | Item to create | |
1479
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1480
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1481
+
1482
+ ### Return type
1483
+
1484
+ [**ItemResponse**](ItemResponse.md)
1485
+
1486
+ ### Authorization
1487
+
1488
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1489
+
1490
+ ### HTTP request headers
1491
+
1492
+ - **Content-Type**: application/json; charset=UTF-8
1493
+ - **Accept**: application/json
1494
+
1495
+
1496
+ ## insert_review
1497
+
1498
+ > <ItemReviewResponse> insert_review(merchant_item_oid, review)
1499
+
1500
+ Insert a review
1501
+
1502
+ Insert a item review.
1503
+
1504
+
1505
+ ### Examples
1506
+
1507
+ ```ruby
1508
+ #!/usr/bin/env ruby
1509
+ # frozen_string_literal: true
1510
+
1511
+ require 'ultracart_api'
1512
+ require_relative '../constants'
1513
+ require_relative './item_functions'
1514
+
1515
+ begin
1516
+ # To insert a review, you'll need an item's OID (Object Identifier) first. So for this example, we create
1517
+ # a sample item first, then retrieve it by item id to fetch the item oid.
1518
+ item_id = insert_sample_item()
1519
+
1520
+ # Initialize the Item API
1521
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1522
+
1523
+ # Expand string is 'reviews' because we'll need to update the sample item's review template below.
1524
+ # List of expansions for item object: https://www.ultracart.com/api/#resource_item.html
1525
+ opts = {
1526
+ '_expand' => 'reviews'
1527
+ }
1528
+
1529
+ # Retrieve the item by merchant item ID
1530
+ item_response = item_api.get_item_by_merchant_item_id(item_id, opts)
1531
+ item = item_response.item
1532
+ item_oid = item.merchant_item_oid
1533
+
1534
+ # The target item must have a review template associated before you may attach a review.
1535
+ # You may create a review template here:
1536
+ # https://secure.ultracart.com/merchant/item/review/reviewTemplateListLoad.do
1537
+ # We're using a review template from our development system and it will not work for you.
1538
+ # Once you have a review template, update your item either via our gui or the rest api.
1539
+ # GUI: secure.ultracart.com -> Home -> Items -> <your item> -> Edit -> Review tab
1540
+ # Since we're using a sample item we just created above, we'll update via the rest api.
1541
+ # The rest api requires the review template oid, which is found on the template screen
1542
+
1543
+ review_template_oid = 402
1544
+ reviews = UltracartClient::ItemReviews.new(review_template_oid: review_template_oid)
1545
+ item.reviews = reviews
1546
+ item = item_api.update_item(item_oid, item, opts).item
1547
+
1548
+ # You will need to know what your product review looks like.
1549
+ review = UltracartClient::ItemReview.new(
1550
+ title: 'Best Product Ever!',
1551
+ review: "I loved this product. I bought it for my wife and she was so happy she cried. blah blah blah",
1552
+ reviewed_nickname: "Bob420",
1553
+ featured: true, # featured? sure. why not? this is a great review.
1554
+ rating_name1: 'Durability',
1555
+ rating_name2: 'Price',
1556
+ rating_name3: 'Performance',
1557
+ rating_name4: 'Appearance',
1558
+ rating_score1: 4.5,
1559
+ rating_score2: 3.5,
1560
+ rating_score3: 2.5,
1561
+ rating_score4: 1.5,
1562
+ overall: 5.0, # hooray!
1563
+ reviewer_location: "Southside Chicago",
1564
+ status: 'approved'
1565
+ )
1566
+
1567
+ # Insert the review and update our local variable to see how the review looks now.
1568
+ review = item_api.insert_review(item_oid, review).review
1569
+
1570
+ # Output the review object
1571
+ p review
1572
+
1573
+ # This will clean up the sample item, but you may wish to review the item in the backend or on your website first.
1574
+ # delete_sample_item(item_id)
1575
+
1576
+ rescue UltracartClient::ApiError => e
1577
+ puts 'An ApiException occurred. Please review the following error:'
1578
+ p e
1579
+ exit(1)
1580
+
1581
+ end
1582
+ ```
1583
+
1584
+
1585
+ #### Using the insert_review_with_http_info variant
1586
+
1587
+ This returns an Array which contains the response data, status code and headers.
1588
+
1589
+ > <Array(<ItemReviewResponse>, Integer, Hash)> insert_review_with_http_info(merchant_item_oid, review)
1590
+
1591
+ ```ruby
1592
+ begin
1593
+ # Insert a review
1594
+ data, status_code, headers = api_instance.insert_review_with_http_info(merchant_item_oid, review)
1595
+ p status_code # => 2xx
1596
+ p headers # => { ... }
1597
+ p data # => <ItemReviewResponse>
1598
+ rescue UltracartClient::ApiError => e
1599
+ puts "Error when calling ItemApi->insert_review_with_http_info: #{e}"
1600
+ end
1601
+ ```
1602
+
1603
+ ### Parameters
1604
+
1605
+ | Name | Type | Description | Notes |
1606
+ | ---- | ---- | ----------- | ----- |
1607
+ | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
1608
+ | **review** | [**ItemReview**](ItemReview.md) | Review to insert | |
1609
+
1610
+ ### Return type
1611
+
1612
+ [**ItemReviewResponse**](ItemReviewResponse.md)
1613
+
1614
+ ### Authorization
1615
+
1616
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1617
+
1618
+ ### HTTP request headers
1619
+
1620
+ - **Content-Type**: application/json; charset=UTF-8
1621
+ - **Accept**: application/json
1622
+
1623
+
1624
+ ## insert_update_item_content_attribute
1625
+
1626
+ > insert_update_item_content_attribute(merchant_item_oid, item_attribute)
1627
+
1628
+ Upsert an item content attribute
1629
+
1630
+ Update an item content attribute, creating it new if it does not yet exist.
1631
+
1632
+
1633
+ ### Examples
1634
+
1635
+ ```ruby
1636
+ #!/usr/bin/env ruby
1637
+ # frozen_string_literal: true
1638
+
1639
+ require 'ultracart_api'
1640
+ require_relative '../constants'
1641
+
1642
+ =begin
1643
+ While UltraCart provides a means for updating item content, it is StoreFront specific. This method allows for
1644
+ item-wide update of content, such as SEO fields. The content attribute has three fields:
1645
+ 1) name
1646
+ 2) value
1647
+ 3) type: boolean,color,definitionlist,html,integer,mailinglist,multiline,rgba,simplelist,string,videolist
1648
+
1649
+ The SEO content has the following names:
1650
+ Item Meta Title = "storefrontSEOTitle"
1651
+ Item Meta Description = "storefrontSEODescription"
1652
+ Item Meta Keywords = "storefrontSEOKeywords"
1653
+
1654
+ The merchant_item_oid is a unique identifier used by UltraCart. If you do not know your item's oid, call
1655
+ ItemApi.getItemByMerchantItemId() to retrieve the item, and then it's oid $item->getMerchantItemOid()
1656
+
1657
+ Success will return back a status code of 204 (No Content)
1658
+ =end
1659
+
1660
+ # Initialize the Item API
1661
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1662
+ merchant_item_oid = 12345
1663
+
1664
+ # Create the content attribute
1665
+ attribute = UltracartClient::ItemContentAttribute.new(
1666
+ name: "storefrontSEOKeywords",
1667
+ value: 'dog,cat,fish',
1668
+ type: "string"
1669
+ )
1670
+
1671
+ # Insert or update the item content attribute
1672
+ item_api.insert_update_item_content_attribute(merchant_item_oid, attribute)
1673
+ ```
1674
+
1675
+
1676
+ #### Using the insert_update_item_content_attribute_with_http_info variant
1677
+
1678
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
1679
+
1680
+ > <Array(nil, Integer, Hash)> insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute)
1681
+
1682
+ ```ruby
1683
+ begin
1684
+ # Upsert an item content attribute
1685
+ data, status_code, headers = api_instance.insert_update_item_content_attribute_with_http_info(merchant_item_oid, item_attribute)
1686
+ p status_code # => 2xx
1687
+ p headers # => { ... }
1688
+ p data # => nil
1689
+ rescue UltracartClient::ApiError => e
1690
+ puts "Error when calling ItemApi->insert_update_item_content_attribute_with_http_info: #{e}"
1691
+ end
1692
+ ```
1693
+
1694
+ ### Parameters
1695
+
1696
+ | Name | Type | Description | Notes |
1697
+ | ---- | ---- | ----------- | ----- |
1698
+ | **merchant_item_oid** | **Integer** | The item oid to modify. | |
1699
+ | **item_attribute** | [**ItemContentAttribute**](ItemContentAttribute.md) | Item content attribute to upsert | |
1700
+
1701
+ ### Return type
1702
+
1703
+ nil (empty response body)
1704
+
1705
+ ### Authorization
1706
+
1707
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1708
+
1709
+ ### HTTP request headers
1710
+
1711
+ - **Content-Type**: application/json; charset=UTF-8
1712
+ - **Accept**: application/json
1713
+
1714
+
1715
+ ## update_digital_item
1716
+
1717
+ > <ItemDigitalItemResponse> update_digital_item(digital_item_oid, digital_item)
1718
+
1719
+ Updates a file within the digital library
1720
+
1721
+ 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.
1722
+
1723
+
1724
+ ### Examples
1725
+
1726
+ ```ruby
1727
+ #!/usr/bin/env ruby
1728
+ # frozen_string_literal: true
1729
+
1730
+ require 'ultracart_api'
1731
+ require_relative '../constants'
1732
+ require_relative './item_functions'
1733
+
1734
+ begin
1735
+ # Insert a sample digital item
1736
+ digital_item_oid = insert_sample_digital_item()
1737
+
1738
+ # Initialize the Item API
1739
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1740
+
1741
+ # Retrieve the digital item
1742
+ api_response = item_api.get_digital_item(digital_item_oid)
1743
+ digital_item = api_response.digital_item
1744
+
1745
+ # Update the digital item details
1746
+ digital_item.description = "I have updated the description to this sentence."
1747
+ digital_item.click_wrap_agreement = "You hereby agree that the earth is round. No debate."
1748
+
1749
+ # Update the digital item
1750
+ item_api.update_digital_item(digital_item_oid, digital_item)
1751
+
1752
+ # Delete the sample digital item
1753
+ delete_sample_digital_item(digital_item_oid)
1754
+
1755
+ rescue UltracartClient::ApiError => e
1756
+ puts 'An ApiException occurred. Please review the following error:'
1757
+ p e
1758
+ exit(1)
1759
+
1760
+ end
1761
+ ```
1762
+
1763
+
1764
+ #### Using the update_digital_item_with_http_info variant
1765
+
1766
+ This returns an Array which contains the response data, status code and headers.
1767
+
1768
+ > <Array(<ItemDigitalItemResponse>, Integer, Hash)> update_digital_item_with_http_info(digital_item_oid, digital_item)
1769
+
1770
+ ```ruby
1771
+ begin
1772
+ # Updates a file within the digital library
1773
+ data, status_code, headers = api_instance.update_digital_item_with_http_info(digital_item_oid, digital_item)
1774
+ p status_code # => 2xx
1775
+ p headers # => { ... }
1776
+ p data # => <ItemDigitalItemResponse>
1777
+ rescue UltracartClient::ApiError => e
1778
+ puts "Error when calling ItemApi->update_digital_item_with_http_info: #{e}"
1779
+ end
1780
+ ```
1781
+
1782
+ ### Parameters
1783
+
1784
+ | Name | Type | Description | Notes |
1785
+ | ---- | ---- | ----------- | ----- |
1786
+ | **digital_item_oid** | **Integer** | The digital item oid to update. | |
1787
+ | **digital_item** | [**ItemDigitalItem**](ItemDigitalItem.md) | Digital item to update | |
1788
+
1789
+ ### Return type
1790
+
1791
+ [**ItemDigitalItemResponse**](ItemDigitalItemResponse.md)
1792
+
1793
+ ### Authorization
1794
+
1795
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1796
+
1797
+ ### HTTP request headers
1798
+
1799
+ - **Content-Type**: application/json; charset=UTF-8
1800
+ - **Accept**: application/json
1801
+
1802
+
1803
+ ## update_item
1804
+
1805
+ > <ItemResponse> update_item(merchant_item_oid, item, opts)
1806
+
1807
+ Update an item
1808
+
1809
+ Update a new item on the UltraCart account.
1810
+
1811
+
1812
+ ### Examples
1813
+
1814
+ ```ruby
1815
+ #!/usr/bin/env ruby
1816
+ # frozen_string_literal: true
1817
+
1818
+ require 'ultracart_api'
1819
+ require_relative '../constants'
1820
+ require_relative './item_functions'
1821
+
1822
+ begin
1823
+ # Insert a sample item
1824
+ item_id = insert_sample_item()
1825
+
1826
+ # Initialize the Item API
1827
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1828
+
1829
+ # See one of the getItem or getItems samples for possible expansion values
1830
+ # See also: https://www.ultracart.com/api/#resource_item.html
1831
+ opts = {
1832
+ '_expand' => 'pricing',
1833
+ '_placeholders' => false
1834
+ }
1835
+
1836
+ # Retrieve the item
1837
+ api_response = item_api.get_item_by_merchant_item_id(item_id, opts)
1838
+ item = api_response.item
1839
+ original_price = item.pricing.cost
1840
+
1841
+ # Update the price of the item
1842
+ item_pricing = item.pricing
1843
+ item_pricing.cost = 12.99
1844
+
1845
+ # Update the item
1846
+ api_response = item_api.update_item(item.merchant_item_oid, item, opts)
1847
+ updated_item = api_response.item
1848
+
1849
+ # Output the price changes
1850
+ puts "Original Price: #{original_price}"
1851
+ puts "Updated Price: #{updated_item.pricing.cost}"
1852
+
1853
+ # Delete the sample item
1854
+ delete_sample_item(item_id)
1855
+
1856
+ rescue UltracartClient::ApiError => e
1857
+ puts 'An ApiException occurred. Please review the following error:'
1858
+ p e
1859
+ exit(1)
1860
+
1861
+ end
1862
+ ```
1863
+
1864
+
1865
+ #### Using the update_item_with_http_info variant
1866
+
1867
+ This returns an Array which contains the response data, status code and headers.
1868
+
1869
+ > <Array(<ItemResponse>, Integer, Hash)> update_item_with_http_info(merchant_item_oid, item, opts)
1870
+
1871
+ ```ruby
1872
+ begin
1873
+ # Update an item
1874
+ data, status_code, headers = api_instance.update_item_with_http_info(merchant_item_oid, item, opts)
1875
+ p status_code # => 2xx
1876
+ p headers # => { ... }
1877
+ p data # => <ItemResponse>
1878
+ rescue UltracartClient::ApiError => e
1879
+ puts "Error when calling ItemApi->update_item_with_http_info: #{e}"
1880
+ end
1881
+ ```
1882
+
1883
+ ### Parameters
1884
+
1885
+ | Name | Type | Description | Notes |
1886
+ | ---- | ---- | ----------- | ----- |
1887
+ | **merchant_item_oid** | **Integer** | The item oid to update. | |
1888
+ | **item** | [**Item**](Item.md) | Item to update | |
1889
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1890
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1891
+
1892
+ ### Return type
1893
+
1894
+ [**ItemResponse**](ItemResponse.md)
1895
+
1896
+ ### Authorization
1897
+
1898
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1899
+
1900
+ ### HTTP request headers
1901
+
1902
+ - **Content-Type**: application/json; charset=UTF-8
1903
+ - **Accept**: application/json
1904
+
1905
+
1906
+ ## update_items
1907
+
1908
+ > <ItemsResponse> update_items(items_request, opts)
1909
+
1910
+ Update multiple items
1911
+
1912
+ Update multiple item on the UltraCart account.
1913
+
1914
+
1915
+ ### Examples
1916
+
1917
+ ```ruby
1918
+ #!/usr/bin/env ruby
1919
+ # frozen_string_literal: true
1920
+
1921
+ require 'ultracart_api'
1922
+ require_relative '../constants'
1923
+ require_relative './item_functions'
1924
+
1925
+ begin
1926
+ # Insert two sample items
1927
+ item_id1 = insert_sample_item()
1928
+ item_id2 = insert_sample_item()
1929
+
1930
+ # Initialize the Item API
1931
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
1932
+
1933
+ # See one of the getItem or getItems samples for possible expansion values
1934
+ # See also: https://www.ultracart.com/api/#resource_item.html
1935
+ opts = {
1936
+ '_expand' => 'pricing',
1937
+ '_placeholders' => false
1938
+ }
1939
+
1940
+ # Retrieve the items
1941
+ api_response = item_api.get_item_by_merchant_item_id(item_id1, opts)
1942
+ item1 = api_response.item
1943
+ api_response = item_api.get_item_by_merchant_item_id(item_id2, opts)
1944
+ item2 = api_response.item
1945
+
1946
+ # Update the prices of the items
1947
+ item1.pricing.cost = 12.99
1948
+ item2.pricing.cost = 14.99
1949
+
1950
+ # Create items request for bulk update
1951
+ update_items_request = UltracartClient::ItemsRequest.new(items: [item1, item2])
1952
+
1953
+ # Update multiple items
1954
+ api_response = item_api.update_items(update_items_request, opts.merge('_check_groups' => false))
1955
+
1956
+ # Delete the sample items
1957
+ delete_sample_item(item_id1)
1958
+ delete_sample_item(item_id2)
1959
+
1960
+ rescue UltracartClient::ApiError => e
1961
+ puts 'An ApiException occurred. Please review the following error:'
1962
+ p e
1963
+ exit(1)
1964
+
1965
+ end
1966
+ ```
1967
+
1968
+
1969
+ #### Using the update_items_with_http_info variant
1970
+
1971
+ This returns an Array which contains the response data, status code and headers.
1972
+
1973
+ > <Array(<ItemsResponse>, Integer, Hash)> update_items_with_http_info(items_request, opts)
1974
+
1975
+ ```ruby
1976
+ begin
1977
+ # Update multiple items
1978
+ data, status_code, headers = api_instance.update_items_with_http_info(items_request, opts)
1979
+ p status_code # => 2xx
1980
+ p headers # => { ... }
1981
+ p data # => <ItemsResponse>
1982
+ rescue UltracartClient::ApiError => e
1983
+ puts "Error when calling ItemApi->update_items_with_http_info: #{e}"
1984
+ end
1985
+ ```
1986
+
1987
+ ### Parameters
1988
+
1989
+ | Name | Type | Description | Notes |
1990
+ | ---- | ---- | ----------- | ----- |
1991
+ | **items_request** | [**ItemsRequest**](ItemsRequest.md) | Items to update (synchronous maximum 20 / asynchronous maximum 100) | |
1992
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1993
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1994
+ | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
1995
+
1996
+ ### Return type
1997
+
1998
+ [**ItemsResponse**](ItemsResponse.md)
1999
+
2000
+ ### Authorization
2001
+
2002
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
2003
+
2004
+ ### HTTP request headers
2005
+
2006
+ - **Content-Type**: application/json; charset=UTF-8
2007
+ - **Accept**: application/json
2008
+
2009
+
2010
+ ## update_review
2011
+
2012
+ > <ItemReviewResponse> update_review(review_oid, merchant_item_oid, review)
2013
+
2014
+ Update a review
2015
+
2016
+ Update an item review.
2017
+
2018
+
2019
+ ### Examples
2020
+
2021
+ ```ruby
2022
+ #!/usr/bin/env ruby
2023
+ # frozen_string_literal: true
2024
+
2025
+ require 'ultracart_api'
2026
+ require_relative '../constants'
2027
+ require_relative './item_functions'
2028
+
2029
+ begin
2030
+ # To update a review, you'll need an item's OID (Object Identifier) and the review oid first.
2031
+
2032
+ # If you don't know your oid, call getItemByMerchantItemId() to get your item, then get the oid.
2033
+ merchant_item_oid = 99998888
2034
+ review_oid = 123456 # This is the particular oid you wish to update.
2035
+
2036
+ # Initialize the Item API
2037
+ item_api = UltracartClient::ItemApi.new_using_api_key(Constants::API_KEY)
2038
+
2039
+ # Retrieve the existing review
2040
+ review = item_api.get_review(merchant_item_oid, review_oid).review
2041
+
2042
+ # Update the review details
2043
+ review = UltracartClient::ItemReview.new(
2044
+ title: 'Best Product Ever!',
2045
+ review: "I loved this product. I bought it for my wife and she was so happy she cried. blah blah blah",
2046
+ reviewed_nickname: "Bob420",
2047
+ featured: true, # featured? sure. why not? this is a great review.
2048
+ rating_name1: 'Durability',
2049
+ rating_name2: 'Price',
2050
+ rating_name3: 'Performance',
2051
+ rating_name4: 'Appearance',
2052
+ rating_score1: 4.5,
2053
+ rating_score2: 3.5,
2054
+ rating_score3: 2.5,
2055
+ rating_score4: 1.5,
2056
+ overall: 5.0, # hooray!
2057
+ reviewer_location: "Southside Chicago",
2058
+ status: 'approved'
2059
+ )
2060
+
2061
+ # Update the review and retrieve the updated review
2062
+ review = item_api.update_review(review_oid, merchant_item_oid, review).review
2063
+
2064
+ # Output the review object
2065
+ p review
2066
+
2067
+ # This will clean up the sample item, but you may wish to review the item in the backend or on your website first.
2068
+ # delete_sample_item(item_id)
2069
+
2070
+ rescue UltracartClient::ApiError => e
2071
+ puts 'An ApiException occurred. Please review the following error:'
2072
+ p e
2073
+ exit(1)
2074
+
2075
+ end
2076
+ ```
2077
+
2078
+
2079
+ #### Using the update_review_with_http_info variant
2080
+
2081
+ This returns an Array which contains the response data, status code and headers.
2082
+
2083
+ > <Array(<ItemReviewResponse>, Integer, Hash)> update_review_with_http_info(review_oid, merchant_item_oid, review)
2084
+
2085
+ ```ruby
2086
+ begin
2087
+ # Update a review
2088
+ data, status_code, headers = api_instance.update_review_with_http_info(review_oid, merchant_item_oid, review)
2089
+ p status_code # => 2xx
2090
+ p headers # => { ... }
2091
+ p data # => <ItemReviewResponse>
2092
+ rescue UltracartClient::ApiError => e
2093
+ puts "Error when calling ItemApi->update_review_with_http_info: #{e}"
2094
+ end
2095
+ ```
2096
+
2097
+ ### Parameters
2098
+
2099
+ | Name | Type | Description | Notes |
2100
+ | ---- | ---- | ----------- | ----- |
2101
+ | **review_oid** | **Integer** | The review oid to update. | |
2102
+ | **merchant_item_oid** | **Integer** | The item oid the review is associated with. | |
2103
+ | **review** | [**ItemReview**](ItemReview.md) | Review to update | |
2104
+
2105
+ ### Return type
2106
+
2107
+ [**ItemReviewResponse**](ItemReviewResponse.md)
2108
+
2109
+ ### Authorization
2110
+
2111
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
2112
+
2113
+ ### HTTP request headers
2114
+
2115
+ - **Content-Type**: application/json; charset=UTF-8
2116
+ - **Accept**: application/json
2117
+
2118
+
2119
+ ## upload_temporary_multimedia
2120
+
2121
+ > <TempMultimediaResponse> upload_temporary_multimedia(file)
2122
+
2123
+ Upload an image to the temporary multimedia.
2124
+
2125
+ Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.
2126
+
2127
+
2128
+ ### Examples
2129
+
2130
+ ```ruby
2131
+ # This method is used internally by UltraCart.
2132
+ # We don't envision a scenario where a merchant would ever need to call this.
2133
+ # As such, we're not providing a sample for it. If you can think of a use for this
2134
+ # method, contact us, and we'll help you work through it.
2135
+ ```
2136
+
2137
+
2138
+ #### Using the upload_temporary_multimedia_with_http_info variant
2139
+
2140
+ This returns an Array which contains the response data, status code and headers.
2141
+
2142
+ > <Array(<TempMultimediaResponse>, Integer, Hash)> upload_temporary_multimedia_with_http_info(file)
2143
+
2144
+ ```ruby
2145
+ begin
2146
+ # Upload an image to the temporary multimedia.
2147
+ data, status_code, headers = api_instance.upload_temporary_multimedia_with_http_info(file)
2148
+ p status_code # => 2xx
2149
+ p headers # => { ... }
2150
+ p data # => <TempMultimediaResponse>
2151
+ rescue UltracartClient::ApiError => e
2152
+ puts "Error when calling ItemApi->upload_temporary_multimedia_with_http_info: #{e}"
2153
+ end
2154
+ ```
2155
+
2156
+ ### Parameters
2157
+
2158
+ | Name | Type | Description | Notes |
2159
+ | ---- | ---- | ----------- | ----- |
2160
+ | **file** | **File** | File to upload | |
2161
+
2162
+ ### Return type
2163
+
2164
+ [**TempMultimediaResponse**](TempMultimediaResponse.md)
2165
+
2166
+ ### Authorization
2167
+
2168
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
2169
+
2170
+ ### HTTP request headers
2171
+
2172
+ - **Content-Type**: multipart/form-data
2173
+ - **Accept**: application/json
2174
+