ultracart_api 4.1.12 → 4.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,598 +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
- ### Examples
26
-
27
- ```ruby
28
- require 'time'
29
- require 'ultracart_api'
30
- require 'json'
31
- require 'yaml'
32
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
33
-
34
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
35
- # As such, this might not be the best way to use this object.
36
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
37
-
38
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
39
- gift_certificate_oid = 56 # Integer |
40
- gift_certificate_ledger_entry = UltracartClient::GiftCertificateLedgerEntry.new # GiftCertificateLedgerEntry | Gift certificate ledger entry
41
-
42
- begin
43
- # Add a gift certificate ledger entry
44
- result = api_instance.add_gift_certificate_ledger_entry(gift_certificate_oid, gift_certificate_ledger_entry)
45
- p result
46
- rescue UltracartClient::ApiError => e
47
- puts "Error when calling GiftCertificateApi->add_gift_certificate_ledger_entry: #{e}"
48
- end
49
- ```
50
-
51
- #### Using the add_gift_certificate_ledger_entry_with_http_info variant
52
-
53
- This returns an Array which contains the response data, status code and headers.
54
-
55
- > <Array(<GiftCertificateResponse>, Integer, Hash)> add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
56
-
57
- ```ruby
58
- begin
59
- # Add a gift certificate ledger entry
60
- data, status_code, headers = api_instance.add_gift_certificate_ledger_entry_with_http_info(gift_certificate_oid, gift_certificate_ledger_entry)
61
- p status_code # => 2xx
62
- p headers # => { ... }
63
- p data # => <GiftCertificateResponse>
64
- rescue UltracartClient::ApiError => e
65
- puts "Error when calling GiftCertificateApi->add_gift_certificate_ledger_entry_with_http_info: #{e}"
66
- end
67
- ```
68
-
69
- ### Parameters
70
-
71
- | Name | Type | Description | Notes |
72
- | ---- | ---- | ----------- | ----- |
73
- | **gift_certificate_oid** | **Integer** | | |
74
- | **gift_certificate_ledger_entry** | [**GiftCertificateLedgerEntry**](GiftCertificateLedgerEntry.md) | Gift certificate ledger entry | |
75
-
76
- ### Return type
77
-
78
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
79
-
80
- ### Authorization
81
-
82
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
83
-
84
- ### HTTP request headers
85
-
86
- - **Content-Type**: application/json
87
- - **Accept**: application/json
88
-
89
-
90
- ## create_gift_certificate
91
-
92
- > <GiftCertificateResponse> create_gift_certificate(gift_certificate_create_request)
93
-
94
- Create a gift certificate
95
-
96
- Creates a gift certificate for this merchant account.
97
-
98
- ### Examples
99
-
100
- ```ruby
101
- require 'time'
102
- require 'ultracart_api'
103
- require 'json'
104
- require 'yaml'
105
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
106
-
107
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
108
- # As such, this might not be the best way to use this object.
109
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
110
-
111
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
112
- gift_certificate_create_request = UltracartClient::GiftCertificateCreateRequest.new # GiftCertificateCreateRequest | Gift certificate create request
113
-
114
- begin
115
- # Create a gift certificate
116
- result = api_instance.create_gift_certificate(gift_certificate_create_request)
117
- p result
118
- rescue UltracartClient::ApiError => e
119
- puts "Error when calling GiftCertificateApi->create_gift_certificate: #{e}"
120
- end
121
- ```
122
-
123
- #### Using the create_gift_certificate_with_http_info variant
124
-
125
- This returns an Array which contains the response data, status code and headers.
126
-
127
- > <Array(<GiftCertificateResponse>, Integer, Hash)> create_gift_certificate_with_http_info(gift_certificate_create_request)
128
-
129
- ```ruby
130
- begin
131
- # Create a gift certificate
132
- data, status_code, headers = api_instance.create_gift_certificate_with_http_info(gift_certificate_create_request)
133
- p status_code # => 2xx
134
- p headers # => { ... }
135
- p data # => <GiftCertificateResponse>
136
- rescue UltracartClient::ApiError => e
137
- puts "Error when calling GiftCertificateApi->create_gift_certificate_with_http_info: #{e}"
138
- end
139
- ```
140
-
141
- ### Parameters
142
-
143
- | Name | Type | Description | Notes |
144
- | ---- | ---- | ----------- | ----- |
145
- | **gift_certificate_create_request** | [**GiftCertificateCreateRequest**](GiftCertificateCreateRequest.md) | Gift certificate create request | |
146
-
147
- ### Return type
148
-
149
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
150
-
151
- ### Authorization
152
-
153
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
154
-
155
- ### HTTP request headers
156
-
157
- - **Content-Type**: application/json
158
- - **Accept**: application/json
159
-
160
-
161
- ## delete_gift_certificate
162
-
163
- > delete_gift_certificate(gift_certificate_oid)
164
-
165
- Delete a gift certificate
166
-
167
- Deletes a gift certificate for this merchant account.
168
-
169
- ### Examples
170
-
171
- ```ruby
172
- require 'time'
173
- require 'ultracart_api'
174
- require 'json'
175
- require 'yaml'
176
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
177
-
178
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
179
- # As such, this might not be the best way to use this object.
180
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
181
-
182
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
183
- gift_certificate_oid = 56 # Integer |
184
-
185
- begin
186
- # Delete a gift certificate
187
- api_instance.delete_gift_certificate(gift_certificate_oid)
188
- rescue UltracartClient::ApiError => e
189
- puts "Error when calling GiftCertificateApi->delete_gift_certificate: #{e}"
190
- end
191
- ```
192
-
193
- #### Using the delete_gift_certificate_with_http_info variant
194
-
195
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
196
-
197
- > <Array(nil, Integer, Hash)> delete_gift_certificate_with_http_info(gift_certificate_oid)
198
-
199
- ```ruby
200
- begin
201
- # Delete a gift certificate
202
- data, status_code, headers = api_instance.delete_gift_certificate_with_http_info(gift_certificate_oid)
203
- p status_code # => 2xx
204
- p headers # => { ... }
205
- p data # => nil
206
- rescue UltracartClient::ApiError => e
207
- puts "Error when calling GiftCertificateApi->delete_gift_certificate_with_http_info: #{e}"
208
- end
209
- ```
210
-
211
- ### Parameters
212
-
213
- | Name | Type | Description | Notes |
214
- | ---- | ---- | ----------- | ----- |
215
- | **gift_certificate_oid** | **Integer** | | |
216
-
217
- ### Return type
218
-
219
- nil (empty response body)
220
-
221
- ### Authorization
222
-
223
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
224
-
225
- ### HTTP request headers
226
-
227
- - **Content-Type**: Not defined
228
- - **Accept**: application/json
229
-
230
-
231
- ## get_gift_certificate_by_code
232
-
233
- > <GiftCertificateResponse> get_gift_certificate_by_code(code)
234
-
235
- Retrieve gift certificate by code
236
-
237
- Retrieves a gift certificate from the account based on the code (the value the customer enters at checkout time).
238
-
239
- ### Examples
240
-
241
- ```ruby
242
- require 'time'
243
- require 'ultracart_api'
244
- require 'json'
245
- require 'yaml'
246
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
247
-
248
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
249
- # As such, this might not be the best way to use this object.
250
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
251
-
252
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
253
- code = 'code_example' # String |
254
-
255
- begin
256
- # Retrieve gift certificate by code
257
- result = api_instance.get_gift_certificate_by_code(code)
258
- p result
259
- rescue UltracartClient::ApiError => e
260
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_code: #{e}"
261
- end
262
- ```
263
-
264
- #### Using the get_gift_certificate_by_code_with_http_info variant
265
-
266
- This returns an Array which contains the response data, status code and headers.
267
-
268
- > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_code_with_http_info(code)
269
-
270
- ```ruby
271
- begin
272
- # Retrieve gift certificate by code
273
- data, status_code, headers = api_instance.get_gift_certificate_by_code_with_http_info(code)
274
- p status_code # => 2xx
275
- p headers # => { ... }
276
- p data # => <GiftCertificateResponse>
277
- rescue UltracartClient::ApiError => e
278
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_code_with_http_info: #{e}"
279
- end
280
- ```
281
-
282
- ### Parameters
283
-
284
- | Name | Type | Description | Notes |
285
- | ---- | ---- | ----------- | ----- |
286
- | **code** | **String** | | |
287
-
288
- ### Return type
289
-
290
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
291
-
292
- ### Authorization
293
-
294
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
295
-
296
- ### HTTP request headers
297
-
298
- - **Content-Type**: Not defined
299
- - **Accept**: application/json
300
-
301
-
302
- ## get_gift_certificate_by_oid
303
-
304
- > <GiftCertificateResponse> get_gift_certificate_by_oid(gift_certificate_oid)
305
-
306
- Retrieve gift certificate by oid
307
-
308
- Retrieves a gift certificate from the account based on the internal primary key.
309
-
310
- ### Examples
311
-
312
- ```ruby
313
- require 'time'
314
- require 'ultracart_api'
315
- require 'json'
316
- require 'yaml'
317
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
318
-
319
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
320
- # As such, this might not be the best way to use this object.
321
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
322
-
323
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
324
- gift_certificate_oid = 56 # Integer |
325
-
326
- begin
327
- # Retrieve gift certificate by oid
328
- result = api_instance.get_gift_certificate_by_oid(gift_certificate_oid)
329
- p result
330
- rescue UltracartClient::ApiError => e
331
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_oid: #{e}"
332
- end
333
- ```
334
-
335
- #### Using the get_gift_certificate_by_oid_with_http_info variant
336
-
337
- This returns an Array which contains the response data, status code and headers.
338
-
339
- > <Array(<GiftCertificateResponse>, Integer, Hash)> get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
340
-
341
- ```ruby
342
- begin
343
- # Retrieve gift certificate by oid
344
- data, status_code, headers = api_instance.get_gift_certificate_by_oid_with_http_info(gift_certificate_oid)
345
- p status_code # => 2xx
346
- p headers # => { ... }
347
- p data # => <GiftCertificateResponse>
348
- rescue UltracartClient::ApiError => e
349
- puts "Error when calling GiftCertificateApi->get_gift_certificate_by_oid_with_http_info: #{e}"
350
- end
351
- ```
352
-
353
- ### Parameters
354
-
355
- | Name | Type | Description | Notes |
356
- | ---- | ---- | ----------- | ----- |
357
- | **gift_certificate_oid** | **Integer** | | |
358
-
359
- ### Return type
360
-
361
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
362
-
363
- ### Authorization
364
-
365
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
366
-
367
- ### HTTP request headers
368
-
369
- - **Content-Type**: Not defined
370
- - **Accept**: application/json
371
-
372
-
373
- ## get_gift_certificates_by_email
374
-
375
- > <GiftCertificatesResponse> get_gift_certificates_by_email(email)
376
-
377
- Retrieve gift certificate by email
378
-
379
- Retrieves all gift certificates from the account based on customer email.
380
-
381
- ### Examples
382
-
383
- ```ruby
384
- require 'time'
385
- require 'ultracart_api'
386
- require 'json'
387
- require 'yaml'
388
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
389
-
390
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
391
- # As such, this might not be the best way to use this object.
392
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
393
-
394
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
395
- email = 'email_example' # String |
396
-
397
- begin
398
- # Retrieve gift certificate by email
399
- result = api_instance.get_gift_certificates_by_email(email)
400
- p result
401
- rescue UltracartClient::ApiError => e
402
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_email: #{e}"
403
- end
404
- ```
405
-
406
- #### Using the get_gift_certificates_by_email_with_http_info variant
407
-
408
- This returns an Array which contains the response data, status code and headers.
409
-
410
- > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_email_with_http_info(email)
411
-
412
- ```ruby
413
- begin
414
- # Retrieve gift certificate by email
415
- data, status_code, headers = api_instance.get_gift_certificates_by_email_with_http_info(email)
416
- p status_code # => 2xx
417
- p headers # => { ... }
418
- p data # => <GiftCertificatesResponse>
419
- rescue UltracartClient::ApiError => e
420
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_email_with_http_info: #{e}"
421
- end
422
- ```
423
-
424
- ### Parameters
425
-
426
- | Name | Type | Description | Notes |
427
- | ---- | ---- | ----------- | ----- |
428
- | **email** | **String** | | |
429
-
430
- ### Return type
431
-
432
- [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
433
-
434
- ### Authorization
435
-
436
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
437
-
438
- ### HTTP request headers
439
-
440
- - **Content-Type**: Not defined
441
- - **Accept**: application/json
442
-
443
-
444
- ## get_gift_certificates_by_query
445
-
446
- > <GiftCertificatesResponse> get_gift_certificates_by_query(gift_certificate_query, opts)
447
-
448
- Retrieve gift certificates by query
449
-
450
- 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.
451
-
452
- ### Examples
453
-
454
- ```ruby
455
- require 'time'
456
- require 'ultracart_api'
457
- require 'json'
458
- require 'yaml'
459
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
460
-
461
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
462
- # As such, this might not be the best way to use this object.
463
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
464
-
465
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
466
- gift_certificate_query = UltracartClient::GiftCertificateQuery.new # GiftCertificateQuery | Gift certificates query
467
- opts = {
468
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Max 200)
469
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
470
- _since: '_since_example', # String | Fetch customers that have been created/modified since this date/time.
471
- _sort: '_sort_example', # String | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
472
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
473
- }
474
-
475
- begin
476
- # Retrieve gift certificates by query
477
- result = api_instance.get_gift_certificates_by_query(gift_certificate_query, opts)
478
- p result
479
- rescue UltracartClient::ApiError => e
480
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_query: #{e}"
481
- end
482
- ```
483
-
484
- #### Using the get_gift_certificates_by_query_with_http_info variant
485
-
486
- This returns an Array which contains the response data, status code and headers.
487
-
488
- > <Array(<GiftCertificatesResponse>, Integer, Hash)> get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
489
-
490
- ```ruby
491
- begin
492
- # Retrieve gift certificates by query
493
- data, status_code, headers = api_instance.get_gift_certificates_by_query_with_http_info(gift_certificate_query, opts)
494
- p status_code # => 2xx
495
- p headers # => { ... }
496
- p data # => <GiftCertificatesResponse>
497
- rescue UltracartClient::ApiError => e
498
- puts "Error when calling GiftCertificateApi->get_gift_certificates_by_query_with_http_info: #{e}"
499
- end
500
- ```
501
-
502
- ### Parameters
503
-
504
- | Name | Type | Description | Notes |
505
- | ---- | ---- | ----------- | ----- |
506
- | **gift_certificate_query** | [**GiftCertificateQuery**](GiftCertificateQuery.md) | Gift certificates query | |
507
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
508
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
509
- | **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
510
- | **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
511
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
512
-
513
- ### Return type
514
-
515
- [**GiftCertificatesResponse**](GiftCertificatesResponse.md)
516
-
517
- ### Authorization
518
-
519
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
520
-
521
- ### HTTP request headers
522
-
523
- - **Content-Type**: application/json
524
- - **Accept**: application/json
525
-
526
-
527
- ## update_gift_certificate
528
-
529
- > <GiftCertificateResponse> update_gift_certificate(gift_certificate_oid, gift_certificate)
530
-
531
- Update a gift certificate
532
-
533
- Update a gift certificate for this merchant account.
534
-
535
- ### Examples
536
-
537
- ```ruby
538
- require 'time'
539
- require 'ultracart_api'
540
- require 'json'
541
- require 'yaml'
542
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
543
-
544
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
545
- # As such, this might not be the best way to use this object.
546
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
547
-
548
- api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
549
- gift_certificate_oid = 56 # Integer |
550
- gift_certificate = UltracartClient::GiftCertificate.new # GiftCertificate | Gift certificate
551
-
552
- begin
553
- # Update a gift certificate
554
- result = api_instance.update_gift_certificate(gift_certificate_oid, gift_certificate)
555
- p result
556
- rescue UltracartClient::ApiError => e
557
- puts "Error when calling GiftCertificateApi->update_gift_certificate: #{e}"
558
- end
559
- ```
560
-
561
- #### Using the update_gift_certificate_with_http_info variant
562
-
563
- This returns an Array which contains the response data, status code and headers.
564
-
565
- > <Array(<GiftCertificateResponse>, Integer, Hash)> update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
566
-
567
- ```ruby
568
- begin
569
- # Update a gift certificate
570
- data, status_code, headers = api_instance.update_gift_certificate_with_http_info(gift_certificate_oid, gift_certificate)
571
- p status_code # => 2xx
572
- p headers # => { ... }
573
- p data # => <GiftCertificateResponse>
574
- rescue UltracartClient::ApiError => e
575
- puts "Error when calling GiftCertificateApi->update_gift_certificate_with_http_info: #{e}"
576
- end
577
- ```
578
-
579
- ### Parameters
580
-
581
- | Name | Type | Description | Notes |
582
- | ---- | ---- | ----------- | ----- |
583
- | **gift_certificate_oid** | **Integer** | | |
584
- | **gift_certificate** | [**GiftCertificate**](GiftCertificate.md) | Gift certificate | |
585
-
586
- ### Return type
587
-
588
- [**GiftCertificateResponse**](GiftCertificateResponse.md)
589
-
590
- ### Authorization
591
-
592
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
593
-
594
- ### HTTP request headers
595
-
596
- - **Content-Type**: application/json
597
- - **Accept**: application/json
598
-
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
+