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/CustomerApi.md
CHANGED
@@ -1,1845 +1,2570 @@
|
|
1
|
-
# UltracartClient::CustomerApi
|
2
|
-
|
3
|
-
All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
4
|
-
|
5
|
-
| Method | HTTP request | Description |
|
6
|
-
| ------ | ------------ | ----------- |
|
7
|
-
| [**add_customer_store_credit**](CustomerApi.md#add_customer_store_credit) | **POST** /customer/customers/{customer_profile_oid}/store_credit | Adds store credit to a customer |
|
8
|
-
| [**adjust_internal_certificate**](CustomerApi.md#adjust_internal_certificate) | **POST** /customer/customers/{customer_profile_oid}/adjust_cashback_balance | Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. |
|
9
|
-
| [**delete_customer**](CustomerApi.md#delete_customer) | **DELETE** /customer/customers/{customer_profile_oid} | Delete a customer |
|
10
|
-
| [**delete_wish_list_item**](CustomerApi.md#delete_wish_list_item) | **DELETE** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Delete a customer wishlist item |
|
11
|
-
| [**get_customer**](CustomerApi.md#get_customer) | **GET** /customer/customers/{customer_profile_oid} | Retrieve a customer |
|
12
|
-
| [**get_customer_by_email**](CustomerApi.md#get_customer_by_email) | **GET** /customer/customers/by_email/{email} | Retrieve a customer by Email |
|
13
|
-
| [**get_customer_editor_values**](CustomerApi.md#get_customer_editor_values) | **GET** /customer/editor_values | Retrieve values needed for a customer profile editor |
|
14
|
-
| [**get_customer_email_lists**](CustomerApi.md#get_customer_email_lists) | **GET** /customer/email_lists | Retrieve all email lists across all storefronts |
|
15
|
-
| [**get_customer_store_credit**](CustomerApi.md#get_customer_store_credit) | **GET** /customer/customers/{customer_profile_oid}/store_credit | Retrieve the customer store credit accumulated through loyalty programs |
|
16
|
-
| [**get_customer_wish_list**](CustomerApi.md#get_customer_wish_list) | **GET** /customer/customers/{customer_profile_oid}/wishlist | Retrieve wishlist items for customer |
|
17
|
-
| [**get_customer_wish_list_item**](CustomerApi.md#get_customer_wish_list_item) | **GET** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Retrieve wishlist item for customer |
|
18
|
-
| [**get_customers**](CustomerApi.md#get_customers) | **GET** /customer/customers | Retrieve customers |
|
19
|
-
| [**get_customers_by_query**](CustomerApi.md#get_customers_by_query) | **POST** /customer/customers/query | Retrieve customers by query |
|
20
|
-
| [**get_customers_for_data_tables**](CustomerApi.md#get_customers_for_data_tables) | **POST** /customer/customers/dataTables | Retrieve customers for DataTables plugin |
|
21
|
-
| [**get_email_verification_token**](CustomerApi.md#get_email_verification_token) | **POST** /customer/customers/email_verify/get_token | Create a token that can be used to verify a customer email address |
|
22
|
-
| [**get_magic_link**](CustomerApi.md#get_magic_link) | **PUT** /customer/customers/{customer_profile_oid}/magic_link/{storefront_host_name} | getMagicLink |
|
23
|
-
| [**insert_customer**](CustomerApi.md#insert_customer) | **POST** /customer/customers | Insert a customer |
|
24
|
-
| [**insert_wish_list_item**](CustomerApi.md#insert_wish_list_item) | **POST** /customer/customers/{customer_profile_oid}/wishlist | Insert a customer wishlist item |
|
25
|
-
| [**merge_customer**](CustomerApi.md#merge_customer) | **PUT** /customer/customers/{customer_profile_oid}/merge | Merge customer into this customer |
|
26
|
-
| [**search_customer_profile_values**](CustomerApi.md#search_customer_profile_values) | **POST** /customer/search | Searches for all matching values (using POST) |
|
27
|
-
| [**update_customer**](CustomerApi.md#update_customer) | **PUT** /customer/customers/{customer_profile_oid} | Update a customer |
|
28
|
-
| [**update_customer_email_lists**](CustomerApi.md#update_customer_email_lists) | **POST** /customer/customers/{customer_profile_oid}/email_lists | Update email list subscriptions for a customer |
|
29
|
-
| [**update_wish_list_item**](CustomerApi.md#update_wish_list_item) | **PUT** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Update a customer wishlist item |
|
30
|
-
| [**validate_email_verification_token**](CustomerApi.md#validate_email_verification_token) | **POST** /customer/customers/email_verify/validate_token | Validate a token that can be used to verify a customer email address |
|
31
|
-
|
32
|
-
|
33
|
-
## add_customer_store_credit
|
34
|
-
|
35
|
-
> <BaseResponse> add_customer_store_credit(customer_profile_oid, store_credit_request)
|
36
|
-
|
37
|
-
Adds store credit to a customer
|
38
|
-
|
39
|
-
Adds store credit to a customer
|
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
|
-
p
|
222
|
-
p
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
|
232
|
-
|
|
233
|
-
| **
|
234
|
-
|
235
|
-
### Return type
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
### Authorization
|
240
|
-
|
241
|
-
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
242
|
-
|
243
|
-
### HTTP request headers
|
244
|
-
|
245
|
-
- **Content-Type**:
|
246
|
-
- **Accept**: application/json
|
247
|
-
|
248
|
-
|
249
|
-
##
|
250
|
-
|
251
|
-
>
|
252
|
-
|
253
|
-
Delete a customer
|
254
|
-
|
255
|
-
Delete a customer
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
require_relative '
|
265
|
-
|
266
|
-
|
267
|
-
#
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
end
|
281
|
-
```
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
p
|
295
|
-
p
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
|
305
|
-
|
|
306
|
-
| **
|
307
|
-
|
308
|
-
### Return type
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
### Authorization
|
313
|
-
|
314
|
-
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
315
|
-
|
316
|
-
### HTTP request headers
|
317
|
-
|
318
|
-
- **Content-Type**: Not defined
|
319
|
-
- **Accept**: application/json
|
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
|
-
p
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
This
|
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
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
#
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
Retrieve
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
```
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
-
|
1038
|
-
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
#
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
```ruby
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
#
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
| **
|
1317
|
-
| **
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
[
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
#
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
###
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
customer
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
> <
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
> <
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
```
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1
|
+
# UltracartClient::CustomerApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**add_customer_store_credit**](CustomerApi.md#add_customer_store_credit) | **POST** /customer/customers/{customer_profile_oid}/store_credit | Adds store credit to a customer |
|
8
|
+
| [**adjust_internal_certificate**](CustomerApi.md#adjust_internal_certificate) | **POST** /customer/customers/{customer_profile_oid}/adjust_cashback_balance | Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. |
|
9
|
+
| [**delete_customer**](CustomerApi.md#delete_customer) | **DELETE** /customer/customers/{customer_profile_oid} | Delete a customer |
|
10
|
+
| [**delete_wish_list_item**](CustomerApi.md#delete_wish_list_item) | **DELETE** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Delete a customer wishlist item |
|
11
|
+
| [**get_customer**](CustomerApi.md#get_customer) | **GET** /customer/customers/{customer_profile_oid} | Retrieve a customer |
|
12
|
+
| [**get_customer_by_email**](CustomerApi.md#get_customer_by_email) | **GET** /customer/customers/by_email/{email} | Retrieve a customer by Email |
|
13
|
+
| [**get_customer_editor_values**](CustomerApi.md#get_customer_editor_values) | **GET** /customer/editor_values | Retrieve values needed for a customer profile editor |
|
14
|
+
| [**get_customer_email_lists**](CustomerApi.md#get_customer_email_lists) | **GET** /customer/email_lists | Retrieve all email lists across all storefronts |
|
15
|
+
| [**get_customer_store_credit**](CustomerApi.md#get_customer_store_credit) | **GET** /customer/customers/{customer_profile_oid}/store_credit | Retrieve the customer store credit accumulated through loyalty programs |
|
16
|
+
| [**get_customer_wish_list**](CustomerApi.md#get_customer_wish_list) | **GET** /customer/customers/{customer_profile_oid}/wishlist | Retrieve wishlist items for customer |
|
17
|
+
| [**get_customer_wish_list_item**](CustomerApi.md#get_customer_wish_list_item) | **GET** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Retrieve wishlist item for customer |
|
18
|
+
| [**get_customers**](CustomerApi.md#get_customers) | **GET** /customer/customers | Retrieve customers |
|
19
|
+
| [**get_customers_by_query**](CustomerApi.md#get_customers_by_query) | **POST** /customer/customers/query | Retrieve customers by query |
|
20
|
+
| [**get_customers_for_data_tables**](CustomerApi.md#get_customers_for_data_tables) | **POST** /customer/customers/dataTables | Retrieve customers for DataTables plugin |
|
21
|
+
| [**get_email_verification_token**](CustomerApi.md#get_email_verification_token) | **POST** /customer/customers/email_verify/get_token | Create a token that can be used to verify a customer email address |
|
22
|
+
| [**get_magic_link**](CustomerApi.md#get_magic_link) | **PUT** /customer/customers/{customer_profile_oid}/magic_link/{storefront_host_name} | getMagicLink |
|
23
|
+
| [**insert_customer**](CustomerApi.md#insert_customer) | **POST** /customer/customers | Insert a customer |
|
24
|
+
| [**insert_wish_list_item**](CustomerApi.md#insert_wish_list_item) | **POST** /customer/customers/{customer_profile_oid}/wishlist | Insert a customer wishlist item |
|
25
|
+
| [**merge_customer**](CustomerApi.md#merge_customer) | **PUT** /customer/customers/{customer_profile_oid}/merge | Merge customer into this customer |
|
26
|
+
| [**search_customer_profile_values**](CustomerApi.md#search_customer_profile_values) | **POST** /customer/search | Searches for all matching values (using POST) |
|
27
|
+
| [**update_customer**](CustomerApi.md#update_customer) | **PUT** /customer/customers/{customer_profile_oid} | Update a customer |
|
28
|
+
| [**update_customer_email_lists**](CustomerApi.md#update_customer_email_lists) | **POST** /customer/customers/{customer_profile_oid}/email_lists | Update email list subscriptions for a customer |
|
29
|
+
| [**update_wish_list_item**](CustomerApi.md#update_wish_list_item) | **PUT** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Update a customer wishlist item |
|
30
|
+
| [**validate_email_verification_token**](CustomerApi.md#validate_email_verification_token) | **POST** /customer/customers/email_verify/validate_token | Validate a token that can be used to verify a customer email address |
|
31
|
+
|
32
|
+
|
33
|
+
## add_customer_store_credit
|
34
|
+
|
35
|
+
> <BaseResponse> add_customer_store_credit(customer_profile_oid, store_credit_request)
|
36
|
+
|
37
|
+
Adds store credit to a customer
|
38
|
+
|
39
|
+
Adds store credit to a customer
|
40
|
+
|
41
|
+
|
42
|
+
### Examples
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
#!/usr/bin/env ruby
|
46
|
+
|
47
|
+
# Adds store credit to a customer's account.
|
48
|
+
#
|
49
|
+
# This method requires a customer profile oid. This is a unique number used by UltraCart to identify a customer.
|
50
|
+
# If you do not know a customer's oid, call getCustomerByEmail() to retrieve the customer and their oid.
|
51
|
+
#
|
52
|
+
# Possible Errors:
|
53
|
+
# Missing store credit -> "store_credit_request.amount is missing and is required."
|
54
|
+
# Zero or negative store credit -> "store_credit_request.amount must be a positive amount."
|
55
|
+
|
56
|
+
require 'ultracart_api'
|
57
|
+
require_relative '../constants'
|
58
|
+
|
59
|
+
# Initialize the customer API
|
60
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
61
|
+
|
62
|
+
# Set the email of the customer
|
63
|
+
email = "test@ultracart.com"
|
64
|
+
|
65
|
+
# Retrieve the customer by email
|
66
|
+
customer = customer_api.get_customer_by_email(email).customer
|
67
|
+
customer_oid = customer.customer_profile_oid
|
68
|
+
|
69
|
+
# Create store credit add request
|
70
|
+
store_credit_request = UltracartClient::CustomerStoreCreditAddRequest.new(
|
71
|
+
amount: 20.00,
|
72
|
+
description: "Customer is super cool and I wanted to give them store credit.",
|
73
|
+
expiration_days: 365, # or leave nil for no expiration
|
74
|
+
vesting_days: 45 # customer has to wait 45 days to use it
|
75
|
+
)
|
76
|
+
|
77
|
+
# Add store credit to the customer's account
|
78
|
+
begin
|
79
|
+
api_response = customer_api.add_customer_store_credit(customer_oid, store_credit_request)
|
80
|
+
|
81
|
+
# Check for any errors in the response
|
82
|
+
if api_response.error
|
83
|
+
puts "Developer Message: #{api_response.error.developer_message}"
|
84
|
+
puts "User Message: #{api_response.error.user_message}"
|
85
|
+
exit(1)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Output the success response
|
89
|
+
p api_response.success
|
90
|
+
rescue StandardError => e
|
91
|
+
puts "An error occurred: #{e.message}"
|
92
|
+
exit(1)
|
93
|
+
end
|
94
|
+
```
|
95
|
+
|
96
|
+
|
97
|
+
#### Using the add_customer_store_credit_with_http_info variant
|
98
|
+
|
99
|
+
This returns an Array which contains the response data, status code and headers.
|
100
|
+
|
101
|
+
> <Array(<BaseResponse>, Integer, Hash)> add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request)
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
begin
|
105
|
+
# Adds store credit to a customer
|
106
|
+
data, status_code, headers = api_instance.add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request)
|
107
|
+
p status_code # => 2xx
|
108
|
+
p headers # => { ... }
|
109
|
+
p data # => <BaseResponse>
|
110
|
+
rescue UltracartClient::ApiError => e
|
111
|
+
puts "Error when calling CustomerApi->add_customer_store_credit_with_http_info: #{e}"
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
### Parameters
|
116
|
+
|
117
|
+
| Name | Type | Description | Notes |
|
118
|
+
| ---- | ---- | ----------- | ----- |
|
119
|
+
| **customer_profile_oid** | **Integer** | The customer oid to credit. | |
|
120
|
+
| **store_credit_request** | [**CustomerStoreCreditAddRequest**](CustomerStoreCreditAddRequest.md) | Store credit to add | |
|
121
|
+
|
122
|
+
### Return type
|
123
|
+
|
124
|
+
[**BaseResponse**](BaseResponse.md)
|
125
|
+
|
126
|
+
### Authorization
|
127
|
+
|
128
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
129
|
+
|
130
|
+
### HTTP request headers
|
131
|
+
|
132
|
+
- **Content-Type**: application/json; charset=UTF-8
|
133
|
+
- **Accept**: application/json
|
134
|
+
|
135
|
+
|
136
|
+
## adjust_internal_certificate
|
137
|
+
|
138
|
+
> <AdjustInternalCertificateResponse> adjust_internal_certificate(customer_profile_oid, adjust_internal_certificate_request)
|
139
|
+
|
140
|
+
Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
|
141
|
+
|
142
|
+
Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
|
143
|
+
|
144
|
+
|
145
|
+
### Examples
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
#!/usr/bin/env ruby
|
149
|
+
|
150
|
+
# Adjusts the cashback balance of a customer. This method's name is adjustInternalCertificate, which
|
151
|
+
# is a poor choice of naming, but results from an underlying implementation of using an internal gift certificate
|
152
|
+
# to track cashback balance. Sorry for the confusion.
|
153
|
+
#
|
154
|
+
# This method requires a customer profile oid. This is a unique number used by UltraCart to identify a customer.
|
155
|
+
# If you do not know a customer's oid, call getCustomerByEmail() to retrieve the customer and their oid.
|
156
|
+
#
|
157
|
+
# Possible Errors:
|
158
|
+
# Missing adjustment amount -> "adjust_internal_certificate_request.adjustment_amount is required and was missing"
|
159
|
+
|
160
|
+
require 'ultracart_api'
|
161
|
+
require_relative '../constants'
|
162
|
+
|
163
|
+
# Initialize the customer API
|
164
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
165
|
+
|
166
|
+
# Set the email of the customer
|
167
|
+
email = "test@ultracart.com"
|
168
|
+
|
169
|
+
# Retrieve the customer by email
|
170
|
+
customer = customer_api.get_customer_by_email(email).customer
|
171
|
+
customer_oid = customer.customer_profile_oid
|
172
|
+
|
173
|
+
# Create adjust internal certificate request
|
174
|
+
adjust_request = UltracartClient::AdjustInternalCertificateRequest.new(
|
175
|
+
description: "Adjusting customer cashback balance because they called and complained about product.",
|
176
|
+
expiration_days: 365, # expires in 365 days
|
177
|
+
vesting_days: 45, # customer has to wait 45 days to use it
|
178
|
+
adjustment_amount: 59, # add 59 to their balance
|
179
|
+
order_id: 'DEMO-12345', # or leave nil. this ties the adjustment to a particular order
|
180
|
+
entry_dts: nil # use current time
|
181
|
+
)
|
182
|
+
|
183
|
+
# Adjust internal certificate
|
184
|
+
begin
|
185
|
+
api_response = customer_api.adjust_internal_certificate(customer_oid, adjust_request)
|
186
|
+
|
187
|
+
# Check for any errors in the response
|
188
|
+
if api_response.error
|
189
|
+
puts "Developer Message: #{api_response.error.developer_message}"
|
190
|
+
puts "User Message: #{api_response.error.user_message}"
|
191
|
+
exit(1)
|
192
|
+
end
|
193
|
+
|
194
|
+
# Output response details
|
195
|
+
puts "Success: #{api_response.success}"
|
196
|
+
puts "Adjustment Amount: #{api_response.adjustment_amount}"
|
197
|
+
puts "Balance Amount: #{api_response.balance_amount}"
|
198
|
+
|
199
|
+
# Inspect the full response
|
200
|
+
p api_response
|
201
|
+
rescue StandardError => e
|
202
|
+
puts "An error occurred: #{e.message}"
|
203
|
+
exit(1)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Ensure a carriage return at the end of the file
|
207
|
+
```
|
208
|
+
|
209
|
+
|
210
|
+
#### Using the adjust_internal_certificate_with_http_info variant
|
211
|
+
|
212
|
+
This returns an Array which contains the response data, status code and headers.
|
213
|
+
|
214
|
+
> <Array(<AdjustInternalCertificateResponse>, Integer, Hash)> adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request)
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
begin
|
218
|
+
# Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
|
219
|
+
data, status_code, headers = api_instance.adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request)
|
220
|
+
p status_code # => 2xx
|
221
|
+
p headers # => { ... }
|
222
|
+
p data # => <AdjustInternalCertificateResponse>
|
223
|
+
rescue UltracartClient::ApiError => e
|
224
|
+
puts "Error when calling CustomerApi->adjust_internal_certificate_with_http_info: #{e}"
|
225
|
+
end
|
226
|
+
```
|
227
|
+
|
228
|
+
### Parameters
|
229
|
+
|
230
|
+
| Name | Type | Description | Notes |
|
231
|
+
| ---- | ---- | ----------- | ----- |
|
232
|
+
| **customer_profile_oid** | **Integer** | The customer profile oid | |
|
233
|
+
| **adjust_internal_certificate_request** | [**AdjustInternalCertificateRequest**](AdjustInternalCertificateRequest.md) | adjustInternalCertificateRequest | |
|
234
|
+
|
235
|
+
### Return type
|
236
|
+
|
237
|
+
[**AdjustInternalCertificateResponse**](AdjustInternalCertificateResponse.md)
|
238
|
+
|
239
|
+
### Authorization
|
240
|
+
|
241
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
242
|
+
|
243
|
+
### HTTP request headers
|
244
|
+
|
245
|
+
- **Content-Type**: application/json; charset=UTF-8
|
246
|
+
- **Accept**: application/json
|
247
|
+
|
248
|
+
|
249
|
+
## delete_customer
|
250
|
+
|
251
|
+
> delete_customer(customer_profile_oid)
|
252
|
+
|
253
|
+
Delete a customer
|
254
|
+
|
255
|
+
Delete a customer on the UltraCart account.
|
256
|
+
|
257
|
+
|
258
|
+
### Examples
|
259
|
+
|
260
|
+
```ruby
|
261
|
+
#!/usr/bin/env ruby
|
262
|
+
|
263
|
+
# Require the customer functions we created earlier
|
264
|
+
require_relative 'customer_functions'
|
265
|
+
|
266
|
+
begin
|
267
|
+
# Insert a sample customer and get their OID
|
268
|
+
customer_oid = insert_sample_customer
|
269
|
+
|
270
|
+
# Delete the sample customer
|
271
|
+
delete_sample_customer(customer_oid)
|
272
|
+
|
273
|
+
rescue StandardError => e
|
274
|
+
# Handle any exceptions that occur during the process
|
275
|
+
puts 'An exception occurred. Please review the following error:'
|
276
|
+
p e
|
277
|
+
exit(1)
|
278
|
+
end
|
279
|
+
|
280
|
+
# Ensure a carriage return at the end of the file
|
281
|
+
```
|
282
|
+
|
283
|
+
|
284
|
+
#### Using the delete_customer_with_http_info variant
|
285
|
+
|
286
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
287
|
+
|
288
|
+
> <Array(nil, Integer, Hash)> delete_customer_with_http_info(customer_profile_oid)
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
begin
|
292
|
+
# Delete a customer
|
293
|
+
data, status_code, headers = api_instance.delete_customer_with_http_info(customer_profile_oid)
|
294
|
+
p status_code # => 2xx
|
295
|
+
p headers # => { ... }
|
296
|
+
p data # => nil
|
297
|
+
rescue UltracartClient::ApiError => e
|
298
|
+
puts "Error when calling CustomerApi->delete_customer_with_http_info: #{e}"
|
299
|
+
end
|
300
|
+
```
|
301
|
+
|
302
|
+
### Parameters
|
303
|
+
|
304
|
+
| Name | Type | Description | Notes |
|
305
|
+
| ---- | ---- | ----------- | ----- |
|
306
|
+
| **customer_profile_oid** | **Integer** | The customer_profile_oid to delete. | |
|
307
|
+
|
308
|
+
### Return type
|
309
|
+
|
310
|
+
nil (empty response body)
|
311
|
+
|
312
|
+
### Authorization
|
313
|
+
|
314
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
315
|
+
|
316
|
+
### HTTP request headers
|
317
|
+
|
318
|
+
- **Content-Type**: Not defined
|
319
|
+
- **Accept**: application/json
|
320
|
+
|
321
|
+
|
322
|
+
## delete_wish_list_item
|
323
|
+
|
324
|
+
> <CustomerWishListItem> delete_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
|
325
|
+
|
326
|
+
Delete a customer wishlist item
|
327
|
+
|
328
|
+
Delete a customer wishlist item
|
329
|
+
|
330
|
+
|
331
|
+
### Examples
|
332
|
+
|
333
|
+
```ruby
|
334
|
+
#!/usr/bin/env ruby
|
335
|
+
|
336
|
+
# Require necessary files
|
337
|
+
require 'ultracart_api'
|
338
|
+
require_relative '../constants'
|
339
|
+
require_relative 'customer_functions'
|
340
|
+
require_relative '../item/item_functions'
|
341
|
+
|
342
|
+
# The wishlist methods allow management of a customer's wishlist.
|
343
|
+
# This includes:
|
344
|
+
# - deleteWishListItem
|
345
|
+
# - getCustomerWishList
|
346
|
+
# - getCustomerWishListItem
|
347
|
+
# - insertWishListItem
|
348
|
+
# - updateWishListItem
|
349
|
+
# These methods provide a standard CRUD interface.
|
350
|
+
#
|
351
|
+
# You'll need merchant_item_oids to insert wishlist items. If you don't know the oids,
|
352
|
+
# call ItemApi.getItemByMerchantItemId() to retrieve the item, then get item.merchant_item_oid
|
353
|
+
#
|
354
|
+
# Note: Priority of wishlist item, 3 being low priority and 5 is high priority.
|
355
|
+
|
356
|
+
begin
|
357
|
+
# Initialize the customer API
|
358
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
359
|
+
|
360
|
+
# Create a few items first
|
361
|
+
first_item_oid = insert_sample_item_and_get_oid
|
362
|
+
second_item_oid = insert_sample_item_and_get_oid
|
363
|
+
|
364
|
+
# Create a customer
|
365
|
+
customer_oid = insert_sample_customer
|
366
|
+
|
367
|
+
# TODO: If you don't know the customer oid, use getCustomerByEmail() to retrieve the customer.
|
368
|
+
|
369
|
+
# Add some wish list items
|
370
|
+
first_wish_item = UltracartClient::CustomerWishListItem.new(
|
371
|
+
customer_profile_oid: customer_oid,
|
372
|
+
merchant_item_oid: first_item_oid,
|
373
|
+
comments: "I really want this for my birthday",
|
374
|
+
priority: 3 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
375
|
+
)
|
376
|
+
first_created_wish_item = customer_api.insert_wish_list_item(customer_oid, first_wish_item)
|
377
|
+
|
378
|
+
second_wish_item = UltracartClient::CustomerWishListItem.new(
|
379
|
+
customer_profile_oid: customer_oid,
|
380
|
+
merchant_item_oid: second_item_oid,
|
381
|
+
comments: "Christmas Idea!",
|
382
|
+
priority: 5 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
383
|
+
)
|
384
|
+
second_created_wish_item = customer_api.insert_wish_list_item(customer_oid, second_wish_item)
|
385
|
+
|
386
|
+
# Retrieve one wishlist item again
|
387
|
+
first_created_wish_item_copy = customer_api.get_customer_wish_list_item(
|
388
|
+
customer_oid,
|
389
|
+
first_created_wish_item.customer_wishlist_item_oid
|
390
|
+
).wishlist_item
|
391
|
+
|
392
|
+
# Retrieve all wishlist items
|
393
|
+
all_wish_list_items = customer_api.get_customer_wish_list(customer_oid).wishlist_items
|
394
|
+
|
395
|
+
# Update an item
|
396
|
+
second_created_wish_item.priority = 4
|
397
|
+
updated_second_wish_item = customer_api.update_wish_list_item(
|
398
|
+
customer_oid,
|
399
|
+
second_created_wish_item.customer_wishlist_item_oid,
|
400
|
+
second_created_wish_item
|
401
|
+
)
|
402
|
+
|
403
|
+
# Delete a wish list item
|
404
|
+
customer_api.delete_wish_list_item(
|
405
|
+
customer_oid,
|
406
|
+
first_created_wish_item.customer_wishlist_item_oid
|
407
|
+
)
|
408
|
+
|
409
|
+
# Clean up
|
410
|
+
delete_sample_customer(customer_oid)
|
411
|
+
delete_sample_item_by_oid(first_item_oid)
|
412
|
+
delete_sample_item_by_oid(second_item_oid)
|
413
|
+
|
414
|
+
rescue StandardError => e
|
415
|
+
# Handle any exceptions that occur during the process
|
416
|
+
puts 'An exception occurred. Please review the following error:'
|
417
|
+
p e
|
418
|
+
exit(1)
|
419
|
+
end
|
420
|
+
|
421
|
+
# Ensure a carriage return at the end of the file
|
422
|
+
```
|
423
|
+
|
424
|
+
|
425
|
+
#### Using the delete_wish_list_item_with_http_info variant
|
426
|
+
|
427
|
+
This returns an Array which contains the response data, status code and headers.
|
428
|
+
|
429
|
+
> <Array(<CustomerWishListItem>, Integer, Hash)> delete_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
|
430
|
+
|
431
|
+
```ruby
|
432
|
+
begin
|
433
|
+
# Delete a customer wishlist item
|
434
|
+
data, status_code, headers = api_instance.delete_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
|
435
|
+
p status_code # => 2xx
|
436
|
+
p headers # => { ... }
|
437
|
+
p data # => <CustomerWishListItem>
|
438
|
+
rescue UltracartClient::ApiError => e
|
439
|
+
puts "Error when calling CustomerApi->delete_wish_list_item_with_http_info: #{e}"
|
440
|
+
end
|
441
|
+
```
|
442
|
+
|
443
|
+
### Parameters
|
444
|
+
|
445
|
+
| Name | Type | Description | Notes |
|
446
|
+
| ---- | ---- | ----------- | ----- |
|
447
|
+
| **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
|
448
|
+
| **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item to delete. | |
|
449
|
+
|
450
|
+
### Return type
|
451
|
+
|
452
|
+
[**CustomerWishListItem**](CustomerWishListItem.md)
|
453
|
+
|
454
|
+
### Authorization
|
455
|
+
|
456
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
457
|
+
|
458
|
+
### HTTP request headers
|
459
|
+
|
460
|
+
- **Content-Type**: Not defined
|
461
|
+
- **Accept**: application/json
|
462
|
+
|
463
|
+
|
464
|
+
## get_customer
|
465
|
+
|
466
|
+
> <CustomerResponse> get_customer(customer_profile_oid, opts)
|
467
|
+
|
468
|
+
Retrieve a customer
|
469
|
+
|
470
|
+
Retrieves a single customer using the specified customer profile oid.
|
471
|
+
|
472
|
+
|
473
|
+
### Examples
|
474
|
+
|
475
|
+
```ruby
|
476
|
+
#!/usr/bin/env ruby
|
477
|
+
|
478
|
+
require 'ultracart_api'
|
479
|
+
require_relative '../constants'
|
480
|
+
require_relative './customer_functions'
|
481
|
+
|
482
|
+
# Of the two getCustomer methods, you'll probably always use getCustomerByEmail instead of this one.
|
483
|
+
# Most customer logic revolves around the email, not the customer oid. The latter is only meaningful as a primary
|
484
|
+
# key in the UltraCart databases. But here is an example of using getCustomer().
|
485
|
+
|
486
|
+
begin
|
487
|
+
# Create a random email and insert a sample customer
|
488
|
+
email = create_random_email
|
489
|
+
customer_oid = insert_sample_customer(email)
|
490
|
+
|
491
|
+
# Initialize the customer API
|
492
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
493
|
+
|
494
|
+
# The _expand variable is set to return just the address fields.
|
495
|
+
# See customer_functions.rb for a list of expansions, or consult the source: https://www.ultracart.com/api/
|
496
|
+
api_response = customer_api.get_customer(
|
497
|
+
customer_oid,
|
498
|
+
opts: {
|
499
|
+
'_expand' => 'billing,shipping'
|
500
|
+
}
|
501
|
+
)
|
502
|
+
|
503
|
+
# Assuming this succeeded
|
504
|
+
customer = api_response.customer
|
505
|
+
|
506
|
+
# Output the customer details
|
507
|
+
p customer
|
508
|
+
|
509
|
+
# Delete the sample customer
|
510
|
+
delete_sample_customer(customer_oid)
|
511
|
+
|
512
|
+
rescue UltracartClient::ApiError => e
|
513
|
+
puts 'An ApiError occurred. Please review the following error:'
|
514
|
+
p e
|
515
|
+
exit 1
|
516
|
+
end
|
517
|
+
|
518
|
+
# Add a final carriage return
|
519
|
+
```
|
520
|
+
|
521
|
+
|
522
|
+
#### Using the get_customer_with_http_info variant
|
523
|
+
|
524
|
+
This returns an Array which contains the response data, status code and headers.
|
525
|
+
|
526
|
+
> <Array(<CustomerResponse>, Integer, Hash)> get_customer_with_http_info(customer_profile_oid, opts)
|
527
|
+
|
528
|
+
```ruby
|
529
|
+
begin
|
530
|
+
# Retrieve a customer
|
531
|
+
data, status_code, headers = api_instance.get_customer_with_http_info(customer_profile_oid, opts)
|
532
|
+
p status_code # => 2xx
|
533
|
+
p headers # => { ... }
|
534
|
+
p data # => <CustomerResponse>
|
535
|
+
rescue UltracartClient::ApiError => e
|
536
|
+
puts "Error when calling CustomerApi->get_customer_with_http_info: #{e}"
|
537
|
+
end
|
538
|
+
```
|
539
|
+
|
540
|
+
### Parameters
|
541
|
+
|
542
|
+
| Name | Type | Description | Notes |
|
543
|
+
| ---- | ---- | ----------- | ----- |
|
544
|
+
| **customer_profile_oid** | **Integer** | The customer oid to retrieve. | |
|
545
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
546
|
+
|
547
|
+
### Return type
|
548
|
+
|
549
|
+
[**CustomerResponse**](CustomerResponse.md)
|
550
|
+
|
551
|
+
### Authorization
|
552
|
+
|
553
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
554
|
+
|
555
|
+
### HTTP request headers
|
556
|
+
|
557
|
+
- **Content-Type**: Not defined
|
558
|
+
- **Accept**: application/json
|
559
|
+
|
560
|
+
|
561
|
+
## get_customer_by_email
|
562
|
+
|
563
|
+
> <CustomerResponse> get_customer_by_email(email, opts)
|
564
|
+
|
565
|
+
Retrieve a customer by Email
|
566
|
+
|
567
|
+
Retrieves a single customer using the specified customer email address.
|
568
|
+
|
569
|
+
|
570
|
+
### Examples
|
571
|
+
|
572
|
+
```ruby
|
573
|
+
#!/usr/bin/env ruby
|
574
|
+
|
575
|
+
require 'ultracart_api'
|
576
|
+
require_relative '../constants'
|
577
|
+
require_relative './customer_functions'
|
578
|
+
|
579
|
+
# Of the two getCustomer methods, you'll probably always use this one over getCustomer.
|
580
|
+
# Most customer logic revolves around the email, not the customer oid. The latter is only meaningful as a primary
|
581
|
+
# key in the UltraCart databases. But our sample functions return back the oid, so we'll ignore that and just
|
582
|
+
# use the email that we create.
|
583
|
+
|
584
|
+
begin
|
585
|
+
# Create a random email and insert a sample customer
|
586
|
+
email = create_random_email
|
587
|
+
customer_oid = insert_sample_customer(email)
|
588
|
+
|
589
|
+
# Initialize the customer API
|
590
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
591
|
+
|
592
|
+
# The _expand variable is set to return just the address fields.
|
593
|
+
# See customer_functions.rb for a list of expansions, or consult the source: https://www.ultracart.com/api/
|
594
|
+
api_response = customer_api.get_customer_by_email(
|
595
|
+
email,
|
596
|
+
opts: {
|
597
|
+
'_expand' => 'billing,shipping'
|
598
|
+
}
|
599
|
+
)
|
600
|
+
|
601
|
+
# Assuming this succeeded
|
602
|
+
customer = api_response.customer
|
603
|
+
|
604
|
+
# Output the customer details
|
605
|
+
p customer
|
606
|
+
|
607
|
+
# Delete the sample customer
|
608
|
+
delete_sample_customer(customer_oid)
|
609
|
+
|
610
|
+
rescue UltracartClient::ApiError => e
|
611
|
+
puts 'An ApiError occurred. Please review the following error:'
|
612
|
+
p e
|
613
|
+
exit 1
|
614
|
+
end
|
615
|
+
```
|
616
|
+
|
617
|
+
|
618
|
+
#### Using the get_customer_by_email_with_http_info variant
|
619
|
+
|
620
|
+
This returns an Array which contains the response data, status code and headers.
|
621
|
+
|
622
|
+
> <Array(<CustomerResponse>, Integer, Hash)> get_customer_by_email_with_http_info(email, opts)
|
623
|
+
|
624
|
+
```ruby
|
625
|
+
begin
|
626
|
+
# Retrieve a customer by Email
|
627
|
+
data, status_code, headers = api_instance.get_customer_by_email_with_http_info(email, opts)
|
628
|
+
p status_code # => 2xx
|
629
|
+
p headers # => { ... }
|
630
|
+
p data # => <CustomerResponse>
|
631
|
+
rescue UltracartClient::ApiError => e
|
632
|
+
puts "Error when calling CustomerApi->get_customer_by_email_with_http_info: #{e}"
|
633
|
+
end
|
634
|
+
```
|
635
|
+
|
636
|
+
### Parameters
|
637
|
+
|
638
|
+
| Name | Type | Description | Notes |
|
639
|
+
| ---- | ---- | ----------- | ----- |
|
640
|
+
| **email** | **String** | The email address of the customer to retrieve. | |
|
641
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
642
|
+
|
643
|
+
### Return type
|
644
|
+
|
645
|
+
[**CustomerResponse**](CustomerResponse.md)
|
646
|
+
|
647
|
+
### Authorization
|
648
|
+
|
649
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
650
|
+
|
651
|
+
### HTTP request headers
|
652
|
+
|
653
|
+
- **Content-Type**: Not defined
|
654
|
+
- **Accept**: application/json
|
655
|
+
|
656
|
+
|
657
|
+
## get_customer_editor_values
|
658
|
+
|
659
|
+
> <CustomerEditorValues> get_customer_editor_values
|
660
|
+
|
661
|
+
Retrieve values needed for a customer profile editor
|
662
|
+
|
663
|
+
Retrieve values needed for a customer profile editor.
|
664
|
+
|
665
|
+
|
666
|
+
### Examples
|
667
|
+
|
668
|
+
```ruby
|
669
|
+
# This is an internal method used by our Customer management screen. It returns back all the static data needed
|
670
|
+
# for our dropdown lists, such as lists of state and countries. You can call it if you like, but the data won't be
|
671
|
+
# of much use.
|
672
|
+
```
|
673
|
+
|
674
|
+
|
675
|
+
#### Using the get_customer_editor_values_with_http_info variant
|
676
|
+
|
677
|
+
This returns an Array which contains the response data, status code and headers.
|
678
|
+
|
679
|
+
> <Array(<CustomerEditorValues>, Integer, Hash)> get_customer_editor_values_with_http_info
|
680
|
+
|
681
|
+
```ruby
|
682
|
+
begin
|
683
|
+
# Retrieve values needed for a customer profile editor
|
684
|
+
data, status_code, headers = api_instance.get_customer_editor_values_with_http_info
|
685
|
+
p status_code # => 2xx
|
686
|
+
p headers # => { ... }
|
687
|
+
p data # => <CustomerEditorValues>
|
688
|
+
rescue UltracartClient::ApiError => e
|
689
|
+
puts "Error when calling CustomerApi->get_customer_editor_values_with_http_info: #{e}"
|
690
|
+
end
|
691
|
+
```
|
692
|
+
|
693
|
+
### Parameters
|
694
|
+
|
695
|
+
This endpoint does not need any parameter.
|
696
|
+
|
697
|
+
### Return type
|
698
|
+
|
699
|
+
[**CustomerEditorValues**](CustomerEditorValues.md)
|
700
|
+
|
701
|
+
### Authorization
|
702
|
+
|
703
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
704
|
+
|
705
|
+
### HTTP request headers
|
706
|
+
|
707
|
+
- **Content-Type**: Not defined
|
708
|
+
- **Accept**: application/json
|
709
|
+
|
710
|
+
|
711
|
+
## get_customer_email_lists
|
712
|
+
|
713
|
+
> <EmailListsResponse> get_customer_email_lists
|
714
|
+
|
715
|
+
Retrieve all email lists across all storefronts
|
716
|
+
|
717
|
+
Retrieve all email lists across all storefronts
|
718
|
+
|
719
|
+
|
720
|
+
### Examples
|
721
|
+
|
722
|
+
```ruby
|
723
|
+
# This is an internal method used by our Email workflow engines. It returns back all the email lists a customer
|
724
|
+
# is currently subscribed to. It's geared towards our UI needs, so the data returned may appear cryptic.
|
725
|
+
# We're not including a sample for it because we don't envision it being valuable to a merchant.
|
726
|
+
```
|
727
|
+
|
728
|
+
|
729
|
+
#### Using the get_customer_email_lists_with_http_info variant
|
730
|
+
|
731
|
+
This returns an Array which contains the response data, status code and headers.
|
732
|
+
|
733
|
+
> <Array(<EmailListsResponse>, Integer, Hash)> get_customer_email_lists_with_http_info
|
734
|
+
|
735
|
+
```ruby
|
736
|
+
begin
|
737
|
+
# Retrieve all email lists across all storefronts
|
738
|
+
data, status_code, headers = api_instance.get_customer_email_lists_with_http_info
|
739
|
+
p status_code # => 2xx
|
740
|
+
p headers # => { ... }
|
741
|
+
p data # => <EmailListsResponse>
|
742
|
+
rescue UltracartClient::ApiError => e
|
743
|
+
puts "Error when calling CustomerApi->get_customer_email_lists_with_http_info: #{e}"
|
744
|
+
end
|
745
|
+
```
|
746
|
+
|
747
|
+
### Parameters
|
748
|
+
|
749
|
+
This endpoint does not need any parameter.
|
750
|
+
|
751
|
+
### Return type
|
752
|
+
|
753
|
+
[**EmailListsResponse**](EmailListsResponse.md)
|
754
|
+
|
755
|
+
### Authorization
|
756
|
+
|
757
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
758
|
+
|
759
|
+
### HTTP request headers
|
760
|
+
|
761
|
+
- **Content-Type**: Not defined
|
762
|
+
- **Accept**: application/json
|
763
|
+
|
764
|
+
|
765
|
+
## get_customer_store_credit
|
766
|
+
|
767
|
+
> <CustomerStoreCreditResponse> get_customer_store_credit(customer_profile_oid)
|
768
|
+
|
769
|
+
Retrieve the customer store credit accumulated through loyalty programs
|
770
|
+
|
771
|
+
Retrieve the customer store credit accumulated through loyalty programs
|
772
|
+
|
773
|
+
|
774
|
+
### Examples
|
775
|
+
|
776
|
+
```ruby
|
777
|
+
#!/usr/bin/env ruby
|
778
|
+
|
779
|
+
require 'ultracart_api'
|
780
|
+
require_relative '../constants'
|
781
|
+
require_relative './customer_functions'
|
782
|
+
|
783
|
+
=begin
|
784
|
+
getCustomerStoreCredit returns back the store credit for a customer, which includes:
|
785
|
+
total - lifetime credit
|
786
|
+
available - currently available store credit
|
787
|
+
vesting - amount of store credit vesting
|
788
|
+
expiring - amount of store credit expiring within 30 days
|
789
|
+
pastLedgers - transaction history
|
790
|
+
futureLedgers - future transactions including expiring entries
|
791
|
+
=end
|
792
|
+
|
793
|
+
begin
|
794
|
+
# Initialize the customer API
|
795
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
796
|
+
|
797
|
+
# Create a customer
|
798
|
+
customer_oid = insert_sample_customer
|
799
|
+
|
800
|
+
# Add some store credit
|
801
|
+
add_request = UltracartClient::CustomerStoreCreditAddRequest.new(
|
802
|
+
description: 'First credit add',
|
803
|
+
vesting_days: 10,
|
804
|
+
expiration_days: 20, # that's not a lot of time!
|
805
|
+
amount: 20
|
806
|
+
)
|
807
|
+
customer_api.add_customer_store_credit(customer_oid, add_request)
|
808
|
+
|
809
|
+
# Add more store credit
|
810
|
+
add_request = UltracartClient::CustomerStoreCreditAddRequest.new(
|
811
|
+
description: 'Second credit add',
|
812
|
+
vesting_days: 0, # immediately available
|
813
|
+
expiration_days: 90,
|
814
|
+
amount: 40
|
815
|
+
)
|
816
|
+
customer_api.add_customer_store_credit(customer_oid, add_request)
|
817
|
+
|
818
|
+
# Retrieve store credit
|
819
|
+
api_response = customer_api.get_customer_store_credit(customer_oid)
|
820
|
+
store_credit = api_response.customer_store_credit
|
821
|
+
|
822
|
+
# Output store credit details
|
823
|
+
p store_credit # There's a lot of information inside this object
|
824
|
+
|
825
|
+
# Clean up this sample
|
826
|
+
delete_sample_customer(customer_oid)
|
827
|
+
|
828
|
+
rescue UltracartClient::ApiError => e
|
829
|
+
puts 'An ApiError occurred. Please review the following error:'
|
830
|
+
p e
|
831
|
+
exit 1
|
832
|
+
end
|
833
|
+
```
|
834
|
+
|
835
|
+
|
836
|
+
#### Using the get_customer_store_credit_with_http_info variant
|
837
|
+
|
838
|
+
This returns an Array which contains the response data, status code and headers.
|
839
|
+
|
840
|
+
> <Array(<CustomerStoreCreditResponse>, Integer, Hash)> get_customer_store_credit_with_http_info(customer_profile_oid)
|
841
|
+
|
842
|
+
```ruby
|
843
|
+
begin
|
844
|
+
# Retrieve the customer store credit accumulated through loyalty programs
|
845
|
+
data, status_code, headers = api_instance.get_customer_store_credit_with_http_info(customer_profile_oid)
|
846
|
+
p status_code # => 2xx
|
847
|
+
p headers # => { ... }
|
848
|
+
p data # => <CustomerStoreCreditResponse>
|
849
|
+
rescue UltracartClient::ApiError => e
|
850
|
+
puts "Error when calling CustomerApi->get_customer_store_credit_with_http_info: #{e}"
|
851
|
+
end
|
852
|
+
```
|
853
|
+
|
854
|
+
### Parameters
|
855
|
+
|
856
|
+
| Name | Type | Description | Notes |
|
857
|
+
| ---- | ---- | ----------- | ----- |
|
858
|
+
| **customer_profile_oid** | **Integer** | The customer oid to retrieve. | |
|
859
|
+
|
860
|
+
### Return type
|
861
|
+
|
862
|
+
[**CustomerStoreCreditResponse**](CustomerStoreCreditResponse.md)
|
863
|
+
|
864
|
+
### Authorization
|
865
|
+
|
866
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
867
|
+
|
868
|
+
### HTTP request headers
|
869
|
+
|
870
|
+
- **Content-Type**: Not defined
|
871
|
+
- **Accept**: application/json
|
872
|
+
|
873
|
+
|
874
|
+
## get_customer_wish_list
|
875
|
+
|
876
|
+
> <CustomerWishListItemsResponse> get_customer_wish_list(customer_profile_oid)
|
877
|
+
|
878
|
+
Retrieve wishlist items for customer
|
879
|
+
|
880
|
+
Retrieve wishlist items for customer.
|
881
|
+
|
882
|
+
|
883
|
+
### Examples
|
884
|
+
|
885
|
+
```ruby
|
886
|
+
#!/usr/bin/env ruby
|
887
|
+
|
888
|
+
# Require necessary files
|
889
|
+
require 'ultracart_api'
|
890
|
+
require_relative '../constants'
|
891
|
+
require_relative 'customer_functions'
|
892
|
+
require_relative '../item/item_functions'
|
893
|
+
|
894
|
+
# The wishlist methods allow management of a customer's wishlist.
|
895
|
+
# This includes:
|
896
|
+
# - deleteWishListItem
|
897
|
+
# - getCustomerWishList
|
898
|
+
# - getCustomerWishListItem
|
899
|
+
# - insertWishListItem
|
900
|
+
# - updateWishListItem
|
901
|
+
# These methods provide a standard CRUD interface.
|
902
|
+
#
|
903
|
+
# You'll need merchant_item_oids to insert wishlist items. If you don't know the oids,
|
904
|
+
# call ItemApi.getItemByMerchantItemId() to retrieve the item, then get item.merchant_item_oid
|
905
|
+
#
|
906
|
+
# Note: Priority of wishlist item, 3 being low priority and 5 is high priority.
|
907
|
+
|
908
|
+
begin
|
909
|
+
# Initialize the customer API
|
910
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
911
|
+
|
912
|
+
# Create a few items first
|
913
|
+
first_item_oid = insert_sample_item_and_get_oid
|
914
|
+
second_item_oid = insert_sample_item_and_get_oid
|
915
|
+
|
916
|
+
# Create a customer
|
917
|
+
customer_oid = insert_sample_customer
|
918
|
+
|
919
|
+
# TODO: If you don't know the customer oid, use getCustomerByEmail() to retrieve the customer.
|
920
|
+
|
921
|
+
# Add some wish list items
|
922
|
+
first_wish_item = UltracartClient::CustomerWishListItem.new(
|
923
|
+
customer_profile_oid: customer_oid,
|
924
|
+
merchant_item_oid: first_item_oid,
|
925
|
+
comments: "I really want this for my birthday",
|
926
|
+
priority: 3 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
927
|
+
)
|
928
|
+
first_created_wish_item = customer_api.insert_wish_list_item(customer_oid, first_wish_item)
|
929
|
+
|
930
|
+
second_wish_item = UltracartClient::CustomerWishListItem.new(
|
931
|
+
customer_profile_oid: customer_oid,
|
932
|
+
merchant_item_oid: second_item_oid,
|
933
|
+
comments: "Christmas Idea!",
|
934
|
+
priority: 5 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
935
|
+
)
|
936
|
+
second_created_wish_item = customer_api.insert_wish_list_item(customer_oid, second_wish_item)
|
937
|
+
|
938
|
+
# Retrieve one wishlist item again
|
939
|
+
first_created_wish_item_copy = customer_api.get_customer_wish_list_item(
|
940
|
+
customer_oid,
|
941
|
+
first_created_wish_item.customer_wishlist_item_oid
|
942
|
+
).wishlist_item
|
943
|
+
|
944
|
+
# Retrieve all wishlist items
|
945
|
+
all_wish_list_items = customer_api.get_customer_wish_list(customer_oid).wishlist_items
|
946
|
+
|
947
|
+
# Update an item
|
948
|
+
second_created_wish_item.priority = 4
|
949
|
+
updated_second_wish_item = customer_api.update_wish_list_item(
|
950
|
+
customer_oid,
|
951
|
+
second_created_wish_item.customer_wishlist_item_oid,
|
952
|
+
second_created_wish_item
|
953
|
+
)
|
954
|
+
|
955
|
+
# Delete a wish list item
|
956
|
+
customer_api.delete_wish_list_item(
|
957
|
+
customer_oid,
|
958
|
+
first_created_wish_item.customer_wishlist_item_oid
|
959
|
+
)
|
960
|
+
|
961
|
+
# Clean up
|
962
|
+
delete_sample_customer(customer_oid)
|
963
|
+
delete_sample_item_by_oid(first_item_oid)
|
964
|
+
delete_sample_item_by_oid(second_item_oid)
|
965
|
+
|
966
|
+
rescue StandardError => e
|
967
|
+
# Handle any exceptions that occur during the process
|
968
|
+
puts 'An exception occurred. Please review the following error:'
|
969
|
+
p e
|
970
|
+
exit(1)
|
971
|
+
end
|
972
|
+
|
973
|
+
# Ensure a carriage return at the end of the file
|
974
|
+
```
|
975
|
+
|
976
|
+
|
977
|
+
#### Using the get_customer_wish_list_with_http_info variant
|
978
|
+
|
979
|
+
This returns an Array which contains the response data, status code and headers.
|
980
|
+
|
981
|
+
> <Array(<CustomerWishListItemsResponse>, Integer, Hash)> get_customer_wish_list_with_http_info(customer_profile_oid)
|
982
|
+
|
983
|
+
```ruby
|
984
|
+
begin
|
985
|
+
# Retrieve wishlist items for customer
|
986
|
+
data, status_code, headers = api_instance.get_customer_wish_list_with_http_info(customer_profile_oid)
|
987
|
+
p status_code # => 2xx
|
988
|
+
p headers # => { ... }
|
989
|
+
p data # => <CustomerWishListItemsResponse>
|
990
|
+
rescue UltracartClient::ApiError => e
|
991
|
+
puts "Error when calling CustomerApi->get_customer_wish_list_with_http_info: #{e}"
|
992
|
+
end
|
993
|
+
```
|
994
|
+
|
995
|
+
### Parameters
|
996
|
+
|
997
|
+
| Name | Type | Description | Notes |
|
998
|
+
| ---- | ---- | ----------- | ----- |
|
999
|
+
| **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
|
1000
|
+
|
1001
|
+
### Return type
|
1002
|
+
|
1003
|
+
[**CustomerWishListItemsResponse**](CustomerWishListItemsResponse.md)
|
1004
|
+
|
1005
|
+
### Authorization
|
1006
|
+
|
1007
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1008
|
+
|
1009
|
+
### HTTP request headers
|
1010
|
+
|
1011
|
+
- **Content-Type**: Not defined
|
1012
|
+
- **Accept**: application/json
|
1013
|
+
|
1014
|
+
|
1015
|
+
## get_customer_wish_list_item
|
1016
|
+
|
1017
|
+
> <CustomerWishListItemResponse> get_customer_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
|
1018
|
+
|
1019
|
+
Retrieve wishlist item for customer
|
1020
|
+
|
1021
|
+
Retrieve wishlist item for customer.
|
1022
|
+
|
1023
|
+
|
1024
|
+
### Examples
|
1025
|
+
|
1026
|
+
```ruby
|
1027
|
+
#!/usr/bin/env ruby
|
1028
|
+
|
1029
|
+
# Require necessary files
|
1030
|
+
require 'ultracart_api'
|
1031
|
+
require_relative '../constants'
|
1032
|
+
require_relative 'customer_functions'
|
1033
|
+
require_relative '../item/item_functions'
|
1034
|
+
|
1035
|
+
# The wishlist methods allow management of a customer's wishlist.
|
1036
|
+
# This includes:
|
1037
|
+
# - deleteWishListItem
|
1038
|
+
# - getCustomerWishList
|
1039
|
+
# - getCustomerWishListItem
|
1040
|
+
# - insertWishListItem
|
1041
|
+
# - updateWishListItem
|
1042
|
+
# These methods provide a standard CRUD interface.
|
1043
|
+
#
|
1044
|
+
# You'll need merchant_item_oids to insert wishlist items. If you don't know the oids,
|
1045
|
+
# call ItemApi.getItemByMerchantItemId() to retrieve the item, then get item.merchant_item_oid
|
1046
|
+
#
|
1047
|
+
# Note: Priority of wishlist item, 3 being low priority and 5 is high priority.
|
1048
|
+
|
1049
|
+
begin
|
1050
|
+
# Initialize the customer API
|
1051
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1052
|
+
|
1053
|
+
# Create a few items first
|
1054
|
+
first_item_oid = insert_sample_item_and_get_oid
|
1055
|
+
second_item_oid = insert_sample_item_and_get_oid
|
1056
|
+
|
1057
|
+
# Create a customer
|
1058
|
+
customer_oid = insert_sample_customer
|
1059
|
+
|
1060
|
+
# TODO: If you don't know the customer oid, use getCustomerByEmail() to retrieve the customer.
|
1061
|
+
|
1062
|
+
# Add some wish list items
|
1063
|
+
first_wish_item = UltracartClient::CustomerWishListItem.new(
|
1064
|
+
customer_profile_oid: customer_oid,
|
1065
|
+
merchant_item_oid: first_item_oid,
|
1066
|
+
comments: "I really want this for my birthday",
|
1067
|
+
priority: 3 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
1068
|
+
)
|
1069
|
+
first_created_wish_item = customer_api.insert_wish_list_item(customer_oid, first_wish_item)
|
1070
|
+
|
1071
|
+
second_wish_item = UltracartClient::CustomerWishListItem.new(
|
1072
|
+
customer_profile_oid: customer_oid,
|
1073
|
+
merchant_item_oid: second_item_oid,
|
1074
|
+
comments: "Christmas Idea!",
|
1075
|
+
priority: 5 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
1076
|
+
)
|
1077
|
+
second_created_wish_item = customer_api.insert_wish_list_item(customer_oid, second_wish_item)
|
1078
|
+
|
1079
|
+
# Retrieve one wishlist item again
|
1080
|
+
first_created_wish_item_copy = customer_api.get_customer_wish_list_item(
|
1081
|
+
customer_oid,
|
1082
|
+
first_created_wish_item.customer_wishlist_item_oid
|
1083
|
+
).wishlist_item
|
1084
|
+
|
1085
|
+
# Retrieve all wishlist items
|
1086
|
+
all_wish_list_items = customer_api.get_customer_wish_list(customer_oid).wishlist_items
|
1087
|
+
|
1088
|
+
# Update an item
|
1089
|
+
second_created_wish_item.priority = 4
|
1090
|
+
updated_second_wish_item = customer_api.update_wish_list_item(
|
1091
|
+
customer_oid,
|
1092
|
+
second_created_wish_item.customer_wishlist_item_oid,
|
1093
|
+
second_created_wish_item
|
1094
|
+
)
|
1095
|
+
|
1096
|
+
# Delete a wish list item
|
1097
|
+
customer_api.delete_wish_list_item(
|
1098
|
+
customer_oid,
|
1099
|
+
first_created_wish_item.customer_wishlist_item_oid
|
1100
|
+
)
|
1101
|
+
|
1102
|
+
# Clean up
|
1103
|
+
delete_sample_customer(customer_oid)
|
1104
|
+
delete_sample_item_by_oid(first_item_oid)
|
1105
|
+
delete_sample_item_by_oid(second_item_oid)
|
1106
|
+
|
1107
|
+
rescue StandardError => e
|
1108
|
+
# Handle any exceptions that occur during the process
|
1109
|
+
puts 'An exception occurred. Please review the following error:'
|
1110
|
+
p e
|
1111
|
+
exit(1)
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
# Ensure a carriage return at the end of the file
|
1115
|
+
```
|
1116
|
+
|
1117
|
+
|
1118
|
+
#### Using the get_customer_wish_list_item_with_http_info variant
|
1119
|
+
|
1120
|
+
This returns an Array which contains the response data, status code and headers.
|
1121
|
+
|
1122
|
+
> <Array(<CustomerWishListItemResponse>, Integer, Hash)> get_customer_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
|
1123
|
+
|
1124
|
+
```ruby
|
1125
|
+
begin
|
1126
|
+
# Retrieve wishlist item for customer
|
1127
|
+
data, status_code, headers = api_instance.get_customer_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
|
1128
|
+
p status_code # => 2xx
|
1129
|
+
p headers # => { ... }
|
1130
|
+
p data # => <CustomerWishListItemResponse>
|
1131
|
+
rescue UltracartClient::ApiError => e
|
1132
|
+
puts "Error when calling CustomerApi->get_customer_wish_list_item_with_http_info: #{e}"
|
1133
|
+
end
|
1134
|
+
```
|
1135
|
+
|
1136
|
+
### Parameters
|
1137
|
+
|
1138
|
+
| Name | Type | Description | Notes |
|
1139
|
+
| ---- | ---- | ----------- | ----- |
|
1140
|
+
| **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
|
1141
|
+
| **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item. | |
|
1142
|
+
|
1143
|
+
### Return type
|
1144
|
+
|
1145
|
+
[**CustomerWishListItemResponse**](CustomerWishListItemResponse.md)
|
1146
|
+
|
1147
|
+
### Authorization
|
1148
|
+
|
1149
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1150
|
+
|
1151
|
+
### HTTP request headers
|
1152
|
+
|
1153
|
+
- **Content-Type**: Not defined
|
1154
|
+
- **Accept**: application/json
|
1155
|
+
|
1156
|
+
|
1157
|
+
## get_customers
|
1158
|
+
|
1159
|
+
> <CustomersResponse> get_customers(opts)
|
1160
|
+
|
1161
|
+
Retrieve customers
|
1162
|
+
|
1163
|
+
Retrieves customers from the account. If no parameters are specified, all customers 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.
|
1164
|
+
|
1165
|
+
|
1166
|
+
### Examples
|
1167
|
+
|
1168
|
+
```ruby
|
1169
|
+
#!/usr/bin/env ruby
|
1170
|
+
|
1171
|
+
require 'ultracart_api'
|
1172
|
+
require_relative '../constants'
|
1173
|
+
|
1174
|
+
# Adjust process time limits (Ruby doesn't have direct equivalents to PHP's set_time_limit and ini_set)
|
1175
|
+
# Note: These are more commonly handled by the runtime environment in Ruby
|
1176
|
+
|
1177
|
+
=begin
|
1178
|
+
This example illustrates how to retrieve customers. It uses the pagination logic necessary to query all customers.
|
1179
|
+
This method was the first getCustomers and has parameters for all the search terms. It's an ogre. Using
|
1180
|
+
getCustomersByQuery is much easier to use.
|
1181
|
+
=end
|
1182
|
+
|
1183
|
+
def get_customer_chunk(customer_api, offset, limit)
|
1184
|
+
# The real devil in the getCustomers calls is the expansion, making sure you return everything you need without
|
1185
|
+
# returning everything since these objects are extremely large. The customer object can be truly large with
|
1186
|
+
# all the order history. These are the possible expansion values:
|
1187
|
+
#
|
1188
|
+
# attachments billing cards cc_emails loyalty orders_summary pricing_tiers
|
1189
|
+
# privacy properties quotes_summary reviewer shipping software_entitlements tags
|
1190
|
+
# tax_codes
|
1191
|
+
|
1192
|
+
# Just the address fields. Contact us if you're unsure
|
1193
|
+
expand = "shipping,billing"
|
1194
|
+
|
1195
|
+
# TODO: Seriously, use getCustomersByQuery -- it's so much better than this old method.
|
1196
|
+
# Prepare all the nil parameters
|
1197
|
+
search_params = {
|
1198
|
+
email: nil,
|
1199
|
+
qb_class: nil,
|
1200
|
+
quickbooks_code: nil,
|
1201
|
+
last_modified_dts_start: nil,
|
1202
|
+
last_modified_dts_end: nil,
|
1203
|
+
signup_dts_start: nil,
|
1204
|
+
signup_dts_end: nil,
|
1205
|
+
billing_first_name: nil,
|
1206
|
+
billing_last_name: nil,
|
1207
|
+
billing_company: nil,
|
1208
|
+
billing_city: nil,
|
1209
|
+
billing_state: nil,
|
1210
|
+
billing_postal_code: nil,
|
1211
|
+
billing_country_code: nil,
|
1212
|
+
billing_day_phone: nil,
|
1213
|
+
billing_evening_phone: nil,
|
1214
|
+
shipping_first_name: nil,
|
1215
|
+
shipping_last_name: nil,
|
1216
|
+
shipping_company: nil,
|
1217
|
+
shipping_city: nil,
|
1218
|
+
shipping_state: nil,
|
1219
|
+
shipping_postal_code: nil,
|
1220
|
+
shipping_country_code: nil,
|
1221
|
+
shipping_day_phone: nil,
|
1222
|
+
shipping_evening_phone: nil,
|
1223
|
+
pricing_tier_oid: nil,
|
1224
|
+
pricing_tier_name: nil
|
1225
|
+
}
|
1226
|
+
|
1227
|
+
# Call the API with all parameters
|
1228
|
+
api_response = customer_api.get_customers(
|
1229
|
+
**search_params,
|
1230
|
+
limit: limit,
|
1231
|
+
offset: offset,
|
1232
|
+
since: nil,
|
1233
|
+
sort: nil,
|
1234
|
+
opts: {
|
1235
|
+
'_expand' => expand
|
1236
|
+
}
|
1237
|
+
)
|
1238
|
+
|
1239
|
+
# Return customers or empty array
|
1240
|
+
api_response.customers || []
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
# Initialize the customer API
|
1244
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1245
|
+
|
1246
|
+
# Prepare for pagination
|
1247
|
+
customers = []
|
1248
|
+
iteration = 1
|
1249
|
+
offset = 0
|
1250
|
+
limit = 200
|
1251
|
+
more_records_to_fetch = true
|
1252
|
+
|
1253
|
+
begin
|
1254
|
+
while more_records_to_fetch
|
1255
|
+
puts "executing iteration #{iteration}"
|
1256
|
+
|
1257
|
+
# Fetch a chunk of customers
|
1258
|
+
chunk_of_customers = get_customer_chunk(customer_api, offset, limit)
|
1259
|
+
|
1260
|
+
# Merge with existing customers
|
1261
|
+
customers.concat(chunk_of_customers)
|
1262
|
+
|
1263
|
+
# Update offset and check if more records exist
|
1264
|
+
offset += limit
|
1265
|
+
more_records_to_fetch = chunk_of_customers.length == limit
|
1266
|
+
iteration += 1
|
1267
|
+
end
|
1268
|
+
rescue UltracartClient::ApiError => e
|
1269
|
+
puts "ApiError occurred on iteration #{iteration}"
|
1270
|
+
p e
|
1271
|
+
exit 1
|
1272
|
+
end
|
1273
|
+
|
1274
|
+
# This will be verbose...
|
1275
|
+
p customers
|
1276
|
+
```
|
1277
|
+
|
1278
|
+
|
1279
|
+
#### Using the get_customers_with_http_info variant
|
1280
|
+
|
1281
|
+
This returns an Array which contains the response data, status code and headers.
|
1282
|
+
|
1283
|
+
> <Array(<CustomersResponse>, Integer, Hash)> get_customers_with_http_info(opts)
|
1284
|
+
|
1285
|
+
```ruby
|
1286
|
+
begin
|
1287
|
+
# Retrieve customers
|
1288
|
+
data, status_code, headers = api_instance.get_customers_with_http_info(opts)
|
1289
|
+
p status_code # => 2xx
|
1290
|
+
p headers # => { ... }
|
1291
|
+
p data # => <CustomersResponse>
|
1292
|
+
rescue UltracartClient::ApiError => e
|
1293
|
+
puts "Error when calling CustomerApi->get_customers_with_http_info: #{e}"
|
1294
|
+
end
|
1295
|
+
```
|
1296
|
+
|
1297
|
+
### Parameters
|
1298
|
+
|
1299
|
+
| Name | Type | Description | Notes |
|
1300
|
+
| ---- | ---- | ----------- | ----- |
|
1301
|
+
| **email** | **String** | Email | [optional] |
|
1302
|
+
| **qb_class** | **String** | Quickbooks class | [optional] |
|
1303
|
+
| **quickbooks_code** | **String** | Quickbooks code | [optional] |
|
1304
|
+
| **last_modified_dts_start** | **String** | Last modified date start | [optional] |
|
1305
|
+
| **last_modified_dts_end** | **String** | Last modified date end | [optional] |
|
1306
|
+
| **signup_dts_start** | **String** | Signup date start | [optional] |
|
1307
|
+
| **signup_dts_end** | **String** | Signup date end | [optional] |
|
1308
|
+
| **billing_first_name** | **String** | Billing first name | [optional] |
|
1309
|
+
| **billing_last_name** | **String** | Billing last name | [optional] |
|
1310
|
+
| **billing_company** | **String** | Billing company | [optional] |
|
1311
|
+
| **billing_city** | **String** | Billing city | [optional] |
|
1312
|
+
| **billing_state** | **String** | Billing state | [optional] |
|
1313
|
+
| **billing_postal_code** | **String** | Billing postal code | [optional] |
|
1314
|
+
| **billing_country_code** | **String** | Billing country code | [optional] |
|
1315
|
+
| **billing_day_phone** | **String** | Billing day phone | [optional] |
|
1316
|
+
| **billing_evening_phone** | **String** | Billing evening phone | [optional] |
|
1317
|
+
| **shipping_first_name** | **String** | Shipping first name | [optional] |
|
1318
|
+
| **shipping_last_name** | **String** | Shipping last name | [optional] |
|
1319
|
+
| **shipping_company** | **String** | Shipping company | [optional] |
|
1320
|
+
| **shipping_city** | **String** | Shipping city | [optional] |
|
1321
|
+
| **shipping_state** | **String** | Shipping state | [optional] |
|
1322
|
+
| **shipping_postal_code** | **String** | Shipping postal code | [optional] |
|
1323
|
+
| **shipping_country_code** | **String** | Shipping country code | [optional] |
|
1324
|
+
| **shipping_day_phone** | **String** | Shipping day phone | [optional] |
|
1325
|
+
| **shipping_evening_phone** | **String** | Shipping evening phone | [optional] |
|
1326
|
+
| **pricing_tier_oid** | **Integer** | Pricing tier oid | [optional] |
|
1327
|
+
| **pricing_tier_name** | **String** | Pricing tier name | [optional] |
|
1328
|
+
| **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
|
1329
|
+
| **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
|
1330
|
+
| **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
|
1331
|
+
| **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
|
1332
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
1333
|
+
|
1334
|
+
### Return type
|
1335
|
+
|
1336
|
+
[**CustomersResponse**](CustomersResponse.md)
|
1337
|
+
|
1338
|
+
### Authorization
|
1339
|
+
|
1340
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1341
|
+
|
1342
|
+
### HTTP request headers
|
1343
|
+
|
1344
|
+
- **Content-Type**: Not defined
|
1345
|
+
- **Accept**: application/json
|
1346
|
+
|
1347
|
+
|
1348
|
+
## get_customers_by_query
|
1349
|
+
|
1350
|
+
> <CustomersResponse> get_customers_by_query(customer_query, opts)
|
1351
|
+
|
1352
|
+
Retrieve customers by query
|
1353
|
+
|
1354
|
+
Retrieves customers from the account. If no parameters are specified, all customers 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.
|
1355
|
+
|
1356
|
+
|
1357
|
+
### Examples
|
1358
|
+
|
1359
|
+
```ruby
|
1360
|
+
#!/usr/bin/env ruby
|
1361
|
+
|
1362
|
+
require 'ultracart_api'
|
1363
|
+
require_relative '../constants'
|
1364
|
+
|
1365
|
+
=begin
|
1366
|
+
This example illustrates how to retrieve customers. It uses the pagination logic necessary to query all customers
|
1367
|
+
using the getCustomersByQuery method.
|
1368
|
+
=end
|
1369
|
+
|
1370
|
+
def get_customer_chunk(customer_api, offset, limit)
|
1371
|
+
# The real devil in the getCustomers calls is the expansion, making sure you return everything you need without
|
1372
|
+
# returning everything since these objects are extremely large. The customer object can be truly large with
|
1373
|
+
# all the order history. These are the possible expansion values:
|
1374
|
+
#
|
1375
|
+
# attachments billing cards cc_emails loyalty orders_summary pricing_tiers
|
1376
|
+
# privacy properties quotes_summary reviewer shipping software_entitlements tags
|
1377
|
+
# tax_codes
|
1378
|
+
|
1379
|
+
# Just the address fields. Contact us if you're unsure
|
1380
|
+
expand = "shipping,billing"
|
1381
|
+
|
1382
|
+
# TODO: This is just showing all the possibilities. In reality, you'll just assign the filters you need.
|
1383
|
+
query = UltracartClient::CustomerQuery.new
|
1384
|
+
# Uncomment and set as needed:
|
1385
|
+
# query.email = nil
|
1386
|
+
# query.qb_class = nil
|
1387
|
+
# query.quickbooks_code = nil
|
1388
|
+
# query.last_modified_dts_start = nil
|
1389
|
+
# query.last_modified_dts_end = nil
|
1390
|
+
# query.signup_dts_start = nil
|
1391
|
+
# query.signup_dts_end = nil
|
1392
|
+
# query.billing_first_name = nil
|
1393
|
+
# query.billing_last_name = nil
|
1394
|
+
# query.billing_company = nil
|
1395
|
+
# query.billing_city = nil
|
1396
|
+
# query.billing_state = nil
|
1397
|
+
# query.billing_postal_code = nil
|
1398
|
+
# query.billing_country_code = nil
|
1399
|
+
# query.billing_day_phone = nil
|
1400
|
+
# query.billing_evening_phone = nil
|
1401
|
+
# query.shipping_first_name = nil
|
1402
|
+
# query.shipping_last_name = nil
|
1403
|
+
# query.shipping_company = nil
|
1404
|
+
# query.shipping_city = nil
|
1405
|
+
# query.shipping_state = nil
|
1406
|
+
# query.shipping_postal_code = nil
|
1407
|
+
# query.shipping_country_code = nil
|
1408
|
+
# query.shipping_day_phone = nil
|
1409
|
+
# query.shipping_evening_phone = nil
|
1410
|
+
# query.pricing_tier_oid = nil
|
1411
|
+
# query.pricing_tier_name = nil
|
1412
|
+
|
1413
|
+
since = nil
|
1414
|
+
sort = "email"
|
1415
|
+
|
1416
|
+
# Call the API with query parameters
|
1417
|
+
api_response = customer_api.get_customers_by_query(
|
1418
|
+
query,
|
1419
|
+
offset,
|
1420
|
+
limit,
|
1421
|
+
since,
|
1422
|
+
sort,
|
1423
|
+
opts: {
|
1424
|
+
'_expand' => expand
|
1425
|
+
}
|
1426
|
+
)
|
1427
|
+
|
1428
|
+
# Return customers or empty array
|
1429
|
+
api_response.customers || []
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
# Initialize the customer API
|
1433
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1434
|
+
|
1435
|
+
# Prepare for pagination
|
1436
|
+
customers = []
|
1437
|
+
iteration = 1
|
1438
|
+
offset = 0
|
1439
|
+
limit = 200
|
1440
|
+
more_records_to_fetch = true
|
1441
|
+
|
1442
|
+
begin
|
1443
|
+
while more_records_to_fetch
|
1444
|
+
puts "executing iteration #{iteration}"
|
1445
|
+
|
1446
|
+
# Fetch a chunk of customers
|
1447
|
+
chunk_of_customers = get_customer_chunk(customer_api, offset, limit)
|
1448
|
+
|
1449
|
+
# Merge with existing customers
|
1450
|
+
customers.concat(chunk_of_customers)
|
1451
|
+
|
1452
|
+
# Update offset and check if more records exist
|
1453
|
+
offset += limit
|
1454
|
+
more_records_to_fetch = chunk_of_customers.length == limit
|
1455
|
+
iteration += 1
|
1456
|
+
end
|
1457
|
+
rescue UltracartClient::ApiError => e
|
1458
|
+
puts "ApiError occurred on iteration #{iteration}"
|
1459
|
+
p e
|
1460
|
+
exit 1
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
# This will be verbose...
|
1464
|
+
p customers
|
1465
|
+
|
1466
|
+
# Add a final carriage return
|
1467
|
+
```
|
1468
|
+
|
1469
|
+
|
1470
|
+
#### Using the get_customers_by_query_with_http_info variant
|
1471
|
+
|
1472
|
+
This returns an Array which contains the response data, status code and headers.
|
1473
|
+
|
1474
|
+
> <Array(<CustomersResponse>, Integer, Hash)> get_customers_by_query_with_http_info(customer_query, opts)
|
1475
|
+
|
1476
|
+
```ruby
|
1477
|
+
begin
|
1478
|
+
# Retrieve customers by query
|
1479
|
+
data, status_code, headers = api_instance.get_customers_by_query_with_http_info(customer_query, opts)
|
1480
|
+
p status_code # => 2xx
|
1481
|
+
p headers # => { ... }
|
1482
|
+
p data # => <CustomersResponse>
|
1483
|
+
rescue UltracartClient::ApiError => e
|
1484
|
+
puts "Error when calling CustomerApi->get_customers_by_query_with_http_info: #{e}"
|
1485
|
+
end
|
1486
|
+
```
|
1487
|
+
|
1488
|
+
### Parameters
|
1489
|
+
|
1490
|
+
| Name | Type | Description | Notes |
|
1491
|
+
| ---- | ---- | ----------- | ----- |
|
1492
|
+
| **customer_query** | [**CustomerQuery**](CustomerQuery.md) | Customer query | |
|
1493
|
+
| **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
|
1494
|
+
| **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
|
1495
|
+
| **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
|
1496
|
+
| **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
|
1497
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
1498
|
+
|
1499
|
+
### Return type
|
1500
|
+
|
1501
|
+
[**CustomersResponse**](CustomersResponse.md)
|
1502
|
+
|
1503
|
+
### Authorization
|
1504
|
+
|
1505
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1506
|
+
|
1507
|
+
### HTTP request headers
|
1508
|
+
|
1509
|
+
- **Content-Type**: application/json
|
1510
|
+
- **Accept**: application/json
|
1511
|
+
|
1512
|
+
|
1513
|
+
## get_customers_for_data_tables
|
1514
|
+
|
1515
|
+
> <DataTablesServerSideResponse> get_customers_for_data_tables(opts)
|
1516
|
+
|
1517
|
+
Retrieve customers for DataTables plugin
|
1518
|
+
|
1519
|
+
Retrieves customers from the account. If no searches are specified, all customers will be returned.
|
1520
|
+
|
1521
|
+
|
1522
|
+
### Examples
|
1523
|
+
|
1524
|
+
```ruby
|
1525
|
+
# This is an internal method used by our Customer management screen. It won't be of much use to you, so we're
|
1526
|
+
# not including a sample. getCustomer, getCustomerByEmail, getCustomers and getCustomersByQuery are more useful
|
1527
|
+
```
|
1528
|
+
|
1529
|
+
|
1530
|
+
#### Using the get_customers_for_data_tables_with_http_info variant
|
1531
|
+
|
1532
|
+
This returns an Array which contains the response data, status code and headers.
|
1533
|
+
|
1534
|
+
> <Array(<DataTablesServerSideResponse>, Integer, Hash)> get_customers_for_data_tables_with_http_info(opts)
|
1535
|
+
|
1536
|
+
```ruby
|
1537
|
+
begin
|
1538
|
+
# Retrieve customers for DataTables plugin
|
1539
|
+
data, status_code, headers = api_instance.get_customers_for_data_tables_with_http_info(opts)
|
1540
|
+
p status_code # => 2xx
|
1541
|
+
p headers # => { ... }
|
1542
|
+
p data # => <DataTablesServerSideResponse>
|
1543
|
+
rescue UltracartClient::ApiError => e
|
1544
|
+
puts "Error when calling CustomerApi->get_customers_for_data_tables_with_http_info: #{e}"
|
1545
|
+
end
|
1546
|
+
```
|
1547
|
+
|
1548
|
+
### Parameters
|
1549
|
+
|
1550
|
+
| Name | Type | Description | Notes |
|
1551
|
+
| ---- | ---- | ----------- | ----- |
|
1552
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
1553
|
+
|
1554
|
+
### Return type
|
1555
|
+
|
1556
|
+
[**DataTablesServerSideResponse**](DataTablesServerSideResponse.md)
|
1557
|
+
|
1558
|
+
### Authorization
|
1559
|
+
|
1560
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1561
|
+
|
1562
|
+
### HTTP request headers
|
1563
|
+
|
1564
|
+
- **Content-Type**: Not defined
|
1565
|
+
- **Accept**: application/json
|
1566
|
+
|
1567
|
+
|
1568
|
+
## get_email_verification_token
|
1569
|
+
|
1570
|
+
> <EmailVerifyTokenResponse> get_email_verification_token(token_request)
|
1571
|
+
|
1572
|
+
Create a token that can be used to verify a customer email address
|
1573
|
+
|
1574
|
+
Create a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant.
|
1575
|
+
|
1576
|
+
|
1577
|
+
### Examples
|
1578
|
+
|
1579
|
+
```ruby
|
1580
|
+
require 'ultracart_api'
|
1581
|
+
require_relative '../constants'
|
1582
|
+
|
1583
|
+
=begin
|
1584
|
+
getEmailVerificationToken and validateEmailVerificationToken are tandem functions that allow a merchant to verify
|
1585
|
+
a customer's email address. getEmailVerificationToken returns back a token that the merchant can use however
|
1586
|
+
they wish to present to a customer. Usually this will be emailed to the customer within instructions to enter
|
1587
|
+
it back into a website. Once the customer enters the token back into a site (along with their email),
|
1588
|
+
validateEmailVerificationToken will validate the token.
|
1589
|
+
|
1590
|
+
Notice that getEmailVerificationToken requires both the email and password.
|
1591
|
+
=end
|
1592
|
+
|
1593
|
+
# Initialize the customer API
|
1594
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1595
|
+
|
1596
|
+
# Set email and password
|
1597
|
+
email = "test@ultracart.com"
|
1598
|
+
password = "squirrel"
|
1599
|
+
|
1600
|
+
# Create token request
|
1601
|
+
token_request = UltracartClient::EmailVerifyTokenRequest.new(
|
1602
|
+
email: email,
|
1603
|
+
password: password
|
1604
|
+
)
|
1605
|
+
|
1606
|
+
# Get email verification token
|
1607
|
+
token_response = customer_api.get_email_verification_token(token_request)
|
1608
|
+
token = token_response.token
|
1609
|
+
|
1610
|
+
# TODO - email the token to the customer, have them enter it back into another page...
|
1611
|
+
# TODO - verify the token with the following call
|
1612
|
+
|
1613
|
+
# Create verify request
|
1614
|
+
verify_request = UltracartClient::EmailVerifyTokenValidateRequest.new(
|
1615
|
+
token: token
|
1616
|
+
)
|
1617
|
+
|
1618
|
+
# Validate email verification token
|
1619
|
+
verify_response = customer_api.validate_email_verification_token(verify_request)
|
1620
|
+
|
1621
|
+
# Print verification result
|
1622
|
+
puts "Was the correct token provided? #{verify_response.success}"
|
1623
|
+
```
|
1624
|
+
|
1625
|
+
|
1626
|
+
#### Using the get_email_verification_token_with_http_info variant
|
1627
|
+
|
1628
|
+
This returns an Array which contains the response data, status code and headers.
|
1629
|
+
|
1630
|
+
> <Array(<EmailVerifyTokenResponse>, Integer, Hash)> get_email_verification_token_with_http_info(token_request)
|
1631
|
+
|
1632
|
+
```ruby
|
1633
|
+
begin
|
1634
|
+
# Create a token that can be used to verify a customer email address
|
1635
|
+
data, status_code, headers = api_instance.get_email_verification_token_with_http_info(token_request)
|
1636
|
+
p status_code # => 2xx
|
1637
|
+
p headers # => { ... }
|
1638
|
+
p data # => <EmailVerifyTokenResponse>
|
1639
|
+
rescue UltracartClient::ApiError => e
|
1640
|
+
puts "Error when calling CustomerApi->get_email_verification_token_with_http_info: #{e}"
|
1641
|
+
end
|
1642
|
+
```
|
1643
|
+
|
1644
|
+
### Parameters
|
1645
|
+
|
1646
|
+
| Name | Type | Description | Notes |
|
1647
|
+
| ---- | ---- | ----------- | ----- |
|
1648
|
+
| **token_request** | [**EmailVerifyTokenRequest**](EmailVerifyTokenRequest.md) | Token request | |
|
1649
|
+
|
1650
|
+
### Return type
|
1651
|
+
|
1652
|
+
[**EmailVerifyTokenResponse**](EmailVerifyTokenResponse.md)
|
1653
|
+
|
1654
|
+
### Authorization
|
1655
|
+
|
1656
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1657
|
+
|
1658
|
+
### HTTP request headers
|
1659
|
+
|
1660
|
+
- **Content-Type**: application/json
|
1661
|
+
- **Accept**: application/json
|
1662
|
+
|
1663
|
+
|
1664
|
+
## get_magic_link
|
1665
|
+
|
1666
|
+
> <CustomerMagicLinkResponse> get_magic_link(customer_profile_oid, storefront_host_name)
|
1667
|
+
|
1668
|
+
getMagicLink
|
1669
|
+
|
1670
|
+
Retrieves a magic link to allow a merchant to login as a customer. This method is a PUT call intentionally.
|
1671
|
+
|
1672
|
+
|
1673
|
+
### Examples
|
1674
|
+
|
1675
|
+
```ruby
|
1676
|
+
#!/usr/bin/env ruby
|
1677
|
+
|
1678
|
+
# Require necessary files
|
1679
|
+
require 'ultracart_api'
|
1680
|
+
require_relative '../constants'
|
1681
|
+
require_relative 'customer_functions'
|
1682
|
+
|
1683
|
+
# getMagicLink returns back a url whereby a merchant can log into their website as the customer.
|
1684
|
+
# This may be useful to "see what the customer is seeing" and is the only method to do so since
|
1685
|
+
# the customer's passwords are encrypted. Note: A merchant may also do this using the UltraCart
|
1686
|
+
# backend site within the Customer Management section.
|
1687
|
+
|
1688
|
+
begin
|
1689
|
+
# Initialize the customer API
|
1690
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1691
|
+
|
1692
|
+
# Create a customer
|
1693
|
+
customer_oid = insert_sample_customer
|
1694
|
+
storefront = "www.website.com" # required. many merchants have dozens of storefronts. which one?
|
1695
|
+
|
1696
|
+
# Get the magic link
|
1697
|
+
api_response = customer_api.get_magic_link(customer_oid, storefront)
|
1698
|
+
url = api_response.url
|
1699
|
+
|
1700
|
+
# Output HTML to redirect to the magic link
|
1701
|
+
puts <<-HTML
|
1702
|
+
<html>
|
1703
|
+
<body>
|
1704
|
+
<script>
|
1705
|
+
window.location.href = #{url.to_json};
|
1706
|
+
</script>
|
1707
|
+
</body>
|
1708
|
+
</html>
|
1709
|
+
HTML
|
1710
|
+
|
1711
|
+
# Clean up this sample - don't do this or the above magic link won't work.
|
1712
|
+
# You'll want to clean up this sample customer manually using the backend.
|
1713
|
+
# delete_sample_customer(customer_oid)
|
1714
|
+
|
1715
|
+
rescue StandardError => e
|
1716
|
+
# Handle any exceptions that occur during the process
|
1717
|
+
puts 'An exception occurred. Please review the following error:'
|
1718
|
+
p e
|
1719
|
+
exit(1)
|
1720
|
+
end
|
1721
|
+
|
1722
|
+
# Ensure a carriage return at the end of the file
|
1723
|
+
```
|
1724
|
+
|
1725
|
+
|
1726
|
+
#### Using the get_magic_link_with_http_info variant
|
1727
|
+
|
1728
|
+
This returns an Array which contains the response data, status code and headers.
|
1729
|
+
|
1730
|
+
> <Array(<CustomerMagicLinkResponse>, Integer, Hash)> get_magic_link_with_http_info(customer_profile_oid, storefront_host_name)
|
1731
|
+
|
1732
|
+
```ruby
|
1733
|
+
begin
|
1734
|
+
# getMagicLink
|
1735
|
+
data, status_code, headers = api_instance.get_magic_link_with_http_info(customer_profile_oid, storefront_host_name)
|
1736
|
+
p status_code # => 2xx
|
1737
|
+
p headers # => { ... }
|
1738
|
+
p data # => <CustomerMagicLinkResponse>
|
1739
|
+
rescue UltracartClient::ApiError => e
|
1740
|
+
puts "Error when calling CustomerApi->get_magic_link_with_http_info: #{e}"
|
1741
|
+
end
|
1742
|
+
```
|
1743
|
+
|
1744
|
+
### Parameters
|
1745
|
+
|
1746
|
+
| Name | Type | Description | Notes |
|
1747
|
+
| ---- | ---- | ----------- | ----- |
|
1748
|
+
| **customer_profile_oid** | **Integer** | The customer_profile_oid of the customer. | |
|
1749
|
+
| **storefront_host_name** | **String** | The storefront to log into. | |
|
1750
|
+
|
1751
|
+
### Return type
|
1752
|
+
|
1753
|
+
[**CustomerMagicLinkResponse**](CustomerMagicLinkResponse.md)
|
1754
|
+
|
1755
|
+
### Authorization
|
1756
|
+
|
1757
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1758
|
+
|
1759
|
+
### HTTP request headers
|
1760
|
+
|
1761
|
+
- **Content-Type**: Not defined
|
1762
|
+
- **Accept**: application/json
|
1763
|
+
|
1764
|
+
|
1765
|
+
## insert_customer
|
1766
|
+
|
1767
|
+
> <CustomerResponse> insert_customer(customer, opts)
|
1768
|
+
|
1769
|
+
Insert a customer
|
1770
|
+
|
1771
|
+
Insert a customer on the UltraCart account.
|
1772
|
+
|
1773
|
+
|
1774
|
+
### Examples
|
1775
|
+
|
1776
|
+
```ruby
|
1777
|
+
# frozen_string_literal: true
|
1778
|
+
|
1779
|
+
require 'json'
|
1780
|
+
require 'ultracart_api'
|
1781
|
+
|
1782
|
+
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
|
1783
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(simple_key, false, false)
|
1784
|
+
|
1785
|
+
|
1786
|
+
customer = UltracartClient::Customer.new
|
1787
|
+
customer.email = "joe-#{rand}@aol.com"
|
1788
|
+
customer.password = "pw#{rand}"
|
1789
|
+
|
1790
|
+
shipping = UltracartClient::CustomerShipping.new
|
1791
|
+
shipping.first_name = 'Joe'
|
1792
|
+
shipping.last_name = 'Smith'
|
1793
|
+
shipping.address1 = '206 Washington St SW'
|
1794
|
+
shipping.city = 'Atlanta'
|
1795
|
+
shipping.state_region = 'GA'
|
1796
|
+
shipping.postal_code = '30334'
|
1797
|
+
customer.shipping = [shipping] # notice this is an array of one shipping address (for now)
|
1798
|
+
|
1799
|
+
billing = UltracartClient::CustomerBilling.new
|
1800
|
+
billing.first_name = 'Joe'
|
1801
|
+
billing.last_name = 'Smith'
|
1802
|
+
billing.company = 'Joe Inc.'
|
1803
|
+
billing.day_phone = '4046561776'
|
1804
|
+
billing.address1 = '206 Washington St SW'
|
1805
|
+
billing.city = 'Atlanta'
|
1806
|
+
billing.state_region = 'GA'
|
1807
|
+
billing.postal_code = '30334'
|
1808
|
+
customer.billing = [billing] # notice this is an array of one shipping address (for now)
|
1809
|
+
|
1810
|
+
|
1811
|
+
# by default, UltraCart returns a minimal object. If we want to see all the information we submitted, we need to
|
1812
|
+
# ask for it back. If we're only doing an insert and we don't care, _expand may be left empty.
|
1813
|
+
# Possible expansion components:
|
1814
|
+
# shipping
|
1815
|
+
# billing
|
1816
|
+
# cards
|
1817
|
+
# pricing_tiers
|
1818
|
+
# cc_emails
|
1819
|
+
# orders_summary
|
1820
|
+
# quotes_summary
|
1821
|
+
# tax_codes
|
1822
|
+
# privacy
|
1823
|
+
# reviewer
|
1824
|
+
# attachments
|
1825
|
+
# software_entitlements
|
1826
|
+
# tags
|
1827
|
+
# loyalty
|
1828
|
+
|
1829
|
+
opts = {_expand: 'shipping,billing'}
|
1830
|
+
begin
|
1831
|
+
customer_response = customer_api.insert_customer(customer, opts)
|
1832
|
+
puts customer_response.to_json
|
1833
|
+
rescue UltracartClient::ApiError => ex
|
1834
|
+
puts "Error inserting customer: #{ex.json}"
|
1835
|
+
# Ruby does not give detailed error information. Check the server logs.
|
1836
|
+
# Login to secure.ultracart.com, navigate to Home->Configuration->Development->API Keys
|
1837
|
+
# click the "log" button for your API key.
|
1838
|
+
end
|
1839
|
+
|
1840
|
+
```
|
1841
|
+
|
1842
|
+
|
1843
|
+
#### Using the insert_customer_with_http_info variant
|
1844
|
+
|
1845
|
+
This returns an Array which contains the response data, status code and headers.
|
1846
|
+
|
1847
|
+
> <Array(<CustomerResponse>, Integer, Hash)> insert_customer_with_http_info(customer, opts)
|
1848
|
+
|
1849
|
+
```ruby
|
1850
|
+
begin
|
1851
|
+
# Insert a customer
|
1852
|
+
data, status_code, headers = api_instance.insert_customer_with_http_info(customer, opts)
|
1853
|
+
p status_code # => 2xx
|
1854
|
+
p headers # => { ... }
|
1855
|
+
p data # => <CustomerResponse>
|
1856
|
+
rescue UltracartClient::ApiError => e
|
1857
|
+
puts "Error when calling CustomerApi->insert_customer_with_http_info: #{e}"
|
1858
|
+
end
|
1859
|
+
```
|
1860
|
+
|
1861
|
+
### Parameters
|
1862
|
+
|
1863
|
+
| Name | Type | Description | Notes |
|
1864
|
+
| ---- | ---- | ----------- | ----- |
|
1865
|
+
| **customer** | [**Customer**](Customer.md) | Customer to insert | |
|
1866
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
1867
|
+
|
1868
|
+
### Return type
|
1869
|
+
|
1870
|
+
[**CustomerResponse**](CustomerResponse.md)
|
1871
|
+
|
1872
|
+
### Authorization
|
1873
|
+
|
1874
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1875
|
+
|
1876
|
+
### HTTP request headers
|
1877
|
+
|
1878
|
+
- **Content-Type**: application/json; charset=UTF-8
|
1879
|
+
- **Accept**: application/json
|
1880
|
+
|
1881
|
+
|
1882
|
+
## insert_wish_list_item
|
1883
|
+
|
1884
|
+
> <CustomerWishListItem> insert_wish_list_item(customer_profile_oid, wishlist_item)
|
1885
|
+
|
1886
|
+
Insert a customer wishlist item
|
1887
|
+
|
1888
|
+
Insert a customer wishlist item
|
1889
|
+
|
1890
|
+
|
1891
|
+
### Examples
|
1892
|
+
|
1893
|
+
```ruby
|
1894
|
+
#!/usr/bin/env ruby
|
1895
|
+
|
1896
|
+
# Require necessary files
|
1897
|
+
require 'ultracart_api'
|
1898
|
+
require_relative '../constants'
|
1899
|
+
require_relative 'customer_functions'
|
1900
|
+
require_relative '../item/item_functions'
|
1901
|
+
|
1902
|
+
# The wishlist methods allow management of a customer's wishlist.
|
1903
|
+
# This includes:
|
1904
|
+
# - deleteWishListItem
|
1905
|
+
# - getCustomerWishList
|
1906
|
+
# - getCustomerWishListItem
|
1907
|
+
# - insertWishListItem
|
1908
|
+
# - updateWishListItem
|
1909
|
+
# These methods provide a standard CRUD interface.
|
1910
|
+
#
|
1911
|
+
# You'll need merchant_item_oids to insert wishlist items. If you don't know the oids,
|
1912
|
+
# call ItemApi.getItemByMerchantItemId() to retrieve the item, then get item.merchant_item_oid
|
1913
|
+
#
|
1914
|
+
# Note: Priority of wishlist item, 3 being low priority and 5 is high priority.
|
1915
|
+
|
1916
|
+
begin
|
1917
|
+
# Initialize the customer API
|
1918
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
1919
|
+
|
1920
|
+
# Create a few items first
|
1921
|
+
first_item_oid = insert_sample_item_and_get_oid
|
1922
|
+
second_item_oid = insert_sample_item_and_get_oid
|
1923
|
+
|
1924
|
+
# Create a customer
|
1925
|
+
customer_oid = insert_sample_customer
|
1926
|
+
|
1927
|
+
# TODO: If you don't know the customer oid, use getCustomerByEmail() to retrieve the customer.
|
1928
|
+
|
1929
|
+
# Add some wish list items
|
1930
|
+
first_wish_item = UltracartClient::CustomerWishListItem.new(
|
1931
|
+
customer_profile_oid: customer_oid,
|
1932
|
+
merchant_item_oid: first_item_oid,
|
1933
|
+
comments: "I really want this for my birthday",
|
1934
|
+
priority: 3 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
1935
|
+
)
|
1936
|
+
first_created_wish_item = customer_api.insert_wish_list_item(customer_oid, first_wish_item)
|
1937
|
+
|
1938
|
+
second_wish_item = UltracartClient::CustomerWishListItem.new(
|
1939
|
+
customer_profile_oid: customer_oid,
|
1940
|
+
merchant_item_oid: second_item_oid,
|
1941
|
+
comments: "Christmas Idea!",
|
1942
|
+
priority: 5 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
1943
|
+
)
|
1944
|
+
second_created_wish_item = customer_api.insert_wish_list_item(customer_oid, second_wish_item)
|
1945
|
+
|
1946
|
+
# Retrieve one wishlist item again
|
1947
|
+
first_created_wish_item_copy = customer_api.get_customer_wish_list_item(
|
1948
|
+
customer_oid,
|
1949
|
+
first_created_wish_item.customer_wishlist_item_oid
|
1950
|
+
).wishlist_item
|
1951
|
+
|
1952
|
+
# Retrieve all wishlist items
|
1953
|
+
all_wish_list_items = customer_api.get_customer_wish_list(customer_oid).wishlist_items
|
1954
|
+
|
1955
|
+
# Update an item
|
1956
|
+
second_created_wish_item.priority = 4
|
1957
|
+
updated_second_wish_item = customer_api.update_wish_list_item(
|
1958
|
+
customer_oid,
|
1959
|
+
second_created_wish_item.customer_wishlist_item_oid,
|
1960
|
+
second_created_wish_item
|
1961
|
+
)
|
1962
|
+
|
1963
|
+
# Delete a wish list item
|
1964
|
+
customer_api.delete_wish_list_item(
|
1965
|
+
customer_oid,
|
1966
|
+
first_created_wish_item.customer_wishlist_item_oid
|
1967
|
+
)
|
1968
|
+
|
1969
|
+
# Clean up
|
1970
|
+
delete_sample_customer(customer_oid)
|
1971
|
+
delete_sample_item_by_oid(first_item_oid)
|
1972
|
+
delete_sample_item_by_oid(second_item_oid)
|
1973
|
+
|
1974
|
+
rescue StandardError => e
|
1975
|
+
# Handle any exceptions that occur during the process
|
1976
|
+
puts 'An exception occurred. Please review the following error:'
|
1977
|
+
p e
|
1978
|
+
exit(1)
|
1979
|
+
end
|
1980
|
+
|
1981
|
+
# Ensure a carriage return at the end of the file
|
1982
|
+
```
|
1983
|
+
|
1984
|
+
|
1985
|
+
#### Using the insert_wish_list_item_with_http_info variant
|
1986
|
+
|
1987
|
+
This returns an Array which contains the response data, status code and headers.
|
1988
|
+
|
1989
|
+
> <Array(<CustomerWishListItem>, Integer, Hash)> insert_wish_list_item_with_http_info(customer_profile_oid, wishlist_item)
|
1990
|
+
|
1991
|
+
```ruby
|
1992
|
+
begin
|
1993
|
+
# Insert a customer wishlist item
|
1994
|
+
data, status_code, headers = api_instance.insert_wish_list_item_with_http_info(customer_profile_oid, wishlist_item)
|
1995
|
+
p status_code # => 2xx
|
1996
|
+
p headers # => { ... }
|
1997
|
+
p data # => <CustomerWishListItem>
|
1998
|
+
rescue UltracartClient::ApiError => e
|
1999
|
+
puts "Error when calling CustomerApi->insert_wish_list_item_with_http_info: #{e}"
|
2000
|
+
end
|
2001
|
+
```
|
2002
|
+
|
2003
|
+
### Parameters
|
2004
|
+
|
2005
|
+
| Name | Type | Description | Notes |
|
2006
|
+
| ---- | ---- | ----------- | ----- |
|
2007
|
+
| **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
|
2008
|
+
| **wishlist_item** | [**CustomerWishListItem**](CustomerWishListItem.md) | Wishlist item to insert | |
|
2009
|
+
|
2010
|
+
### Return type
|
2011
|
+
|
2012
|
+
[**CustomerWishListItem**](CustomerWishListItem.md)
|
2013
|
+
|
2014
|
+
### Authorization
|
2015
|
+
|
2016
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2017
|
+
|
2018
|
+
### HTTP request headers
|
2019
|
+
|
2020
|
+
- **Content-Type**: application/json; charset=UTF-8
|
2021
|
+
- **Accept**: application/json
|
2022
|
+
|
2023
|
+
|
2024
|
+
## merge_customer
|
2025
|
+
|
2026
|
+
> merge_customer(customer_profile_oid, customer, opts)
|
2027
|
+
|
2028
|
+
Merge customer into this customer
|
2029
|
+
|
2030
|
+
Merge customer into this customer.
|
2031
|
+
|
2032
|
+
|
2033
|
+
### Examples
|
2034
|
+
|
2035
|
+
```ruby
|
2036
|
+
#!/usr/bin/env ruby
|
2037
|
+
|
2038
|
+
# Require necessary files
|
2039
|
+
require 'ultracart_api'
|
2040
|
+
require_relative '../constants'
|
2041
|
+
require_relative 'customer_functions'
|
2042
|
+
|
2043
|
+
# The merge function was requested by UltraCart merchants that sell software and manage activation keys.
|
2044
|
+
# Frequently, customers would purchase their software using one email address, and then accidentally
|
2045
|
+
# re-subscribe using a different email address (for example, they purchased subsequent years using
|
2046
|
+
# PayPal which was tied to their spouse's email).
|
2047
|
+
#
|
2048
|
+
# Merge combines the customer profiles, merging order history and software entitlements.
|
2049
|
+
# It may be used to combine any two customer profiles for any reason.
|
2050
|
+
#
|
2051
|
+
# Success returns back a status code 204 (No Content)
|
2052
|
+
|
2053
|
+
begin
|
2054
|
+
# First customer
|
2055
|
+
first_customer_oid = insert_sample_customer
|
2056
|
+
|
2057
|
+
# Second customer with a different email
|
2058
|
+
second_email = create_random_email
|
2059
|
+
second_customer_oid = insert_sample_customer(second_email)
|
2060
|
+
|
2061
|
+
# Create merge request
|
2062
|
+
merge_request = UltracartClient::CustomerMergeRequest.new(
|
2063
|
+
# Supply either the email or the customer oid. Only need one.
|
2064
|
+
email: second_email
|
2065
|
+
# Alternatively: customer_profile_oid: customer_oid
|
2066
|
+
)
|
2067
|
+
|
2068
|
+
# Initialize the customer API
|
2069
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
2070
|
+
|
2071
|
+
# Merge customers
|
2072
|
+
customer_api.merge_customer(first_customer_oid, merge_request)
|
2073
|
+
|
2074
|
+
# Clean up this sample
|
2075
|
+
delete_sample_customer(first_customer_oid)
|
2076
|
+
# Notice: No need to delete the second sample. The merge call deletes it.
|
2077
|
+
|
2078
|
+
rescue StandardError => e
|
2079
|
+
# Handle any exceptions that occur during the process
|
2080
|
+
puts 'An exception occurred. Please review the following error:'
|
2081
|
+
p e
|
2082
|
+
exit(1)
|
2083
|
+
end
|
2084
|
+
|
2085
|
+
# Ensure a carriage return at the end of the file
|
2086
|
+
```
|
2087
|
+
|
2088
|
+
|
2089
|
+
#### Using the merge_customer_with_http_info variant
|
2090
|
+
|
2091
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
2092
|
+
|
2093
|
+
> <Array(nil, Integer, Hash)> merge_customer_with_http_info(customer_profile_oid, customer, opts)
|
2094
|
+
|
2095
|
+
```ruby
|
2096
|
+
begin
|
2097
|
+
# Merge customer into this customer
|
2098
|
+
data, status_code, headers = api_instance.merge_customer_with_http_info(customer_profile_oid, customer, opts)
|
2099
|
+
p status_code # => 2xx
|
2100
|
+
p headers # => { ... }
|
2101
|
+
p data # => nil
|
2102
|
+
rescue UltracartClient::ApiError => e
|
2103
|
+
puts "Error when calling CustomerApi->merge_customer_with_http_info: #{e}"
|
2104
|
+
end
|
2105
|
+
```
|
2106
|
+
|
2107
|
+
### Parameters
|
2108
|
+
|
2109
|
+
| Name | Type | Description | Notes |
|
2110
|
+
| ---- | ---- | ----------- | ----- |
|
2111
|
+
| **customer_profile_oid** | **Integer** | The customer_profile_oid to update. | |
|
2112
|
+
| **customer** | [**CustomerMergeRequest**](CustomerMergeRequest.md) | Customer to merge into this profile. | |
|
2113
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
2114
|
+
|
2115
|
+
### Return type
|
2116
|
+
|
2117
|
+
nil (empty response body)
|
2118
|
+
|
2119
|
+
### Authorization
|
2120
|
+
|
2121
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2122
|
+
|
2123
|
+
### HTTP request headers
|
2124
|
+
|
2125
|
+
- **Content-Type**: application/json; charset=UTF-8
|
2126
|
+
- **Accept**: application/json
|
2127
|
+
|
2128
|
+
|
2129
|
+
## search_customer_profile_values
|
2130
|
+
|
2131
|
+
> <LookupResponse> search_customer_profile_values(lookup_request)
|
2132
|
+
|
2133
|
+
Searches for all matching values (using POST)
|
2134
|
+
|
2135
|
+
|
2136
|
+
### Examples
|
2137
|
+
|
2138
|
+
```ruby
|
2139
|
+
# This is an internal method used by our Customer management screen. It only searches customer tags and is geared
|
2140
|
+
# towards our UI needs, so it's inflexible. We're not including a sample for it because we don't envision it
|
2141
|
+
# being valuable to a merchant.
|
2142
|
+
# getCustomersByQuery is the merchant's search method. It is completely full-featured and easy to use.
|
2143
|
+
```
|
2144
|
+
|
2145
|
+
|
2146
|
+
#### Using the search_customer_profile_values_with_http_info variant
|
2147
|
+
|
2148
|
+
This returns an Array which contains the response data, status code and headers.
|
2149
|
+
|
2150
|
+
> <Array(<LookupResponse>, Integer, Hash)> search_customer_profile_values_with_http_info(lookup_request)
|
2151
|
+
|
2152
|
+
```ruby
|
2153
|
+
begin
|
2154
|
+
# Searches for all matching values (using POST)
|
2155
|
+
data, status_code, headers = api_instance.search_customer_profile_values_with_http_info(lookup_request)
|
2156
|
+
p status_code # => 2xx
|
2157
|
+
p headers # => { ... }
|
2158
|
+
p data # => <LookupResponse>
|
2159
|
+
rescue UltracartClient::ApiError => e
|
2160
|
+
puts "Error when calling CustomerApi->search_customer_profile_values_with_http_info: #{e}"
|
2161
|
+
end
|
2162
|
+
```
|
2163
|
+
|
2164
|
+
### Parameters
|
2165
|
+
|
2166
|
+
| Name | Type | Description | Notes |
|
2167
|
+
| ---- | ---- | ----------- | ----- |
|
2168
|
+
| **lookup_request** | [**LookupRequest**](LookupRequest.md) | LookupRequest | |
|
2169
|
+
|
2170
|
+
### Return type
|
2171
|
+
|
2172
|
+
[**LookupResponse**](LookupResponse.md)
|
2173
|
+
|
2174
|
+
### Authorization
|
2175
|
+
|
2176
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2177
|
+
|
2178
|
+
### HTTP request headers
|
2179
|
+
|
2180
|
+
- **Content-Type**: application/json
|
2181
|
+
- **Accept**: application/json
|
2182
|
+
|
2183
|
+
|
2184
|
+
## update_customer
|
2185
|
+
|
2186
|
+
> <CustomerResponse> update_customer(customer_profile_oid, customer, opts)
|
2187
|
+
|
2188
|
+
Update a customer
|
2189
|
+
|
2190
|
+
Update a customer on the UltraCart account.
|
2191
|
+
|
2192
|
+
|
2193
|
+
### Examples
|
2194
|
+
|
2195
|
+
```ruby
|
2196
|
+
require 'ultracart_api'
|
2197
|
+
require_relative '../constants'
|
2198
|
+
require_relative './customer_functions'
|
2199
|
+
|
2200
|
+
begin
|
2201
|
+
# Insert a sample customer
|
2202
|
+
customer_oid = insert_sample_customer()
|
2203
|
+
|
2204
|
+
# Initialize customer API
|
2205
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
2206
|
+
|
2207
|
+
# Just want address fields. See https://www.ultracart.com/api/#resource_customer.html for all expansion values
|
2208
|
+
opts = {
|
2209
|
+
'_expand' => "billing,shipping"
|
2210
|
+
}
|
2211
|
+
|
2212
|
+
# Retrieve customer with specified expansions
|
2213
|
+
customer = customer_api.get_customer(customer_oid, opts).customer
|
2214
|
+
|
2215
|
+
# TODO: do some edits to the customer. Here we will change some billing fields.
|
2216
|
+
customer.billing[0].address2 = 'Apartment 101'
|
2217
|
+
|
2218
|
+
# Notice expand is passed to update as well since it returns back an updated customer object.
|
2219
|
+
# We use the same expansion, so we get back the same fields and can do comparisons.
|
2220
|
+
api_response = customer_api.update_customer(customer_oid, customer, opts)
|
2221
|
+
|
2222
|
+
# Verify the update
|
2223
|
+
p api_response.customer
|
2224
|
+
|
2225
|
+
# Delete the sample customer
|
2226
|
+
delete_sample_customer(customer_oid)
|
2227
|
+
|
2228
|
+
rescue UltracartClient::ApiError => e
|
2229
|
+
puts 'An ApiException occurred. Please review the following error:'
|
2230
|
+
p e # <-- change_me: handle gracefully
|
2231
|
+
exit(1)
|
2232
|
+
end
|
2233
|
+
```
|
2234
|
+
|
2235
|
+
|
2236
|
+
#### Using the update_customer_with_http_info variant
|
2237
|
+
|
2238
|
+
This returns an Array which contains the response data, status code and headers.
|
2239
|
+
|
2240
|
+
> <Array(<CustomerResponse>, Integer, Hash)> update_customer_with_http_info(customer_profile_oid, customer, opts)
|
2241
|
+
|
2242
|
+
```ruby
|
2243
|
+
begin
|
2244
|
+
# Update a customer
|
2245
|
+
data, status_code, headers = api_instance.update_customer_with_http_info(customer_profile_oid, customer, opts)
|
2246
|
+
p status_code # => 2xx
|
2247
|
+
p headers # => { ... }
|
2248
|
+
p data # => <CustomerResponse>
|
2249
|
+
rescue UltracartClient::ApiError => e
|
2250
|
+
puts "Error when calling CustomerApi->update_customer_with_http_info: #{e}"
|
2251
|
+
end
|
2252
|
+
```
|
2253
|
+
|
2254
|
+
### Parameters
|
2255
|
+
|
2256
|
+
| Name | Type | Description | Notes |
|
2257
|
+
| ---- | ---- | ----------- | ----- |
|
2258
|
+
| **customer_profile_oid** | **Integer** | The customer_profile_oid to update. | |
|
2259
|
+
| **customer** | [**Customer**](Customer.md) | Customer to update | |
|
2260
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
2261
|
+
|
2262
|
+
### Return type
|
2263
|
+
|
2264
|
+
[**CustomerResponse**](CustomerResponse.md)
|
2265
|
+
|
2266
|
+
### Authorization
|
2267
|
+
|
2268
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2269
|
+
|
2270
|
+
### HTTP request headers
|
2271
|
+
|
2272
|
+
- **Content-Type**: application/json; charset=UTF-8
|
2273
|
+
- **Accept**: application/json
|
2274
|
+
|
2275
|
+
|
2276
|
+
## update_customer_email_lists
|
2277
|
+
|
2278
|
+
> <CustomerEmailListChanges> update_customer_email_lists(customer_profile_oid, list_changes)
|
2279
|
+
|
2280
|
+
Update email list subscriptions for a customer
|
2281
|
+
|
2282
|
+
Update email list subscriptions for a customer
|
2283
|
+
|
2284
|
+
|
2285
|
+
### Examples
|
2286
|
+
|
2287
|
+
```ruby
|
2288
|
+
# This is an internal method used by our Email workflow engines. It allows for updating the email lists a customer
|
2289
|
+
# is currently subscribed to. It's geared towards our UI needs, so its usage may appear cryptic.
|
2290
|
+
# We're not including a sample for it because we don't envision it being valuable to a merchant.
|
2291
|
+
```
|
2292
|
+
|
2293
|
+
|
2294
|
+
#### Using the update_customer_email_lists_with_http_info variant
|
2295
|
+
|
2296
|
+
This returns an Array which contains the response data, status code and headers.
|
2297
|
+
|
2298
|
+
> <Array(<CustomerEmailListChanges>, Integer, Hash)> update_customer_email_lists_with_http_info(customer_profile_oid, list_changes)
|
2299
|
+
|
2300
|
+
```ruby
|
2301
|
+
begin
|
2302
|
+
# Update email list subscriptions for a customer
|
2303
|
+
data, status_code, headers = api_instance.update_customer_email_lists_with_http_info(customer_profile_oid, list_changes)
|
2304
|
+
p status_code # => 2xx
|
2305
|
+
p headers # => { ... }
|
2306
|
+
p data # => <CustomerEmailListChanges>
|
2307
|
+
rescue UltracartClient::ApiError => e
|
2308
|
+
puts "Error when calling CustomerApi->update_customer_email_lists_with_http_info: #{e}"
|
2309
|
+
end
|
2310
|
+
```
|
2311
|
+
|
2312
|
+
### Parameters
|
2313
|
+
|
2314
|
+
| Name | Type | Description | Notes |
|
2315
|
+
| ---- | ---- | ----------- | ----- |
|
2316
|
+
| **customer_profile_oid** | **Integer** | The customer profile oid | |
|
2317
|
+
| **list_changes** | [**CustomerEmailListChanges**](CustomerEmailListChanges.md) | List changes | |
|
2318
|
+
|
2319
|
+
### Return type
|
2320
|
+
|
2321
|
+
[**CustomerEmailListChanges**](CustomerEmailListChanges.md)
|
2322
|
+
|
2323
|
+
### Authorization
|
2324
|
+
|
2325
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2326
|
+
|
2327
|
+
### HTTP request headers
|
2328
|
+
|
2329
|
+
- **Content-Type**: application/json; charset=UTF-8
|
2330
|
+
- **Accept**: application/json
|
2331
|
+
|
2332
|
+
|
2333
|
+
## update_wish_list_item
|
2334
|
+
|
2335
|
+
> <CustomerWishListItem> update_wish_list_item(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
|
2336
|
+
|
2337
|
+
Update a customer wishlist item
|
2338
|
+
|
2339
|
+
Update a customer wishlist item
|
2340
|
+
|
2341
|
+
|
2342
|
+
### Examples
|
2343
|
+
|
2344
|
+
```ruby
|
2345
|
+
#!/usr/bin/env ruby
|
2346
|
+
|
2347
|
+
# Require necessary files
|
2348
|
+
require 'ultracart_api'
|
2349
|
+
require_relative '../constants'
|
2350
|
+
require_relative 'customer_functions'
|
2351
|
+
require_relative '../item/item_functions'
|
2352
|
+
|
2353
|
+
# The wishlist methods allow management of a customer's wishlist.
|
2354
|
+
# This includes:
|
2355
|
+
# - deleteWishListItem
|
2356
|
+
# - getCustomerWishList
|
2357
|
+
# - getCustomerWishListItem
|
2358
|
+
# - insertWishListItem
|
2359
|
+
# - updateWishListItem
|
2360
|
+
# These methods provide a standard CRUD interface.
|
2361
|
+
#
|
2362
|
+
# You'll need merchant_item_oids to insert wishlist items. If you don't know the oids,
|
2363
|
+
# call ItemApi.getItemByMerchantItemId() to retrieve the item, then get item.merchant_item_oid
|
2364
|
+
#
|
2365
|
+
# Note: Priority of wishlist item, 3 being low priority and 5 is high priority.
|
2366
|
+
|
2367
|
+
begin
|
2368
|
+
# Initialize the customer API
|
2369
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
2370
|
+
|
2371
|
+
# Create a few items first
|
2372
|
+
first_item_oid = insert_sample_item_and_get_oid
|
2373
|
+
second_item_oid = insert_sample_item_and_get_oid
|
2374
|
+
|
2375
|
+
# Create a customer
|
2376
|
+
customer_oid = insert_sample_customer
|
2377
|
+
|
2378
|
+
# TODO: If you don't know the customer oid, use getCustomerByEmail() to retrieve the customer.
|
2379
|
+
|
2380
|
+
# Add some wish list items
|
2381
|
+
first_wish_item = UltracartClient::CustomerWishListItem.new(
|
2382
|
+
customer_profile_oid: customer_oid,
|
2383
|
+
merchant_item_oid: first_item_oid,
|
2384
|
+
comments: "I really want this for my birthday",
|
2385
|
+
priority: 3 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
2386
|
+
)
|
2387
|
+
first_created_wish_item = customer_api.insert_wish_list_item(customer_oid, first_wish_item)
|
2388
|
+
|
2389
|
+
second_wish_item = UltracartClient::CustomerWishListItem.new(
|
2390
|
+
customer_profile_oid: customer_oid,
|
2391
|
+
merchant_item_oid: second_item_oid,
|
2392
|
+
comments: "Christmas Idea!",
|
2393
|
+
priority: 5 # Priority of wishlist item, 3 being low priority and 5 is high priority
|
2394
|
+
)
|
2395
|
+
second_created_wish_item = customer_api.insert_wish_list_item(customer_oid, second_wish_item)
|
2396
|
+
|
2397
|
+
# Retrieve one wishlist item again
|
2398
|
+
first_created_wish_item_copy = customer_api.get_customer_wish_list_item(
|
2399
|
+
customer_oid,
|
2400
|
+
first_created_wish_item.customer_wishlist_item_oid
|
2401
|
+
).wishlist_item
|
2402
|
+
|
2403
|
+
# Retrieve all wishlist items
|
2404
|
+
all_wish_list_items = customer_api.get_customer_wish_list(customer_oid).wishlist_items
|
2405
|
+
|
2406
|
+
# Update an item
|
2407
|
+
second_created_wish_item.priority = 4
|
2408
|
+
updated_second_wish_item = customer_api.update_wish_list_item(
|
2409
|
+
customer_oid,
|
2410
|
+
second_created_wish_item.customer_wishlist_item_oid,
|
2411
|
+
second_created_wish_item
|
2412
|
+
)
|
2413
|
+
|
2414
|
+
# Delete a wish list item
|
2415
|
+
customer_api.delete_wish_list_item(
|
2416
|
+
customer_oid,
|
2417
|
+
first_created_wish_item.customer_wishlist_item_oid
|
2418
|
+
)
|
2419
|
+
|
2420
|
+
# Clean up
|
2421
|
+
delete_sample_customer(customer_oid)
|
2422
|
+
delete_sample_item_by_oid(first_item_oid)
|
2423
|
+
delete_sample_item_by_oid(second_item_oid)
|
2424
|
+
|
2425
|
+
rescue StandardError => e
|
2426
|
+
# Handle any exceptions that occur during the process
|
2427
|
+
puts 'An exception occurred. Please review the following error:'
|
2428
|
+
p e
|
2429
|
+
exit(1)
|
2430
|
+
end
|
2431
|
+
|
2432
|
+
# Ensure a carriage return at the end of the file
|
2433
|
+
```
|
2434
|
+
|
2435
|
+
|
2436
|
+
#### Using the update_wish_list_item_with_http_info variant
|
2437
|
+
|
2438
|
+
This returns an Array which contains the response data, status code and headers.
|
2439
|
+
|
2440
|
+
> <Array(<CustomerWishListItem>, Integer, Hash)> update_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
|
2441
|
+
|
2442
|
+
```ruby
|
2443
|
+
begin
|
2444
|
+
# Update a customer wishlist item
|
2445
|
+
data, status_code, headers = api_instance.update_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
|
2446
|
+
p status_code # => 2xx
|
2447
|
+
p headers # => { ... }
|
2448
|
+
p data # => <CustomerWishListItem>
|
2449
|
+
rescue UltracartClient::ApiError => e
|
2450
|
+
puts "Error when calling CustomerApi->update_wish_list_item_with_http_info: #{e}"
|
2451
|
+
end
|
2452
|
+
```
|
2453
|
+
|
2454
|
+
### Parameters
|
2455
|
+
|
2456
|
+
| Name | Type | Description | Notes |
|
2457
|
+
| ---- | ---- | ----------- | ----- |
|
2458
|
+
| **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
|
2459
|
+
| **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item. | |
|
2460
|
+
| **wishlist_item** | [**CustomerWishListItem**](CustomerWishListItem.md) | Wishlist item to update | |
|
2461
|
+
|
2462
|
+
### Return type
|
2463
|
+
|
2464
|
+
[**CustomerWishListItem**](CustomerWishListItem.md)
|
2465
|
+
|
2466
|
+
### Authorization
|
2467
|
+
|
2468
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2469
|
+
|
2470
|
+
### HTTP request headers
|
2471
|
+
|
2472
|
+
- **Content-Type**: application/json; charset=UTF-8
|
2473
|
+
- **Accept**: application/json
|
2474
|
+
|
2475
|
+
|
2476
|
+
## validate_email_verification_token
|
2477
|
+
|
2478
|
+
> <EmailVerifyTokenValidateResponse> validate_email_verification_token(validation_request)
|
2479
|
+
|
2480
|
+
Validate a token that can be used to verify a customer email address
|
2481
|
+
|
2482
|
+
Validate a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant.
|
2483
|
+
|
2484
|
+
|
2485
|
+
### Examples
|
2486
|
+
|
2487
|
+
```ruby
|
2488
|
+
require 'ultracart_api'
|
2489
|
+
require_relative '../constants'
|
2490
|
+
|
2491
|
+
=begin
|
2492
|
+
getEmailVerificationToken and validateEmailVerificationToken are tandem functions that allow a merchant to verify
|
2493
|
+
a customer's email address. getEmailVerificationToken returns back a token that the merchant can use however
|
2494
|
+
they wish to present to a customer. Usually this will be emailed to the customer within instructions to enter
|
2495
|
+
it back into a website. Once the customer enters the token back into a site (along with their email),
|
2496
|
+
validateEmailVerificationToken will validate the token.
|
2497
|
+
|
2498
|
+
Notice that getEmailVerificationToken requires both the email and password.
|
2499
|
+
=end
|
2500
|
+
|
2501
|
+
# Initialize the customer API
|
2502
|
+
customer_api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY)
|
2503
|
+
|
2504
|
+
# Set email and password
|
2505
|
+
email = "test@ultracart.com"
|
2506
|
+
password = "squirrel"
|
2507
|
+
|
2508
|
+
# Create token request
|
2509
|
+
token_request = UltracartClient::EmailVerifyTokenRequest.new(
|
2510
|
+
email: email,
|
2511
|
+
password: password
|
2512
|
+
)
|
2513
|
+
|
2514
|
+
# Get email verification token
|
2515
|
+
token_response = customer_api.get_email_verification_token(token_request)
|
2516
|
+
token = token_response.token
|
2517
|
+
|
2518
|
+
# TODO - email the token to the customer, have them enter it back into another page...
|
2519
|
+
# TODO - verify the token with the following call
|
2520
|
+
|
2521
|
+
# Create verify request
|
2522
|
+
verify_request = UltracartClient::EmailVerifyTokenValidateRequest.new(
|
2523
|
+
token: token
|
2524
|
+
)
|
2525
|
+
|
2526
|
+
# Validate email verification token
|
2527
|
+
verify_response = customer_api.validate_email_verification_token(verify_request)
|
2528
|
+
|
2529
|
+
# Print verification result
|
2530
|
+
puts "Was the correct token provided? #{verify_response.success}"
|
2531
|
+
```
|
2532
|
+
|
2533
|
+
|
2534
|
+
#### Using the validate_email_verification_token_with_http_info variant
|
2535
|
+
|
2536
|
+
This returns an Array which contains the response data, status code and headers.
|
2537
|
+
|
2538
|
+
> <Array(<EmailVerifyTokenValidateResponse>, Integer, Hash)> validate_email_verification_token_with_http_info(validation_request)
|
2539
|
+
|
2540
|
+
```ruby
|
2541
|
+
begin
|
2542
|
+
# Validate a token that can be used to verify a customer email address
|
2543
|
+
data, status_code, headers = api_instance.validate_email_verification_token_with_http_info(validation_request)
|
2544
|
+
p status_code # => 2xx
|
2545
|
+
p headers # => { ... }
|
2546
|
+
p data # => <EmailVerifyTokenValidateResponse>
|
2547
|
+
rescue UltracartClient::ApiError => e
|
2548
|
+
puts "Error when calling CustomerApi->validate_email_verification_token_with_http_info: #{e}"
|
2549
|
+
end
|
2550
|
+
```
|
2551
|
+
|
2552
|
+
### Parameters
|
2553
|
+
|
2554
|
+
| Name | Type | Description | Notes |
|
2555
|
+
| ---- | ---- | ----------- | ----- |
|
2556
|
+
| **validation_request** | [**EmailVerifyTokenValidateRequest**](EmailVerifyTokenValidateRequest.md) | Token validation request | |
|
2557
|
+
|
2558
|
+
### Return type
|
2559
|
+
|
2560
|
+
[**EmailVerifyTokenValidateResponse**](EmailVerifyTokenValidateResponse.md)
|
2561
|
+
|
2562
|
+
### Authorization
|
2563
|
+
|
2564
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
2565
|
+
|
2566
|
+
### HTTP request headers
|
2567
|
+
|
2568
|
+
- **Content-Type**: application/json
|
2569
|
+
- **Accept**: application/json
|
2570
|
+
|