ultracart_api 4.1.163 → 4.1.166

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