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.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/docs/AffiliateApi.md +123 -167
- data/docs/AutoOrderApi.md +1250 -903
- data/docs/ChannelPartnerApi.md +1678 -1121
- data/docs/ChargebackApi.md +297 -405
- data/docs/CheckoutApi.md +1622 -1424
- data/docs/Conversation.md +4 -0
- data/docs/ConversationApi.md +4820 -6315
- data/docs/CouponApi.md +1522 -1443
- data/docs/CustomerApi.md +2570 -1845
- data/docs/DatawarehouseApi.md +555 -723
- data/docs/FulfillmentApi.md +567 -441
- data/docs/GiftCertificateApi.md +617 -598
- data/docs/IntegrationLogApi.md +290 -385
- data/docs/ItemApi.md +2174 -1746
- data/docs/ItemRestriction.md +2 -0
- data/docs/OauthApi.md +203 -163
- data/docs/OrderApi.md +2774 -2177
- data/docs/SsoApi.md +223 -288
- data/docs/StorefrontApi.md +9692 -12967
- data/docs/TaxApi.md +1541 -2017
- data/docs/UserApi.md +606 -790
- data/docs/WebhookApi.md +787 -628
- data/docs/WorkflowApi.md +666 -879
- data/lib/ultracart_api/models/conversation.rb +21 -1
- data/lib/ultracart_api/models/item_restriction.rb +11 -1
- data/lib/ultracart_api/version.rb +1 -1
- metadata +2 -2
data/docs/GiftCertificateApi.md
CHANGED
@@ -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
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
require '
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
gift_certificate_oid =
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
```
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
}
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
###
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
```
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
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
|
+
|