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
@@ -1,617 +1,617 @@
1
- # UltracartClient::GiftCertificateApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**add_gift_certificate_ledger_entry**](GiftCertificateApi.md#add_gift_certificate_ledger_entry) | **POST** /gift_certificate/gift_certificates/{gift_certificate_oid}/ledger_entry | Add a gift certificate ledger entry |
8
- | [**create_gift_certificate**](GiftCertificateApi.md#create_gift_certificate) | **POST** /gift_certificate/gift_certificates | Create a gift certificate |
9
- | [**delete_gift_certificate**](GiftCertificateApi.md#delete_gift_certificate) | **DELETE** /gift_certificate/gift_certificates/{gift_certificate_oid} | Delete a gift certificate |
10
- | [**get_gift_certificate_by_code**](GiftCertificateApi.md#get_gift_certificate_by_code) | **POST** /gift_certificate/gift_certificates/by_code/{code} | Retrieve gift certificate by code |
11
- | [**get_gift_certificate_by_oid**](GiftCertificateApi.md#get_gift_certificate_by_oid) | **POST** /gift_certificate/gift_certificates/{gift_certificate_oid} | Retrieve gift certificate by oid |
12
- | [**get_gift_certificates_by_email**](GiftCertificateApi.md#get_gift_certificates_by_email) | **POST** /gift_certificate/gift_certificates/by_email/{email} | Retrieve gift certificate by email |
13
- | [**get_gift_certificates_by_query**](GiftCertificateApi.md#get_gift_certificates_by_query) | **POST** /gift_certificate/gift_certificates/query | Retrieve gift certificates by query |
14
- | [**update_gift_certificate**](GiftCertificateApi.md#update_gift_certificate) | **PUT** /gift_certificate/gift_certificates/{gift_certificate_oid} | Update a gift certificate |
15
-
16
-
17
- ## add_gift_certificate_ledger_entry
18
-
19
- > <GiftCertificateResponse> add_gift_certificate_ledger_entry(gift_certificate_oid, gift_certificate_ledger_entry)
20
-
21
- Add a gift certificate ledger entry
22
-
23
- Adds a ledger entry for this gift certificate.
24
-
25
-
26
- ### Examples
27
-
28
- ```ruby
29
- # frozen_string_literal: true
30
-
31
- require 'date'
32
- require 'json'
33
- require 'yaml'
34
- require 'ultracart_api'
35
- require_relative '../constants'
36
-
37
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
38
-
39
- gift_certificate_oid = 676_713
40
-
41
- ledger_entry = UltracartClient::GiftCertificateLedgerEntry.new
42
-
43
- ledger_entry.amount = -15.35 # this is the change amount in the gift certificate.
44
- # amount is not a balance. it will be subtracted from it.
45
- ledger_entry.description = 'Customer bought something over the counter'
46
- ledger_entry.entry_dts = DateTime.now
47
- ledger_entry.gift_certificate_ledger_oid = 0 # the system will assign an oid. do not assign one here.
48
- ledger_entry.gift_certificate_oid = gift_certificate_oid # this is an existing gift certificate oid.
49
- # The existing gift certificate was created using create_gift_certificate.rb
50
- ledger_entry.reference_order_id = 'BLAH-12345'
51
- # if this ledger entry is related to an order, add it here, else use null.
52
-
53
- # add ledger entry does not take an expansion variable. it will return the entire object by default.
54
- api_response = api.add_gift_certificate_ledger_entry(gift_certificate_oid, ledger_entry)
55
- gift_certificate = api_response.gift_certificate
56
-
57
- puts gift_certificate.to_yaml
58
- ```
59
-
60
-
61
- #### Using the add_gift_certificate_ledger_entry_with_http_info variant
62
-
63
- This returns an Array which contains the response data, status code and headers.
64
-
65
- > <Array(<GiftCertificateResponse>, Integer, Hash)> add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
66
-
67
- ```ruby
68
- begin
69
- # Add a gift certificate ledger entry
70
- data, status_code, headers = api_instance.add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
71
- p status_code # => 2xx
72
- p headers # => { ... }
73
- p data # => <GiftCertificateResponse>
74
- rescue UltracartClient::ApiError => e
75
- puts "Error when calling GiftCertificateApi->add_gift_certificate_ledger_entry_with_http_info: #{e}"
76
- end
77
- ```
78
-
79
- ### Parameters
80
-
81
- | Name | Type | Description | Notes |
82
- | ---- | ---- | ----------- | ----- |
83
- | **gift_certificate_oid** | **Integer** | | |
84
- | **gift_certificate_ledger_entry** | [**GiftCertificateLedgerEntry**](GiftCertificateLedgerEntry.md) | Gift certificate ledger entry | |
85
-
86
- ### Return type
87
-
88
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
89
-
90
- ### Authorization
91
-
92
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
93
-
94
- ### HTTP request headers
95
-
96
- - **Content-Type**: application/json
97
- - **Accept**: application/json
98
-
99
-
100
- ## create_gift_certificate
101
-
102
- > <GiftCertificateResponse> create_gift_certificate(gift_certificate_create_request)
103
-
104
- Create a gift certificate
105
-
106
- Creates a gift certificate for this merchant account.
107
-
108
-
109
- ### Examples
110
-
111
- ```ruby
112
-
113
- require 'date'
114
- require 'json'
115
- require 'yaml'
116
- require 'ultracart_api'
117
- require_relative '../constants'
118
-
119
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
120
-
121
- create_request = UltracartClient::GiftCertificateCreateRequest.new
122
-
123
- expiration_dts = DateTime.now + 90
124
- create_request.amount = 150.75
125
- create_request.initial_ledger_description = "Issued instead of refund"
126
- create_request.merchant_note = 'Problem Order: blah-12345\nIssued gift certificate due to stale product.\nIssued By: Customer Service Rep Joe Smith'
127
- create_request.email = 'support@ultracart.com'
128
- create_request.expiration_dts = expiration_dts.iso8601
129
-
130
-
131
- # create does not take an expansion variable. it will return the entire object by default.
132
- api_response = api.create_gift_certificate(create_request)
133
- gift_certificate = api_response.gift_certificate
134
-
135
- puts gift_certificate.to_yaml
136
- ```
137
-
138
-
139
- #### Using the create_gift_certificate_with_http_info variant
140
-
141
- This returns an Array which contains the response data, status code and headers.
142
-
143
- > <Array(<GiftCertificateResponse>, Integer, Hash)> create_gift_certificate_with_http_info(gift_certificate_create_request)
144
-
145
- ```ruby
146
- begin
147
- # Create a gift certificate
148
- data, status_code, headers = api_instance.create_gift_certificate_with_http_info(gift_certificate_create_request)
149
- p status_code # => 2xx
150
- p headers # => { ... }
151
- p data # => <GiftCertificateResponse>
152
- rescue UltracartClient::ApiError => e
153
- puts "Error when calling GiftCertificateApi->create_gift_certificate_with_http_info: #{e}"
154
- end
155
- ```
156
-
157
- ### Parameters
158
-
159
- | Name | Type | Description | Notes |
160
- | ---- | ---- | ----------- | ----- |
161
- | **gift_certificate_create_request** | [**GiftCertificateCreateRequest**](GiftCertificateCreateRequest.md) | Gift certificate create request | |
162
-
163
- ### Return type
164
-
165
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
166
-
167
- ### Authorization
168
-
169
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
170
-
171
- ### HTTP request headers
172
-
173
- - **Content-Type**: application/json
174
- - **Accept**: application/json
175
-
176
-
177
- ## delete_gift_certificate
178
-
179
- > delete_gift_certificate(gift_certificate_oid)
180
-
181
- Delete a gift certificate
182
-
183
- Deletes a gift certificate for this merchant account.
184
-
185
-
186
- ### Examples
187
-
188
- ```ruby
189
- require 'json'
190
- require 'yaml'
191
- require 'ultracart_api'
192
- require_relative '../constants'
193
-
194
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
195
-
196
- gift_certificate_oid = 676_713
197
-
198
-
199
- api.delete_gift_certificate(gift_certificate_oid)
200
-
201
- # re-querying the gift certificate will still return an object, but the deleted property will be true.
202
- # by_oid does not take an expansion variable. it will return the entire object by default.
203
- api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
204
- gift_certificate = api_response.gift_certificate
205
-
206
- puts gift_certificate.to_yaml
207
- ```
208
-
209
-
210
- #### Using the delete_gift_certificate_with_http_info variant
211
-
212
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
213
-
214
- > <Array(nil, Integer, Hash)> delete_gift_certificate_with_http_info(gift_certificate_oid)
215
-
216
- ```ruby
217
- begin
218
- # Delete a gift certificate
219
- data, status_code, headers = api_instance.delete_gift_certificate_with_http_info(gift_certificate_oid)
220
- p status_code # => 2xx
221
- p headers # => { ... }
222
- p data # => nil
223
- rescue UltracartClient::ApiError => e
224
- puts "Error when calling GiftCertificateApi->delete_gift_certificate_with_http_info: #{e}"
225
- end
226
- ```
227
-
228
- ### Parameters
229
-
230
- | Name | Type | Description | Notes |
231
- | ---- | ---- | ----------- | ----- |
232
- | **gift_certificate_oid** | **Integer** | | |
233
-
234
- ### Return type
235
-
236
- nil (empty response body)
237
-
238
- ### Authorization
239
-
240
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
241
-
242
- ### HTTP request headers
243
-
244
- - **Content-Type**: Not defined
245
- - **Accept**: application/json
246
-
247
-
248
- ## get_gift_certificate_by_code
249
-
250
- > <GiftCertificateResponse> get_gift_certificate_by_code(code)
251
-
252
- Retrieve gift certificate by code
253
-
254
- Retrieves a gift certificate from the account based on the code (the value the customer enters at checkout time).
255
-
256
-
257
- ### Examples
258
-
259
- ```ruby
260
- # frozen_string_literal: true
261
-
262
- require 'json'
263
- require 'yaml'
264
- require 'ultracart_api'
265
- require_relative '../constants'
266
-
267
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
268
-
269
- code = '74BX2Q8B7K'
270
-
271
- # by_code does not take an expansion variable. it will return the entire object by default.
272
- api_response = api.get_gift_certificate_by_code(code)
273
- gift_certificate = api_response.gift_certificate
274
-
275
- puts gift_certificate.to_yaml
276
- ```
277
-
278
-
279
- #### Using the get_gift_certificate_by_code_with_http_info variant
280
-
281
- This returns an Array which contains the response data, status code and headers.
282
-
283
- > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_code_with_http_info(code)
284
-
285
- ```ruby
286
- begin
287
- # Retrieve gift certificate by code
288
- data, status_code, headers = api_instance.get_gift_certificate_by_code_with_http_info(code)
289
- p status_code # => 2xx
290
- p headers # => { ... }
291
- p data # => <GiftCertificateResponse>
292
- rescue UltracartClient::ApiError => e
293
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_code_with_http_info: #{e}"
294
- end
295
- ```
296
-
297
- ### Parameters
298
-
299
- | Name | Type | Description | Notes |
300
- | ---- | ---- | ----------- | ----- |
301
- | **code** | **String** | | |
302
-
303
- ### Return type
304
-
305
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
306
-
307
- ### Authorization
308
-
309
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
310
-
311
- ### HTTP request headers
312
-
313
- - **Content-Type**: Not defined
314
- - **Accept**: application/json
315
-
316
-
317
- ## get_gift_certificate_by_oid
318
-
319
- > <GiftCertificateResponse> get_gift_certificate_by_oid(gift_certificate_oid)
320
-
321
- Retrieve gift certificate by oid
322
-
323
- Retrieves a gift certificate from the account based on the internal primary key.
324
-
325
-
326
- ### Examples
327
-
328
- ```ruby
329
- require 'json'
330
- require 'yaml'
331
- require 'ultracart_api'
332
- require_relative '../constants'
333
-
334
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
335
-
336
- gift_certificate_oid = 676_713
337
-
338
- # by_oid does not take an expansion variable. it will return the entire object by default.
339
- api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
340
- gift_certificate = api_response.gift_certificate
341
-
342
- puts gift_certificate.to_yaml
343
- ```
344
-
345
-
346
- #### Using the get_gift_certificate_by_oid_with_http_info variant
347
-
348
- This returns an Array which contains the response data, status code and headers.
349
-
350
- > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
351
-
352
- ```ruby
353
- begin
354
- # Retrieve gift certificate by oid
355
- data, status_code, headers = api_instance.get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
356
- p status_code # => 2xx
357
- p headers # => { ... }
358
- p data # => <GiftCertificateResponse>
359
- rescue UltracartClient::ApiError => e
360
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_oid_with_http_info: #{e}"
361
- end
362
- ```
363
-
364
- ### Parameters
365
-
366
- | Name | Type | Description | Notes |
367
- | ---- | ---- | ----------- | ----- |
368
- | **gift_certificate_oid** | **Integer** | | |
369
-
370
- ### Return type
371
-
372
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
373
-
374
- ### Authorization
375
-
376
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
377
-
378
- ### HTTP request headers
379
-
380
- - **Content-Type**: Not defined
381
- - **Accept**: application/json
382
-
383
-
384
- ## get_gift_certificates_by_email
385
-
386
- > <GiftCertificatesResponse> get_gift_certificates_by_email(email)
387
-
388
- Retrieve gift certificate by email
389
-
390
- Retrieves all gift certificates from the account based on customer email.
391
-
392
-
393
- ### Examples
394
-
395
- ```ruby
396
- require 'json'
397
- require 'yaml'
398
- require 'ultracart_api'
399
- require_relative '../constants'
400
-
401
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
402
-
403
- email = 'support@ultracart.com'
404
-
405
- # by_email does not take an expansion variable. it will return the entire object by default.
406
- api_response = api.get_gift_certificates_by_email(email)
407
- gift_certificates = api_response.gift_certificates
408
-
409
- puts gift_certificates.to_yaml
410
- ```
411
-
412
-
413
- #### Using the get_gift_certificates_by_email_with_http_info variant
414
-
415
- This returns an Array which contains the response data, status code and headers.
416
-
417
- > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_email_with_http_info(email)
418
-
419
- ```ruby
420
- begin
421
- # Retrieve gift certificate by email
422
- data, status_code, headers = api_instance.get_gift_certificates_by_email_with_http_info(email)
423
- p status_code # => 2xx
424
- p headers # => { ... }
425
- p data # => <GiftCertificatesResponse>
426
- rescue UltracartClient::ApiError => e
427
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_email_with_http_info: #{e}"
428
- end
429
- ```
430
-
431
- ### Parameters
432
-
433
- | Name | Type | Description | Notes |
434
- | ---- | ---- | ----------- | ----- |
435
- | **email** | **String** | | |
436
-
437
- ### Return type
438
-
439
- [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
440
-
441
- ### Authorization
442
-
443
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
444
-
445
- ### HTTP request headers
446
-
447
- - **Content-Type**: Not defined
448
- - **Accept**: application/json
449
-
450
-
451
- ## get_gift_certificates_by_query
452
-
453
- > <GiftCertificatesResponse> get_gift_certificates_by_query(gift_certificate_query, opts)
454
-
455
- Retrieve gift certificates by query
456
-
457
- Retrieves gift certificates from the account. If no parameters are specified, all gift certificates 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.
458
-
459
-
460
- ### Examples
461
-
462
- ```ruby
463
- require 'json'
464
- require 'yaml'
465
- require 'ultracart_api'
466
- require_relative '../constants'
467
-
468
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
469
-
470
- def get_gift_certificates_chuck(api, offset, limit)
471
- expansion = 'ledger'.freeze
472
- query = UltracartClient::GiftCertificateQuery.new # leaving this empty, so no filtering, and I should get all records returned.
473
- api_response = api.get_gift_certificates_by_query(query, { _limit: limit, _offset: offset, _expand: expansion })
474
- return api_response.gift_certificates unless api_response.gift_certificates.nil?
475
-
476
- []
477
- end
478
-
479
-
480
- gift_certificates = []
481
-
482
- iteration = 1
483
- offset = 0
484
- limit = 200
485
- more_records_to_fetch = true
486
-
487
- while more_records_to_fetch
488
-
489
- puts "executing iteration #{iteration}"
490
- chuck_of_certificates = get_gift_certificates_chuck(api, offset, limit)
491
- gift_certificates.push(*chuck_of_certificates)
492
- offset += limit
493
- more_records_to_fetch = chuck_of_certificates.length == limit
494
- iteration += 1
495
-
496
- end
497
-
498
- puts gift_certificates.to_yaml
499
- ```
500
-
501
-
502
- #### Using the get_gift_certificates_by_query_with_http_info variant
503
-
504
- This returns an Array which contains the response data, status code and headers.
505
-
506
- > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
507
-
508
- ```ruby
509
- begin
510
- # Retrieve gift certificates by query
511
- data, status_code, headers = api_instance.get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
512
- p status_code # => 2xx
513
- p headers # => { ... }
514
- p data # => <GiftCertificatesResponse>
515
- rescue UltracartClient::ApiError => e
516
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_query_with_http_info: #{e}"
517
- end
518
- ```
519
-
520
- ### Parameters
521
-
522
- | Name | Type | Description | Notes |
523
- | ---- | ---- | ----------- | ----- |
524
- | **gift_certificate_query** | [**GiftCertificateQuery**](GiftCertificateQuery.md) | Gift certificates query | |
525
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
526
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
527
- | **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
528
- | **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
529
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
530
-
531
- ### Return type
532
-
533
- [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
534
-
535
- ### Authorization
536
-
537
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
538
-
539
- ### HTTP request headers
540
-
541
- - **Content-Type**: application/json
542
- - **Accept**: application/json
543
-
544
-
545
- ## update_gift_certificate
546
-
547
- > <GiftCertificateResponse> update_gift_certificate(gift_certificate_oid, gift_certificate)
548
-
549
- Update a gift certificate
550
-
551
- Update a gift certificate for this merchant account.
552
-
553
-
554
- ### Examples
555
-
556
- ```ruby
557
- require 'json'
558
- require 'yaml'
559
- require 'ultracart_api'
560
- require_relative '../constants'
561
-
562
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
563
-
564
- # grab a gift certificate that already exists. use the create script if needed.
565
- gift_certificate_oid = 676_713
566
-
567
- api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
568
- gift_certificate = api_response.gift_certificate
569
-
570
- gift_certificate.email = 'perry@ultracart.com'
571
-
572
- # by_code does not take an expansion variable. it will return the entire object by default.
573
- api_response = api.update_gift_certificate(gift_certificate_oid, gift_certificate)
574
- gift_certificate = api_response.gift_certificate
575
-
576
- puts gift_certificate.to_yaml
577
- ```
578
-
579
-
580
- #### Using the update_gift_certificate_with_http_info variant
581
-
582
- This returns an Array which contains the response data, status code and headers.
583
-
584
- > <Array(<GiftCertificateResponse>, Integer, Hash)> update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
585
-
586
- ```ruby
587
- begin
588
- # Update a gift certificate
589
- data, status_code, headers = api_instance.update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
590
- p status_code # => 2xx
591
- p headers # => { ... }
592
- p data # => <GiftCertificateResponse>
593
- rescue UltracartClient::ApiError => e
594
- puts "Error when calling GiftCertificateApi->update_gift_certificate_with_http_info: #{e}"
595
- end
596
- ```
597
-
598
- ### Parameters
599
-
600
- | Name | Type | Description | Notes |
601
- | ---- | ---- | ----------- | ----- |
602
- | **gift_certificate_oid** | **Integer** | | |
603
- | **gift_certificate** | [**GiftCertificate**](GiftCertificate.md) | Gift certificate | |
604
-
605
- ### Return type
606
-
607
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
608
-
609
- ### Authorization
610
-
611
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
612
-
613
- ### HTTP request headers
614
-
615
- - **Content-Type**: application/json
616
- - **Accept**: application/json
617
-
1
+ # UltracartClient::GiftCertificateApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**add_gift_certificate_ledger_entry**](GiftCertificateApi.md#add_gift_certificate_ledger_entry) | **POST** /gift_certificate/gift_certificates/{gift_certificate_oid}/ledger_entry | Add a gift certificate ledger entry |
8
+ | [**create_gift_certificate**](GiftCertificateApi.md#create_gift_certificate) | **POST** /gift_certificate/gift_certificates | Create a gift certificate |
9
+ | [**delete_gift_certificate**](GiftCertificateApi.md#delete_gift_certificate) | **DELETE** /gift_certificate/gift_certificates/{gift_certificate_oid} | Delete a gift certificate |
10
+ | [**get_gift_certificate_by_code**](GiftCertificateApi.md#get_gift_certificate_by_code) | **POST** /gift_certificate/gift_certificates/by_code/{code} | Retrieve gift certificate by code |
11
+ | [**get_gift_certificate_by_oid**](GiftCertificateApi.md#get_gift_certificate_by_oid) | **POST** /gift_certificate/gift_certificates/{gift_certificate_oid} | Retrieve gift certificate by oid |
12
+ | [**get_gift_certificates_by_email**](GiftCertificateApi.md#get_gift_certificates_by_email) | **POST** /gift_certificate/gift_certificates/by_email/{email} | Retrieve gift certificate by email |
13
+ | [**get_gift_certificates_by_query**](GiftCertificateApi.md#get_gift_certificates_by_query) | **POST** /gift_certificate/gift_certificates/query | Retrieve gift certificates by query |
14
+ | [**update_gift_certificate**](GiftCertificateApi.md#update_gift_certificate) | **PUT** /gift_certificate/gift_certificates/{gift_certificate_oid} | Update a gift certificate |
15
+
16
+
17
+ ## add_gift_certificate_ledger_entry
18
+
19
+ > <GiftCertificateResponse> add_gift_certificate_ledger_entry(gift_certificate_oid, gift_certificate_ledger_entry)
20
+
21
+ Add a gift certificate ledger entry
22
+
23
+ Adds a ledger entry for this gift certificate.
24
+
25
+
26
+ ### Examples
27
+
28
+ ```ruby
29
+ # frozen_string_literal: true
30
+
31
+ require 'date'
32
+ require 'json'
33
+ require 'yaml'
34
+ require 'ultracart_api'
35
+ require_relative '../constants'
36
+
37
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
38
+
39
+ gift_certificate_oid = 676_713
40
+
41
+ ledger_entry = UltracartClient::GiftCertificateLedgerEntry.new
42
+
43
+ ledger_entry.amount = -15.35 # this is the change amount in the gift certificate.
44
+ # amount is not a balance. it will be subtracted from it.
45
+ ledger_entry.description = 'Customer bought something over the counter'
46
+ ledger_entry.entry_dts = DateTime.now
47
+ ledger_entry.gift_certificate_ledger_oid = 0 # the system will assign an oid. do not assign one here.
48
+ ledger_entry.gift_certificate_oid = gift_certificate_oid # this is an existing gift certificate oid.
49
+ # The existing gift certificate was created using create_gift_certificate.rb
50
+ ledger_entry.reference_order_id = 'BLAH-12345'
51
+ # if this ledger entry is related to an order, add it here, else use null.
52
+
53
+ # add ledger entry does not take an expansion variable. it will return the entire object by default.
54
+ api_response = api.add_gift_certificate_ledger_entry(gift_certificate_oid, ledger_entry)
55
+ gift_certificate = api_response.gift_certificate
56
+
57
+ puts gift_certificate.to_yaml
58
+ ```
59
+
60
+
61
+ #### Using the add_gift_certificate_ledger_entry_with_http_info variant
62
+
63
+ This returns an Array which contains the response data, status code and headers.
64
+
65
+ > <Array(<GiftCertificateResponse>, Integer, Hash)> add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
66
+
67
+ ```ruby
68
+ begin
69
+ # Add a gift certificate ledger entry
70
+ data, status_code, headers = api_instance.add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
71
+ p status_code # => 2xx
72
+ p headers # => { ... }
73
+ p data # => <GiftCertificateResponse>
74
+ rescue UltracartClient::ApiError => e
75
+ puts "Error when calling GiftCertificateApi->add_gift_certificate_ledger_entry_with_http_info: #{e}"
76
+ end
77
+ ```
78
+
79
+ ### Parameters
80
+
81
+ | Name | Type | Description | Notes |
82
+ | ---- | ---- | ----------- | ----- |
83
+ | **gift_certificate_oid** | **Integer** | | |
84
+ | **gift_certificate_ledger_entry** | [**GiftCertificateLedgerEntry**](GiftCertificateLedgerEntry.md) | Gift certificate ledger entry | |
85
+
86
+ ### Return type
87
+
88
+ [**GiftCertificateResponse**](GiftCertificateResponse.md)
89
+
90
+ ### Authorization
91
+
92
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
93
+
94
+ ### HTTP request headers
95
+
96
+ - **Content-Type**: application/json
97
+ - **Accept**: application/json
98
+
99
+
100
+ ## create_gift_certificate
101
+
102
+ > <GiftCertificateResponse> create_gift_certificate(gift_certificate_create_request)
103
+
104
+ Create a gift certificate
105
+
106
+ Creates a gift certificate for this merchant account.
107
+
108
+
109
+ ### Examples
110
+
111
+ ```ruby
112
+
113
+ require 'date'
114
+ require 'json'
115
+ require 'yaml'
116
+ require 'ultracart_api'
117
+ require_relative '../constants'
118
+
119
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
120
+
121
+ create_request = UltracartClient::GiftCertificateCreateRequest.new
122
+
123
+ expiration_dts = DateTime.now + 90
124
+ create_request.amount = 150.75
125
+ create_request.initial_ledger_description = "Issued instead of refund"
126
+ create_request.merchant_note = 'Problem Order: blah-12345\nIssued gift certificate due to stale product.\nIssued By: Customer Service Rep Joe Smith'
127
+ create_request.email = 'support@ultracart.com'
128
+ create_request.expiration_dts = expiration_dts.iso8601
129
+
130
+
131
+ # create does not take an expansion variable. it will return the entire object by default.
132
+ api_response = api.create_gift_certificate(create_request)
133
+ gift_certificate = api_response.gift_certificate
134
+
135
+ puts gift_certificate.to_yaml
136
+ ```
137
+
138
+
139
+ #### Using the create_gift_certificate_with_http_info variant
140
+
141
+ This returns an Array which contains the response data, status code and headers.
142
+
143
+ > <Array(<GiftCertificateResponse>, Integer, Hash)> create_gift_certificate_with_http_info(gift_certificate_create_request)
144
+
145
+ ```ruby
146
+ begin
147
+ # Create a gift certificate
148
+ data, status_code, headers = api_instance.create_gift_certificate_with_http_info(gift_certificate_create_request)
149
+ p status_code # => 2xx
150
+ p headers # => { ... }
151
+ p data # => <GiftCertificateResponse>
152
+ rescue UltracartClient::ApiError => e
153
+ puts "Error when calling GiftCertificateApi->create_gift_certificate_with_http_info: #{e}"
154
+ end
155
+ ```
156
+
157
+ ### Parameters
158
+
159
+ | Name | Type | Description | Notes |
160
+ | ---- | ---- | ----------- | ----- |
161
+ | **gift_certificate_create_request** | [**GiftCertificateCreateRequest**](GiftCertificateCreateRequest.md) | Gift certificate create request | |
162
+
163
+ ### Return type
164
+
165
+ [**GiftCertificateResponse**](GiftCertificateResponse.md)
166
+
167
+ ### Authorization
168
+
169
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
170
+
171
+ ### HTTP request headers
172
+
173
+ - **Content-Type**: application/json
174
+ - **Accept**: application/json
175
+
176
+
177
+ ## delete_gift_certificate
178
+
179
+ > delete_gift_certificate(gift_certificate_oid)
180
+
181
+ Delete a gift certificate
182
+
183
+ Deletes a gift certificate for this merchant account.
184
+
185
+
186
+ ### Examples
187
+
188
+ ```ruby
189
+ require 'json'
190
+ require 'yaml'
191
+ require 'ultracart_api'
192
+ require_relative '../constants'
193
+
194
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
195
+
196
+ gift_certificate_oid = 676_713
197
+
198
+
199
+ api.delete_gift_certificate(gift_certificate_oid)
200
+
201
+ # re-querying the gift certificate will still return an object, but the deleted property will be true.
202
+ # by_oid does not take an expansion variable. it will return the entire object by default.
203
+ api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
204
+ gift_certificate = api_response.gift_certificate
205
+
206
+ puts gift_certificate.to_yaml
207
+ ```
208
+
209
+
210
+ #### Using the delete_gift_certificate_with_http_info variant
211
+
212
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
213
+
214
+ > <Array(nil, Integer, Hash)> delete_gift_certificate_with_http_info(gift_certificate_oid)
215
+
216
+ ```ruby
217
+ begin
218
+ # Delete a gift certificate
219
+ data, status_code, headers = api_instance.delete_gift_certificate_with_http_info(gift_certificate_oid)
220
+ p status_code # => 2xx
221
+ p headers # => { ... }
222
+ p data # => nil
223
+ rescue UltracartClient::ApiError => e
224
+ puts "Error when calling GiftCertificateApi->delete_gift_certificate_with_http_info: #{e}"
225
+ end
226
+ ```
227
+
228
+ ### Parameters
229
+
230
+ | Name | Type | Description | Notes |
231
+ | ---- | ---- | ----------- | ----- |
232
+ | **gift_certificate_oid** | **Integer** | | |
233
+
234
+ ### Return type
235
+
236
+ nil (empty response body)
237
+
238
+ ### Authorization
239
+
240
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
241
+
242
+ ### HTTP request headers
243
+
244
+ - **Content-Type**: Not defined
245
+ - **Accept**: application/json
246
+
247
+
248
+ ## get_gift_certificate_by_code
249
+
250
+ > <GiftCertificateResponse> get_gift_certificate_by_code(code)
251
+
252
+ Retrieve gift certificate by code
253
+
254
+ Retrieves a gift certificate from the account based on the code (the value the customer enters at checkout time).
255
+
256
+
257
+ ### Examples
258
+
259
+ ```ruby
260
+ # frozen_string_literal: true
261
+
262
+ require 'json'
263
+ require 'yaml'
264
+ require 'ultracart_api'
265
+ require_relative '../constants'
266
+
267
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
268
+
269
+ code = '74BX2Q8B7K'
270
+
271
+ # by_code does not take an expansion variable. it will return the entire object by default.
272
+ api_response = api.get_gift_certificate_by_code(code)
273
+ gift_certificate = api_response.gift_certificate
274
+
275
+ puts gift_certificate.to_yaml
276
+ ```
277
+
278
+
279
+ #### Using the get_gift_certificate_by_code_with_http_info variant
280
+
281
+ This returns an Array which contains the response data, status code and headers.
282
+
283
+ > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_code_with_http_info(code)
284
+
285
+ ```ruby
286
+ begin
287
+ # Retrieve gift certificate by code
288
+ data, status_code, headers = api_instance.get_gift_certificate_by_code_with_http_info(code)
289
+ p status_code # => 2xx
290
+ p headers # => { ... }
291
+ p data # => <GiftCertificateResponse>
292
+ rescue UltracartClient::ApiError => e
293
+ puts "Error when calling GiftCertificateApi->get_gift_certificate_by_code_with_http_info: #{e}"
294
+ end
295
+ ```
296
+
297
+ ### Parameters
298
+
299
+ | Name | Type | Description | Notes |
300
+ | ---- | ---- | ----------- | ----- |
301
+ | **code** | **String** | | |
302
+
303
+ ### Return type
304
+
305
+ [**GiftCertificateResponse**](GiftCertificateResponse.md)
306
+
307
+ ### Authorization
308
+
309
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
310
+
311
+ ### HTTP request headers
312
+
313
+ - **Content-Type**: Not defined
314
+ - **Accept**: application/json
315
+
316
+
317
+ ## get_gift_certificate_by_oid
318
+
319
+ > <GiftCertificateResponse> get_gift_certificate_by_oid(gift_certificate_oid)
320
+
321
+ Retrieve gift certificate by oid
322
+
323
+ Retrieves a gift certificate from the account based on the internal primary key.
324
+
325
+
326
+ ### Examples
327
+
328
+ ```ruby
329
+ require 'json'
330
+ require 'yaml'
331
+ require 'ultracart_api'
332
+ require_relative '../constants'
333
+
334
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
335
+
336
+ gift_certificate_oid = 676_713
337
+
338
+ # by_oid does not take an expansion variable. it will return the entire object by default.
339
+ api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
340
+ gift_certificate = api_response.gift_certificate
341
+
342
+ puts gift_certificate.to_yaml
343
+ ```
344
+
345
+
346
+ #### Using the get_gift_certificate_by_oid_with_http_info variant
347
+
348
+ This returns an Array which contains the response data, status code and headers.
349
+
350
+ > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
351
+
352
+ ```ruby
353
+ begin
354
+ # Retrieve gift certificate by oid
355
+ data, status_code, headers = api_instance.get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
356
+ p status_code # => 2xx
357
+ p headers # => { ... }
358
+ p data # => <GiftCertificateResponse>
359
+ rescue UltracartClient::ApiError => e
360
+ puts "Error when calling GiftCertificateApi->get_gift_certificate_by_oid_with_http_info: #{e}"
361
+ end
362
+ ```
363
+
364
+ ### Parameters
365
+
366
+ | Name | Type | Description | Notes |
367
+ | ---- | ---- | ----------- | ----- |
368
+ | **gift_certificate_oid** | **Integer** | | |
369
+
370
+ ### Return type
371
+
372
+ [**GiftCertificateResponse**](GiftCertificateResponse.md)
373
+
374
+ ### Authorization
375
+
376
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
377
+
378
+ ### HTTP request headers
379
+
380
+ - **Content-Type**: Not defined
381
+ - **Accept**: application/json
382
+
383
+
384
+ ## get_gift_certificates_by_email
385
+
386
+ > <GiftCertificatesResponse> get_gift_certificates_by_email(email)
387
+
388
+ Retrieve gift certificate by email
389
+
390
+ Retrieves all gift certificates from the account based on customer email.
391
+
392
+
393
+ ### Examples
394
+
395
+ ```ruby
396
+ require 'json'
397
+ require 'yaml'
398
+ require 'ultracart_api'
399
+ require_relative '../constants'
400
+
401
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
402
+
403
+ email = 'support@ultracart.com'
404
+
405
+ # by_email does not take an expansion variable. it will return the entire object by default.
406
+ api_response = api.get_gift_certificates_by_email(email)
407
+ gift_certificates = api_response.gift_certificates
408
+
409
+ puts gift_certificates.to_yaml
410
+ ```
411
+
412
+
413
+ #### Using the get_gift_certificates_by_email_with_http_info variant
414
+
415
+ This returns an Array which contains the response data, status code and headers.
416
+
417
+ > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_email_with_http_info(email)
418
+
419
+ ```ruby
420
+ begin
421
+ # Retrieve gift certificate by email
422
+ data, status_code, headers = api_instance.get_gift_certificates_by_email_with_http_info(email)
423
+ p status_code # => 2xx
424
+ p headers # => { ... }
425
+ p data # => <GiftCertificatesResponse>
426
+ rescue UltracartClient::ApiError => e
427
+ puts "Error when calling GiftCertificateApi->get_gift_certificates_by_email_with_http_info: #{e}"
428
+ end
429
+ ```
430
+
431
+ ### Parameters
432
+
433
+ | Name | Type | Description | Notes |
434
+ | ---- | ---- | ----------- | ----- |
435
+ | **email** | **String** | | |
436
+
437
+ ### Return type
438
+
439
+ [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
440
+
441
+ ### Authorization
442
+
443
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
444
+
445
+ ### HTTP request headers
446
+
447
+ - **Content-Type**: Not defined
448
+ - **Accept**: application/json
449
+
450
+
451
+ ## get_gift_certificates_by_query
452
+
453
+ > <GiftCertificatesResponse> get_gift_certificates_by_query(gift_certificate_query, opts)
454
+
455
+ Retrieve gift certificates by query
456
+
457
+ Retrieves gift certificates from the account. If no parameters are specified, all gift certificates 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.
458
+
459
+
460
+ ### Examples
461
+
462
+ ```ruby
463
+ require 'json'
464
+ require 'yaml'
465
+ require 'ultracart_api'
466
+ require_relative '../constants'
467
+
468
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
469
+
470
+ def get_gift_certificates_chuck(api, offset, limit)
471
+ expansion = 'ledger'.freeze
472
+ query = UltracartClient::GiftCertificateQuery.new # leaving this empty, so no filtering, and I should get all records returned.
473
+ api_response = api.get_gift_certificates_by_query(query, { _limit: limit, _offset: offset, _expand: expansion })
474
+ return api_response.gift_certificates unless api_response.gift_certificates.nil?
475
+
476
+ []
477
+ end
478
+
479
+
480
+ gift_certificates = []
481
+
482
+ iteration = 1
483
+ offset = 0
484
+ limit = 200
485
+ more_records_to_fetch = true
486
+
487
+ while more_records_to_fetch
488
+
489
+ puts "executing iteration #{iteration}"
490
+ chuck_of_certificates = get_gift_certificates_chuck(api, offset, limit)
491
+ gift_certificates.push(*chuck_of_certificates)
492
+ offset += limit
493
+ more_records_to_fetch = chuck_of_certificates.length == limit
494
+ iteration += 1
495
+
496
+ end
497
+
498
+ puts gift_certificates.to_yaml
499
+ ```
500
+
501
+
502
+ #### Using the get_gift_certificates_by_query_with_http_info variant
503
+
504
+ This returns an Array which contains the response data, status code and headers.
505
+
506
+ > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
507
+
508
+ ```ruby
509
+ begin
510
+ # Retrieve gift certificates by query
511
+ data, status_code, headers = api_instance.get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
512
+ p status_code # => 2xx
513
+ p headers # => { ... }
514
+ p data # => <GiftCertificatesResponse>
515
+ rescue UltracartClient::ApiError => e
516
+ puts "Error when calling GiftCertificateApi->get_gift_certificates_by_query_with_http_info: #{e}"
517
+ end
518
+ ```
519
+
520
+ ### Parameters
521
+
522
+ | Name | Type | Description | Notes |
523
+ | ---- | ---- | ----------- | ----- |
524
+ | **gift_certificate_query** | [**GiftCertificateQuery**](GiftCertificateQuery.md) | Gift certificates query | |
525
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
526
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
527
+ | **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
528
+ | **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
529
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
530
+
531
+ ### Return type
532
+
533
+ [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
534
+
535
+ ### Authorization
536
+
537
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
538
+
539
+ ### HTTP request headers
540
+
541
+ - **Content-Type**: application/json
542
+ - **Accept**: application/json
543
+
544
+
545
+ ## update_gift_certificate
546
+
547
+ > <GiftCertificateResponse> update_gift_certificate(gift_certificate_oid, gift_certificate)
548
+
549
+ Update a gift certificate
550
+
551
+ Update a gift certificate for this merchant account.
552
+
553
+
554
+ ### Examples
555
+
556
+ ```ruby
557
+ require 'json'
558
+ require 'yaml'
559
+ require 'ultracart_api'
560
+ require_relative '../constants'
561
+
562
+ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
563
+
564
+ # grab a gift certificate that already exists. use the create script if needed.
565
+ gift_certificate_oid = 676_713
566
+
567
+ api_response = api.get_gift_certificate_by_oid(gift_certificate_oid)
568
+ gift_certificate = api_response.gift_certificate
569
+
570
+ gift_certificate.email = 'perry@ultracart.com'
571
+
572
+ # by_code does not take an expansion variable. it will return the entire object by default.
573
+ api_response = api.update_gift_certificate(gift_certificate_oid, gift_certificate)
574
+ gift_certificate = api_response.gift_certificate
575
+
576
+ puts gift_certificate.to_yaml
577
+ ```
578
+
579
+
580
+ #### Using the update_gift_certificate_with_http_info variant
581
+
582
+ This returns an Array which contains the response data, status code and headers.
583
+
584
+ > <Array(<GiftCertificateResponse>, Integer, Hash)> update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
585
+
586
+ ```ruby
587
+ begin
588
+ # Update a gift certificate
589
+ data, status_code, headers = api_instance.update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
590
+ p status_code # => 2xx
591
+ p headers # => { ... }
592
+ p data # => <GiftCertificateResponse>
593
+ rescue UltracartClient::ApiError => e
594
+ puts "Error when calling GiftCertificateApi->update_gift_certificate_with_http_info: #{e}"
595
+ end
596
+ ```
597
+
598
+ ### Parameters
599
+
600
+ | Name | Type | Description | Notes |
601
+ | ---- | ---- | ----------- | ----- |
602
+ | **gift_certificate_oid** | **Integer** | | |
603
+ | **gift_certificate** | [**GiftCertificate**](GiftCertificate.md) | Gift certificate | |
604
+
605
+ ### Return type
606
+
607
+ [**GiftCertificateResponse**](GiftCertificateResponse.md)
608
+
609
+ ### Authorization
610
+
611
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
612
+
613
+ ### HTTP request headers
614
+
615
+ - **Content-Type**: application/json
616
+ - **Accept**: application/json
617
+