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.
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
- ### Examples
42
-
43
- ```ruby
44
- require 'time'
45
- require 'ultracart_api'
46
- require 'json'
47
- require 'yaml'
48
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
49
-
50
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
51
- # As such, this might not be the best way to use this object.
52
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
53
-
54
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
55
- customer_profile_oid = 56 # Integer | The customer oid to credit.
56
- store_credit_request = UltracartClient::CustomerStoreCreditAddRequest.new # CustomerStoreCreditAddRequest | Store credit to add
57
-
58
- begin
59
- # Adds store credit to a customer
60
- result = api_instance.add_customer_store_credit(customer_profile_oid, store_credit_request)
61
- p result
62
- rescue UltracartClient::ApiError => e
63
- puts "Error when calling CustomerApi->add_customer_store_credit: #{e}"
64
- end
65
- ```
66
-
67
- #### Using the add_customer_store_credit_with_http_info variant
68
-
69
- This returns an Array which contains the response data, status code and headers.
70
-
71
- > <Array(<BaseResponse>, Integer, Hash)> add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request)
72
-
73
- ```ruby
74
- begin
75
- # Adds store credit to a customer
76
- data, status_code, headers = api_instance.add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request)
77
- p status_code # => 2xx
78
- p headers # => { ... }
79
- p data # => <BaseResponse>
80
- rescue UltracartClient::ApiError => e
81
- puts "Error when calling CustomerApi->add_customer_store_credit_with_http_info: #{e}"
82
- end
83
- ```
84
-
85
- ### Parameters
86
-
87
- | Name | Type | Description | Notes |
88
- | ---- | ---- | ----------- | ----- |
89
- | **customer_profile_oid** | **Integer** | The customer oid to credit. | |
90
- | **store_credit_request** | [**CustomerStoreCreditAddRequest**](CustomerStoreCreditAddRequest.md) | Store credit to add | |
91
-
92
- ### Return type
93
-
94
- [**BaseResponse**](BaseResponse.md)
95
-
96
- ### Authorization
97
-
98
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
99
-
100
- ### HTTP request headers
101
-
102
- - **Content-Type**: application/json; charset=UTF-8
103
- - **Accept**: application/json
104
-
105
-
106
- ## adjust_internal_certificate
107
-
108
- > <AdjustInternalCertificateResponse> adjust_internal_certificate(customer_profile_oid, adjust_internal_certificate_request)
109
-
110
- Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
111
-
112
- Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
113
-
114
- ### Examples
115
-
116
- ```ruby
117
- require 'time'
118
- require 'ultracart_api'
119
- require 'json'
120
- require 'yaml'
121
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
122
-
123
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
124
- # As such, this might not be the best way to use this object.
125
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
126
-
127
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
128
- customer_profile_oid = 56 # Integer | The customer profile oid
129
- adjust_internal_certificate_request = UltracartClient::AdjustInternalCertificateRequest.new # AdjustInternalCertificateRequest | adjustInternalCertificateRequest
130
-
131
- begin
132
- # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
133
- result = api_instance.adjust_internal_certificate(customer_profile_oid, adjust_internal_certificate_request)
134
- p result
135
- rescue UltracartClient::ApiError => e
136
- puts "Error when calling CustomerApi->adjust_internal_certificate: #{e}"
137
- end
138
- ```
139
-
140
- #### Using the adjust_internal_certificate_with_http_info variant
141
-
142
- This returns an Array which contains the response data, status code and headers.
143
-
144
- > <Array(<AdjustInternalCertificateResponse>, Integer, Hash)> adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request)
145
-
146
- ```ruby
147
- begin
148
- # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
149
- data, status_code, headers = api_instance.adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request)
150
- p status_code # => 2xx
151
- p headers # => { ... }
152
- p data # => <AdjustInternalCertificateResponse>
153
- rescue UltracartClient::ApiError => e
154
- puts "Error when calling CustomerApi->adjust_internal_certificate_with_http_info: #{e}"
155
- end
156
- ```
157
-
158
- ### Parameters
159
-
160
- | Name | Type | Description | Notes |
161
- | ---- | ---- | ----------- | ----- |
162
- | **customer_profile_oid** | **Integer** | The customer profile oid | |
163
- | **adjust_internal_certificate_request** | [**AdjustInternalCertificateRequest**](AdjustInternalCertificateRequest.md) | adjustInternalCertificateRequest | |
164
-
165
- ### Return type
166
-
167
- [**AdjustInternalCertificateResponse**](AdjustInternalCertificateResponse.md)
168
-
169
- ### Authorization
170
-
171
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
172
-
173
- ### HTTP request headers
174
-
175
- - **Content-Type**: application/json; charset=UTF-8
176
- - **Accept**: application/json
177
-
178
-
179
- ## delete_customer
180
-
181
- > delete_customer(customer_profile_oid)
182
-
183
- Delete a customer
184
-
185
- Delete a customer on the UltraCart account.
186
-
187
- ### Examples
188
-
189
- ```ruby
190
- require 'time'
191
- require 'ultracart_api'
192
- require 'json'
193
- require 'yaml'
194
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
195
-
196
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
197
- # As such, this might not be the best way to use this object.
198
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
199
-
200
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
201
- customer_profile_oid = 56 # Integer | The customer_profile_oid to delete.
202
-
203
- begin
204
- # Delete a customer
205
- api_instance.delete_customer(customer_profile_oid)
206
- rescue UltracartClient::ApiError => e
207
- puts "Error when calling CustomerApi->delete_customer: #{e}"
208
- end
209
- ```
210
-
211
- #### Using the delete_customer_with_http_info variant
212
-
213
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
214
-
215
- > <Array(nil, Integer, Hash)> delete_customer_with_http_info(customer_profile_oid)
216
-
217
- ```ruby
218
- begin
219
- # Delete a customer
220
- data, status_code, headers = api_instance.delete_customer_with_http_info(customer_profile_oid)
221
- p status_code # => 2xx
222
- p headers # => { ... }
223
- p data # => nil
224
- rescue UltracartClient::ApiError => e
225
- puts "Error when calling CustomerApi->delete_customer_with_http_info: #{e}"
226
- end
227
- ```
228
-
229
- ### Parameters
230
-
231
- | Name | Type | Description | Notes |
232
- | ---- | ---- | ----------- | ----- |
233
- | **customer_profile_oid** | **Integer** | The customer_profile_oid to delete. | |
234
-
235
- ### Return type
236
-
237
- nil (empty response body)
238
-
239
- ### Authorization
240
-
241
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
242
-
243
- ### HTTP request headers
244
-
245
- - **Content-Type**: Not defined
246
- - **Accept**: application/json
247
-
248
-
249
- ## delete_wish_list_item
250
-
251
- > <CustomerWishListItem> delete_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
252
-
253
- Delete a customer wishlist item
254
-
255
- Delete a customer wishlist item
256
-
257
- ### Examples
258
-
259
- ```ruby
260
- require 'time'
261
- require 'ultracart_api'
262
- require 'json'
263
- require 'yaml'
264
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
265
-
266
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
267
- # As such, this might not be the best way to use this object.
268
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
269
-
270
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
271
- customer_profile_oid = 56 # Integer | The customer oid for this wishlist.
272
- customer_wishlist_item_oid = 56 # Integer | The wishlist oid for this wishlist item to delete.
273
-
274
- begin
275
- # Delete a customer wishlist item
276
- result = api_instance.delete_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
277
- p result
278
- rescue UltracartClient::ApiError => e
279
- puts "Error when calling CustomerApi->delete_wish_list_item: #{e}"
280
- end
281
- ```
282
-
283
- #### Using the delete_wish_list_item_with_http_info variant
284
-
285
- This returns an Array which contains the response data, status code and headers.
286
-
287
- > <Array(<CustomerWishListItem>, Integer, Hash)> delete_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
288
-
289
- ```ruby
290
- begin
291
- # Delete a customer wishlist item
292
- data, status_code, headers = api_instance.delete_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
293
- p status_code # => 2xx
294
- p headers # => { ... }
295
- p data # => <CustomerWishListItem>
296
- rescue UltracartClient::ApiError => e
297
- puts "Error when calling CustomerApi->delete_wish_list_item_with_http_info: #{e}"
298
- end
299
- ```
300
-
301
- ### Parameters
302
-
303
- | Name | Type | Description | Notes |
304
- | ---- | ---- | ----------- | ----- |
305
- | **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
306
- | **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item to delete. | |
307
-
308
- ### Return type
309
-
310
- [**CustomerWishListItem**](CustomerWishListItem.md)
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
- ## get_customer
323
-
324
- > <CustomerResponse> get_customer(customer_profile_oid, opts)
325
-
326
- Retrieve a customer
327
-
328
- Retrieves a single customer using the specified customer profile oid.
329
-
330
- ### Examples
331
-
332
- ```ruby
333
- require 'time'
334
- require 'ultracart_api'
335
- require 'json'
336
- require 'yaml'
337
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
338
-
339
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
340
- # As such, this might not be the best way to use this object.
341
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
342
-
343
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
344
- customer_profile_oid = 56 # Integer | The customer oid to retrieve.
345
- opts = {
346
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
347
- }
348
-
349
- begin
350
- # Retrieve a customer
351
- result = api_instance.get_customer(customer_profile_oid, opts)
352
- p result
353
- rescue UltracartClient::ApiError => e
354
- puts "Error when calling CustomerApi->get_customer: #{e}"
355
- end
356
- ```
357
-
358
- #### Using the get_customer_with_http_info variant
359
-
360
- This returns an Array which contains the response data, status code and headers.
361
-
362
- > <Array(<CustomerResponse>, Integer, Hash)> get_customer_with_http_info(customer_profile_oid, opts)
363
-
364
- ```ruby
365
- begin
366
- # Retrieve a customer
367
- data, status_code, headers = api_instance.get_customer_with_http_info(customer_profile_oid, opts)
368
- p status_code # => 2xx
369
- p headers # => { ... }
370
- p data # => <CustomerResponse>
371
- rescue UltracartClient::ApiError => e
372
- puts "Error when calling CustomerApi->get_customer_with_http_info: #{e}"
373
- end
374
- ```
375
-
376
- ### Parameters
377
-
378
- | Name | Type | Description | Notes |
379
- | ---- | ---- | ----------- | ----- |
380
- | **customer_profile_oid** | **Integer** | The customer oid to retrieve. | |
381
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
382
-
383
- ### Return type
384
-
385
- [**CustomerResponse**](CustomerResponse.md)
386
-
387
- ### Authorization
388
-
389
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
390
-
391
- ### HTTP request headers
392
-
393
- - **Content-Type**: Not defined
394
- - **Accept**: application/json
395
-
396
-
397
- ## get_customer_by_email
398
-
399
- > <CustomerResponse> get_customer_by_email(email, opts)
400
-
401
- Retrieve a customer by Email
402
-
403
- Retrieves a single customer using the specified customer email address.
404
-
405
- ### Examples
406
-
407
- ```ruby
408
- require 'time'
409
- require 'ultracart_api'
410
- require 'json'
411
- require 'yaml'
412
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
413
-
414
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
415
- # As such, this might not be the best way to use this object.
416
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
417
-
418
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
419
- email = 'email_example' # String | The email address of the customer to retrieve.
420
- opts = {
421
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
422
- }
423
-
424
- begin
425
- # Retrieve a customer by Email
426
- result = api_instance.get_customer_by_email(email, opts)
427
- p result
428
- rescue UltracartClient::ApiError => e
429
- puts "Error when calling CustomerApi->get_customer_by_email: #{e}"
430
- end
431
- ```
432
-
433
- #### Using the get_customer_by_email_with_http_info variant
434
-
435
- This returns an Array which contains the response data, status code and headers.
436
-
437
- > <Array(<CustomerResponse>, Integer, Hash)> get_customer_by_email_with_http_info(email, opts)
438
-
439
- ```ruby
440
- begin
441
- # Retrieve a customer by Email
442
- data, status_code, headers = api_instance.get_customer_by_email_with_http_info(email, opts)
443
- p status_code # => 2xx
444
- p headers # => { ... }
445
- p data # => <CustomerResponse>
446
- rescue UltracartClient::ApiError => e
447
- puts "Error when calling CustomerApi->get_customer_by_email_with_http_info: #{e}"
448
- end
449
- ```
450
-
451
- ### Parameters
452
-
453
- | Name | Type | Description | Notes |
454
- | ---- | ---- | ----------- | ----- |
455
- | **email** | **String** | The email address of the customer to retrieve. | |
456
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
457
-
458
- ### Return type
459
-
460
- [**CustomerResponse**](CustomerResponse.md)
461
-
462
- ### Authorization
463
-
464
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
465
-
466
- ### HTTP request headers
467
-
468
- - **Content-Type**: Not defined
469
- - **Accept**: application/json
470
-
471
-
472
- ## get_customer_editor_values
473
-
474
- > <CustomerEditorValues> get_customer_editor_values
475
-
476
- Retrieve values needed for a customer profile editor
477
-
478
- Retrieve values needed for a customer profile editor.
479
-
480
- ### Examples
481
-
482
- ```ruby
483
- require 'time'
484
- require 'ultracart_api'
485
- require 'json'
486
- require 'yaml'
487
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
488
-
489
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
490
- # As such, this might not be the best way to use this object.
491
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
492
-
493
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
494
-
495
- begin
496
- # Retrieve values needed for a customer profile editor
497
- result = api_instance.get_customer_editor_values
498
- p result
499
- rescue UltracartClient::ApiError => e
500
- puts "Error when calling CustomerApi->get_customer_editor_values: #{e}"
501
- end
502
- ```
503
-
504
- #### Using the get_customer_editor_values_with_http_info variant
505
-
506
- This returns an Array which contains the response data, status code and headers.
507
-
508
- > <Array(<CustomerEditorValues>, Integer, Hash)> get_customer_editor_values_with_http_info
509
-
510
- ```ruby
511
- begin
512
- # Retrieve values needed for a customer profile editor
513
- data, status_code, headers = api_instance.get_customer_editor_values_with_http_info
514
- p status_code # => 2xx
515
- p headers # => { ... }
516
- p data # => <CustomerEditorValues>
517
- rescue UltracartClient::ApiError => e
518
- puts "Error when calling CustomerApi->get_customer_editor_values_with_http_info: #{e}"
519
- end
520
- ```
521
-
522
- ### Parameters
523
-
524
- This endpoint does not need any parameter.
525
-
526
- ### Return type
527
-
528
- [**CustomerEditorValues**](CustomerEditorValues.md)
529
-
530
- ### Authorization
531
-
532
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
533
-
534
- ### HTTP request headers
535
-
536
- - **Content-Type**: Not defined
537
- - **Accept**: application/json
538
-
539
-
540
- ## get_customer_email_lists
541
-
542
- > <EmailListsResponse> get_customer_email_lists
543
-
544
- Retrieve all email lists across all storefronts
545
-
546
- Retrieve all email lists across all storefronts
547
-
548
- ### Examples
549
-
550
- ```ruby
551
- require 'time'
552
- require 'ultracart_api'
553
- require 'json'
554
- require 'yaml'
555
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
556
-
557
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
558
- # As such, this might not be the best way to use this object.
559
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
560
-
561
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
562
-
563
- begin
564
- # Retrieve all email lists across all storefronts
565
- result = api_instance.get_customer_email_lists
566
- p result
567
- rescue UltracartClient::ApiError => e
568
- puts "Error when calling CustomerApi->get_customer_email_lists: #{e}"
569
- end
570
- ```
571
-
572
- #### Using the get_customer_email_lists_with_http_info variant
573
-
574
- This returns an Array which contains the response data, status code and headers.
575
-
576
- > <Array(<EmailListsResponse>, Integer, Hash)> get_customer_email_lists_with_http_info
577
-
578
- ```ruby
579
- begin
580
- # Retrieve all email lists across all storefronts
581
- data, status_code, headers = api_instance.get_customer_email_lists_with_http_info
582
- p status_code # => 2xx
583
- p headers # => { ... }
584
- p data # => <EmailListsResponse>
585
- rescue UltracartClient::ApiError => e
586
- puts "Error when calling CustomerApi->get_customer_email_lists_with_http_info: #{e}"
587
- end
588
- ```
589
-
590
- ### Parameters
591
-
592
- This endpoint does not need any parameter.
593
-
594
- ### Return type
595
-
596
- [**EmailListsResponse**](EmailListsResponse.md)
597
-
598
- ### Authorization
599
-
600
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
601
-
602
- ### HTTP request headers
603
-
604
- - **Content-Type**: Not defined
605
- - **Accept**: application/json
606
-
607
-
608
- ## get_customer_store_credit
609
-
610
- > <CustomerStoreCreditResponse> get_customer_store_credit(customer_profile_oid)
611
-
612
- Retrieve the customer store credit accumulated through loyalty programs
613
-
614
- Retrieve the customer store credit accumulated through loyalty programs
615
-
616
- ### Examples
617
-
618
- ```ruby
619
- require 'time'
620
- require 'ultracart_api'
621
- require 'json'
622
- require 'yaml'
623
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
624
-
625
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
626
- # As such, this might not be the best way to use this object.
627
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
628
-
629
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
630
- customer_profile_oid = 56 # Integer | The customer oid to retrieve.
631
-
632
- begin
633
- # Retrieve the customer store credit accumulated through loyalty programs
634
- result = api_instance.get_customer_store_credit(customer_profile_oid)
635
- p result
636
- rescue UltracartClient::ApiError => e
637
- puts "Error when calling CustomerApi->get_customer_store_credit: #{e}"
638
- end
639
- ```
640
-
641
- #### Using the get_customer_store_credit_with_http_info variant
642
-
643
- This returns an Array which contains the response data, status code and headers.
644
-
645
- > <Array(<CustomerStoreCreditResponse>, Integer, Hash)> get_customer_store_credit_with_http_info(customer_profile_oid)
646
-
647
- ```ruby
648
- begin
649
- # Retrieve the customer store credit accumulated through loyalty programs
650
- data, status_code, headers = api_instance.get_customer_store_credit_with_http_info(customer_profile_oid)
651
- p status_code # => 2xx
652
- p headers # => { ... }
653
- p data # => <CustomerStoreCreditResponse>
654
- rescue UltracartClient::ApiError => e
655
- puts "Error when calling CustomerApi->get_customer_store_credit_with_http_info: #{e}"
656
- end
657
- ```
658
-
659
- ### Parameters
660
-
661
- | Name | Type | Description | Notes |
662
- | ---- | ---- | ----------- | ----- |
663
- | **customer_profile_oid** | **Integer** | The customer oid to retrieve. | |
664
-
665
- ### Return type
666
-
667
- [**CustomerStoreCreditResponse**](CustomerStoreCreditResponse.md)
668
-
669
- ### Authorization
670
-
671
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
672
-
673
- ### HTTP request headers
674
-
675
- - **Content-Type**: Not defined
676
- - **Accept**: application/json
677
-
678
-
679
- ## get_customer_wish_list
680
-
681
- > <CustomerWishListItemsResponse> get_customer_wish_list(customer_profile_oid)
682
-
683
- Retrieve wishlist items for customer
684
-
685
- Retrieve wishlist items for customer.
686
-
687
- ### Examples
688
-
689
- ```ruby
690
- require 'time'
691
- require 'ultracart_api'
692
- require 'json'
693
- require 'yaml'
694
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
695
-
696
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
697
- # As such, this might not be the best way to use this object.
698
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
699
-
700
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
701
- customer_profile_oid = 56 # Integer | The customer oid for this wishlist.
702
-
703
- begin
704
- # Retrieve wishlist items for customer
705
- result = api_instance.get_customer_wish_list(customer_profile_oid)
706
- p result
707
- rescue UltracartClient::ApiError => e
708
- puts "Error when calling CustomerApi->get_customer_wish_list: #{e}"
709
- end
710
- ```
711
-
712
- #### Using the get_customer_wish_list_with_http_info variant
713
-
714
- This returns an Array which contains the response data, status code and headers.
715
-
716
- > <Array(<CustomerWishListItemsResponse>, Integer, Hash)> get_customer_wish_list_with_http_info(customer_profile_oid)
717
-
718
- ```ruby
719
- begin
720
- # Retrieve wishlist items for customer
721
- data, status_code, headers = api_instance.get_customer_wish_list_with_http_info(customer_profile_oid)
722
- p status_code # => 2xx
723
- p headers # => { ... }
724
- p data # => <CustomerWishListItemsResponse>
725
- rescue UltracartClient::ApiError => e
726
- puts "Error when calling CustomerApi->get_customer_wish_list_with_http_info: #{e}"
727
- end
728
- ```
729
-
730
- ### Parameters
731
-
732
- | Name | Type | Description | Notes |
733
- | ---- | ---- | ----------- | ----- |
734
- | **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
735
-
736
- ### Return type
737
-
738
- [**CustomerWishListItemsResponse**](CustomerWishListItemsResponse.md)
739
-
740
- ### Authorization
741
-
742
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
743
-
744
- ### HTTP request headers
745
-
746
- - **Content-Type**: Not defined
747
- - **Accept**: application/json
748
-
749
-
750
- ## get_customer_wish_list_item
751
-
752
- > <CustomerWishListItemResponse> get_customer_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
753
-
754
- Retrieve wishlist item for customer
755
-
756
- Retrieve wishlist item for customer.
757
-
758
- ### Examples
759
-
760
- ```ruby
761
- require 'time'
762
- require 'ultracart_api'
763
- require 'json'
764
- require 'yaml'
765
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
766
-
767
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
768
- # As such, this might not be the best way to use this object.
769
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
770
-
771
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
772
- customer_profile_oid = 56 # Integer | The customer oid for this wishlist.
773
- customer_wishlist_item_oid = 56 # Integer | The wishlist oid for this wishlist item.
774
-
775
- begin
776
- # Retrieve wishlist item for customer
777
- result = api_instance.get_customer_wish_list_item(customer_profile_oid, customer_wishlist_item_oid)
778
- p result
779
- rescue UltracartClient::ApiError => e
780
- puts "Error when calling CustomerApi->get_customer_wish_list_item: #{e}"
781
- end
782
- ```
783
-
784
- #### Using the get_customer_wish_list_item_with_http_info variant
785
-
786
- This returns an Array which contains the response data, status code and headers.
787
-
788
- > <Array(<CustomerWishListItemResponse>, Integer, Hash)> get_customer_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
789
-
790
- ```ruby
791
- begin
792
- # Retrieve wishlist item for customer
793
- data, status_code, headers = api_instance.get_customer_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid)
794
- p status_code # => 2xx
795
- p headers # => { ... }
796
- p data # => <CustomerWishListItemResponse>
797
- rescue UltracartClient::ApiError => e
798
- puts "Error when calling CustomerApi->get_customer_wish_list_item_with_http_info: #{e}"
799
- end
800
- ```
801
-
802
- ### Parameters
803
-
804
- | Name | Type | Description | Notes |
805
- | ---- | ---- | ----------- | ----- |
806
- | **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
807
- | **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item. | |
808
-
809
- ### Return type
810
-
811
- [**CustomerWishListItemResponse**](CustomerWishListItemResponse.md)
812
-
813
- ### Authorization
814
-
815
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
816
-
817
- ### HTTP request headers
818
-
819
- - **Content-Type**: Not defined
820
- - **Accept**: application/json
821
-
822
-
823
- ## get_customers
824
-
825
- > <CustomersResponse> get_customers(opts)
826
-
827
- Retrieve customers
828
-
829
- 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.
830
-
831
- ### Examples
832
-
833
- ```ruby
834
- require 'time'
835
- require 'ultracart_api'
836
- require 'json'
837
- require 'yaml'
838
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
839
-
840
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
841
- # As such, this might not be the best way to use this object.
842
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
843
-
844
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
845
- opts = {
846
- email: 'email_example', # String | Email
847
- qb_class: 'qb_class_example', # String | Quickbooks class
848
- quickbooks_code: 'quickbooks_code_example', # String | Quickbooks code
849
- last_modified_dts_start: 'last_modified_dts_start_example', # String | Last modified date start
850
- last_modified_dts_end: 'last_modified_dts_end_example', # String | Last modified date end
851
- signup_dts_start: 'signup_dts_start_example', # String | Signup date start
852
- signup_dts_end: 'signup_dts_end_example', # String | Signup date end
853
- billing_first_name: 'billing_first_name_example', # String | Billing first name
854
- billing_last_name: 'billing_last_name_example', # String | Billing last name
855
- billing_company: 'billing_company_example', # String | Billing company
856
- billing_city: 'billing_city_example', # String | Billing city
857
- billing_state: 'billing_state_example', # String | Billing state
858
- billing_postal_code: 'billing_postal_code_example', # String | Billing postal code
859
- billing_country_code: 'billing_country_code_example', # String | Billing country code
860
- billing_day_phone: 'billing_day_phone_example', # String | Billing day phone
861
- billing_evening_phone: 'billing_evening_phone_example', # String | Billing evening phone
862
- shipping_first_name: 'shipping_first_name_example', # String | Shipping first name
863
- shipping_last_name: 'shipping_last_name_example', # String | Shipping last name
864
- shipping_company: 'shipping_company_example', # String | Shipping company
865
- shipping_city: 'shipping_city_example', # String | Shipping city
866
- shipping_state: 'shipping_state_example', # String | Shipping state
867
- shipping_postal_code: 'shipping_postal_code_example', # String | Shipping postal code
868
- shipping_country_code: 'shipping_country_code_example', # String | Shipping country code
869
- shipping_day_phone: 'shipping_day_phone_example', # String | Shipping day phone
870
- shipping_evening_phone: 'shipping_evening_phone_example', # String | Shipping evening phone
871
- pricing_tier_oid: 56, # Integer | Pricing tier oid
872
- pricing_tier_name: 'pricing_tier_name_example', # String | Pricing tier name
873
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Max 200)
874
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
875
- _since: '_since_example', # String | Fetch customers that have been created/modified since this date/time.
876
- _sort: '_sort_example', # String | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
877
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
878
- }
879
-
880
- begin
881
- # Retrieve customers
882
- result = api_instance.get_customers(opts)
883
- p result
884
- rescue UltracartClient::ApiError => e
885
- puts "Error when calling CustomerApi->get_customers: #{e}"
886
- end
887
- ```
888
-
889
- #### Using the get_customers_with_http_info variant
890
-
891
- This returns an Array which contains the response data, status code and headers.
892
-
893
- > <Array(<CustomersResponse>, Integer, Hash)> get_customers_with_http_info(opts)
894
-
895
- ```ruby
896
- begin
897
- # Retrieve customers
898
- data, status_code, headers = api_instance.get_customers_with_http_info(opts)
899
- p status_code # => 2xx
900
- p headers # => { ... }
901
- p data # => <CustomersResponse>
902
- rescue UltracartClient::ApiError => e
903
- puts "Error when calling CustomerApi->get_customers_with_http_info: #{e}"
904
- end
905
- ```
906
-
907
- ### Parameters
908
-
909
- | Name | Type | Description | Notes |
910
- | ---- | ---- | ----------- | ----- |
911
- | **email** | **String** | Email | [optional] |
912
- | **qb_class** | **String** | Quickbooks class | [optional] |
913
- | **quickbooks_code** | **String** | Quickbooks code | [optional] |
914
- | **last_modified_dts_start** | **String** | Last modified date start | [optional] |
915
- | **last_modified_dts_end** | **String** | Last modified date end | [optional] |
916
- | **signup_dts_start** | **String** | Signup date start | [optional] |
917
- | **signup_dts_end** | **String** | Signup date end | [optional] |
918
- | **billing_first_name** | **String** | Billing first name | [optional] |
919
- | **billing_last_name** | **String** | Billing last name | [optional] |
920
- | **billing_company** | **String** | Billing company | [optional] |
921
- | **billing_city** | **String** | Billing city | [optional] |
922
- | **billing_state** | **String** | Billing state | [optional] |
923
- | **billing_postal_code** | **String** | Billing postal code | [optional] |
924
- | **billing_country_code** | **String** | Billing country code | [optional] |
925
- | **billing_day_phone** | **String** | Billing day phone | [optional] |
926
- | **billing_evening_phone** | **String** | Billing evening phone | [optional] |
927
- | **shipping_first_name** | **String** | Shipping first name | [optional] |
928
- | **shipping_last_name** | **String** | Shipping last name | [optional] |
929
- | **shipping_company** | **String** | Shipping company | [optional] |
930
- | **shipping_city** | **String** | Shipping city | [optional] |
931
- | **shipping_state** | **String** | Shipping state | [optional] |
932
- | **shipping_postal_code** | **String** | Shipping postal code | [optional] |
933
- | **shipping_country_code** | **String** | Shipping country code | [optional] |
934
- | **shipping_day_phone** | **String** | Shipping day phone | [optional] |
935
- | **shipping_evening_phone** | **String** | Shipping evening phone | [optional] |
936
- | **pricing_tier_oid** | **Integer** | Pricing tier oid | [optional] |
937
- | **pricing_tier_name** | **String** | Pricing tier name | [optional] |
938
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
939
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
940
- | **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
941
- | **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
942
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
943
-
944
- ### Return type
945
-
946
- [**CustomersResponse**](CustomersResponse.md)
947
-
948
- ### Authorization
949
-
950
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
951
-
952
- ### HTTP request headers
953
-
954
- - **Content-Type**: Not defined
955
- - **Accept**: application/json
956
-
957
-
958
- ## get_customers_by_query
959
-
960
- > <CustomersResponse> get_customers_by_query(customer_query, opts)
961
-
962
- Retrieve customers by query
963
-
964
- 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.
965
-
966
- ### Examples
967
-
968
- ```ruby
969
- require 'time'
970
- require 'ultracart_api'
971
- require 'json'
972
- require 'yaml'
973
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
974
-
975
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
976
- # As such, this might not be the best way to use this object.
977
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
978
-
979
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
980
- customer_query = UltracartClient::CustomerQuery.new # CustomerQuery | Customer query
981
- opts = {
982
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Max 200)
983
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
984
- _since: '_since_example', # String | Fetch customers that have been created/modified since this date/time.
985
- _sort: '_sort_example', # String | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
986
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
987
- }
988
-
989
- begin
990
- # Retrieve customers by query
991
- result = api_instance.get_customers_by_query(customer_query, opts)
992
- p result
993
- rescue UltracartClient::ApiError => e
994
- puts "Error when calling CustomerApi->get_customers_by_query: #{e}"
995
- end
996
- ```
997
-
998
- #### Using the get_customers_by_query_with_http_info variant
999
-
1000
- This returns an Array which contains the response data, status code and headers.
1001
-
1002
- > <Array(<CustomersResponse>, Integer, Hash)> get_customers_by_query_with_http_info(customer_query, opts)
1003
-
1004
- ```ruby
1005
- begin
1006
- # Retrieve customers by query
1007
- data, status_code, headers = api_instance.get_customers_by_query_with_http_info(customer_query, opts)
1008
- p status_code # => 2xx
1009
- p headers # => { ... }
1010
- p data # => <CustomersResponse>
1011
- rescue UltracartClient::ApiError => e
1012
- puts "Error when calling CustomerApi->get_customers_by_query_with_http_info: #{e}"
1013
- end
1014
- ```
1015
-
1016
- ### Parameters
1017
-
1018
- | Name | Type | Description | Notes |
1019
- | ---- | ---- | ----------- | ----- |
1020
- | **customer_query** | [**CustomerQuery**](CustomerQuery.md) | Customer query | |
1021
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
1022
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
1023
- | **_since** | **String** | Fetch customers that have been created/modified since this date/time. | [optional] |
1024
- | **_sort** | **String** | The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
1025
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1026
-
1027
- ### Return type
1028
-
1029
- [**CustomersResponse**](CustomersResponse.md)
1030
-
1031
- ### Authorization
1032
-
1033
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1034
-
1035
- ### HTTP request headers
1036
-
1037
- - **Content-Type**: application/json
1038
- - **Accept**: application/json
1039
-
1040
-
1041
- ## get_customers_for_data_tables
1042
-
1043
- > <DataTablesServerSideResponse> get_customers_for_data_tables(opts)
1044
-
1045
- Retrieve customers for DataTables plugin
1046
-
1047
- Retrieves customers from the account. If no searches are specified, all customers will be returned.
1048
-
1049
- ### Examples
1050
-
1051
- ```ruby
1052
- require 'time'
1053
- require 'ultracart_api'
1054
- require 'json'
1055
- require 'yaml'
1056
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1057
-
1058
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1059
- # As such, this might not be the best way to use this object.
1060
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1061
-
1062
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1063
- opts = {
1064
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
1065
- }
1066
-
1067
- begin
1068
- # Retrieve customers for DataTables plugin
1069
- result = api_instance.get_customers_for_data_tables(opts)
1070
- p result
1071
- rescue UltracartClient::ApiError => e
1072
- puts "Error when calling CustomerApi->get_customers_for_data_tables: #{e}"
1073
- end
1074
- ```
1075
-
1076
- #### Using the get_customers_for_data_tables_with_http_info variant
1077
-
1078
- This returns an Array which contains the response data, status code and headers.
1079
-
1080
- > <Array(<DataTablesServerSideResponse>, Integer, Hash)> get_customers_for_data_tables_with_http_info(opts)
1081
-
1082
- ```ruby
1083
- begin
1084
- # Retrieve customers for DataTables plugin
1085
- data, status_code, headers = api_instance.get_customers_for_data_tables_with_http_info(opts)
1086
- p status_code # => 2xx
1087
- p headers # => { ... }
1088
- p data # => <DataTablesServerSideResponse>
1089
- rescue UltracartClient::ApiError => e
1090
- puts "Error when calling CustomerApi->get_customers_for_data_tables_with_http_info: #{e}"
1091
- end
1092
- ```
1093
-
1094
- ### Parameters
1095
-
1096
- | Name | Type | Description | Notes |
1097
- | ---- | ---- | ----------- | ----- |
1098
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1099
-
1100
- ### Return type
1101
-
1102
- [**DataTablesServerSideResponse**](DataTablesServerSideResponse.md)
1103
-
1104
- ### Authorization
1105
-
1106
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1107
-
1108
- ### HTTP request headers
1109
-
1110
- - **Content-Type**: Not defined
1111
- - **Accept**: application/json
1112
-
1113
-
1114
- ## get_email_verification_token
1115
-
1116
- > <EmailVerifyTokenResponse> get_email_verification_token(token_request)
1117
-
1118
- Create a token that can be used to verify a customer email address
1119
-
1120
- 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.
1121
-
1122
- ### Examples
1123
-
1124
- ```ruby
1125
- require 'time'
1126
- require 'ultracart_api'
1127
- require 'json'
1128
- require 'yaml'
1129
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1130
-
1131
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1132
- # As such, this might not be the best way to use this object.
1133
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1134
-
1135
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1136
- token_request = UltracartClient::EmailVerifyTokenRequest.new # EmailVerifyTokenRequest | Token request
1137
-
1138
- begin
1139
- # Create a token that can be used to verify a customer email address
1140
- result = api_instance.get_email_verification_token(token_request)
1141
- p result
1142
- rescue UltracartClient::ApiError => e
1143
- puts "Error when calling CustomerApi->get_email_verification_token: #{e}"
1144
- end
1145
- ```
1146
-
1147
- #### Using the get_email_verification_token_with_http_info variant
1148
-
1149
- This returns an Array which contains the response data, status code and headers.
1150
-
1151
- > <Array(<EmailVerifyTokenResponse>, Integer, Hash)> get_email_verification_token_with_http_info(token_request)
1152
-
1153
- ```ruby
1154
- begin
1155
- # Create a token that can be used to verify a customer email address
1156
- data, status_code, headers = api_instance.get_email_verification_token_with_http_info(token_request)
1157
- p status_code # => 2xx
1158
- p headers # => { ... }
1159
- p data # => <EmailVerifyTokenResponse>
1160
- rescue UltracartClient::ApiError => e
1161
- puts "Error when calling CustomerApi->get_email_verification_token_with_http_info: #{e}"
1162
- end
1163
- ```
1164
-
1165
- ### Parameters
1166
-
1167
- | Name | Type | Description | Notes |
1168
- | ---- | ---- | ----------- | ----- |
1169
- | **token_request** | [**EmailVerifyTokenRequest**](EmailVerifyTokenRequest.md) | Token request | |
1170
-
1171
- ### Return type
1172
-
1173
- [**EmailVerifyTokenResponse**](EmailVerifyTokenResponse.md)
1174
-
1175
- ### Authorization
1176
-
1177
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1178
-
1179
- ### HTTP request headers
1180
-
1181
- - **Content-Type**: application/json
1182
- - **Accept**: application/json
1183
-
1184
-
1185
- ## get_magic_link
1186
-
1187
- > <CustomerMagicLinkResponse> get_magic_link(customer_profile_oid, storefront_host_name)
1188
-
1189
- getMagicLink
1190
-
1191
- Retrieves a magic link to allow a merchant to login as a customer. This method is a PUT call intentionally.
1192
-
1193
- ### Examples
1194
-
1195
- ```ruby
1196
- require 'time'
1197
- require 'ultracart_api'
1198
- require 'json'
1199
- require 'yaml'
1200
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1201
-
1202
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1203
- # As such, this might not be the best way to use this object.
1204
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1205
-
1206
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1207
- customer_profile_oid = 56 # Integer | The customer_profile_oid of the customer.
1208
- storefront_host_name = 'storefront_host_name_example' # String | The storefront to log into.
1209
-
1210
- begin
1211
- # getMagicLink
1212
- result = api_instance.get_magic_link(customer_profile_oid, storefront_host_name)
1213
- p result
1214
- rescue UltracartClient::ApiError => e
1215
- puts "Error when calling CustomerApi->get_magic_link: #{e}"
1216
- end
1217
- ```
1218
-
1219
- #### Using the get_magic_link_with_http_info variant
1220
-
1221
- This returns an Array which contains the response data, status code and headers.
1222
-
1223
- > <Array(<CustomerMagicLinkResponse>, Integer, Hash)> get_magic_link_with_http_info(customer_profile_oid, storefront_host_name)
1224
-
1225
- ```ruby
1226
- begin
1227
- # getMagicLink
1228
- data, status_code, headers = api_instance.get_magic_link_with_http_info(customer_profile_oid, storefront_host_name)
1229
- p status_code # => 2xx
1230
- p headers # => { ... }
1231
- p data # => <CustomerMagicLinkResponse>
1232
- rescue UltracartClient::ApiError => e
1233
- puts "Error when calling CustomerApi->get_magic_link_with_http_info: #{e}"
1234
- end
1235
- ```
1236
-
1237
- ### Parameters
1238
-
1239
- | Name | Type | Description | Notes |
1240
- | ---- | ---- | ----------- | ----- |
1241
- | **customer_profile_oid** | **Integer** | The customer_profile_oid of the customer. | |
1242
- | **storefront_host_name** | **String** | The storefront to log into. | |
1243
-
1244
- ### Return type
1245
-
1246
- [**CustomerMagicLinkResponse**](CustomerMagicLinkResponse.md)
1247
-
1248
- ### Authorization
1249
-
1250
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1251
-
1252
- ### HTTP request headers
1253
-
1254
- - **Content-Type**: Not defined
1255
- - **Accept**: application/json
1256
-
1257
-
1258
- ## insert_customer
1259
-
1260
- > <CustomerResponse> insert_customer(customer, opts)
1261
-
1262
- Insert a customer
1263
-
1264
- Insert a customer on the UltraCart account.
1265
-
1266
- ### Examples
1267
-
1268
- ```ruby
1269
- require 'time'
1270
- require 'ultracart_api'
1271
- require 'json'
1272
- require 'yaml'
1273
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1274
-
1275
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1276
- # As such, this might not be the best way to use this object.
1277
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1278
-
1279
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1280
- customer = UltracartClient::Customer.new # Customer | Customer to insert
1281
- opts = {
1282
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
1283
- }
1284
-
1285
- begin
1286
- # Insert a customer
1287
- result = api_instance.insert_customer(customer, opts)
1288
- p result
1289
- rescue UltracartClient::ApiError => e
1290
- puts "Error when calling CustomerApi->insert_customer: #{e}"
1291
- end
1292
- ```
1293
-
1294
- #### Using the insert_customer_with_http_info variant
1295
-
1296
- This returns an Array which contains the response data, status code and headers.
1297
-
1298
- > <Array(<CustomerResponse>, Integer, Hash)> insert_customer_with_http_info(customer, opts)
1299
-
1300
- ```ruby
1301
- begin
1302
- # Insert a customer
1303
- data, status_code, headers = api_instance.insert_customer_with_http_info(customer, opts)
1304
- p status_code # => 2xx
1305
- p headers # => { ... }
1306
- p data # => <CustomerResponse>
1307
- rescue UltracartClient::ApiError => e
1308
- puts "Error when calling CustomerApi->insert_customer_with_http_info: #{e}"
1309
- end
1310
- ```
1311
-
1312
- ### Parameters
1313
-
1314
- | Name | Type | Description | Notes |
1315
- | ---- | ---- | ----------- | ----- |
1316
- | **customer** | [**Customer**](Customer.md) | Customer to insert | |
1317
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1318
-
1319
- ### Return type
1320
-
1321
- [**CustomerResponse**](CustomerResponse.md)
1322
-
1323
- ### Authorization
1324
-
1325
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1326
-
1327
- ### HTTP request headers
1328
-
1329
- - **Content-Type**: application/json; charset=UTF-8
1330
- - **Accept**: application/json
1331
-
1332
-
1333
- ## insert_wish_list_item
1334
-
1335
- > <CustomerWishListItem> insert_wish_list_item(customer_profile_oid, wishlist_item)
1336
-
1337
- Insert a customer wishlist item
1338
-
1339
- Insert a customer wishlist item
1340
-
1341
- ### Examples
1342
-
1343
- ```ruby
1344
- require 'time'
1345
- require 'ultracart_api'
1346
- require 'json'
1347
- require 'yaml'
1348
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1349
-
1350
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1351
- # As such, this might not be the best way to use this object.
1352
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1353
-
1354
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1355
- customer_profile_oid = 56 # Integer | The customer oid for this wishlist.
1356
- wishlist_item = UltracartClient::CustomerWishListItem.new # CustomerWishListItem | Wishlist item to insert
1357
-
1358
- begin
1359
- # Insert a customer wishlist item
1360
- result = api_instance.insert_wish_list_item(customer_profile_oid, wishlist_item)
1361
- p result
1362
- rescue UltracartClient::ApiError => e
1363
- puts "Error when calling CustomerApi->insert_wish_list_item: #{e}"
1364
- end
1365
- ```
1366
-
1367
- #### Using the insert_wish_list_item_with_http_info variant
1368
-
1369
- This returns an Array which contains the response data, status code and headers.
1370
-
1371
- > <Array(<CustomerWishListItem>, Integer, Hash)> insert_wish_list_item_with_http_info(customer_profile_oid, wishlist_item)
1372
-
1373
- ```ruby
1374
- begin
1375
- # Insert a customer wishlist item
1376
- data, status_code, headers = api_instance.insert_wish_list_item_with_http_info(customer_profile_oid, wishlist_item)
1377
- p status_code # => 2xx
1378
- p headers # => { ... }
1379
- p data # => <CustomerWishListItem>
1380
- rescue UltracartClient::ApiError => e
1381
- puts "Error when calling CustomerApi->insert_wish_list_item_with_http_info: #{e}"
1382
- end
1383
- ```
1384
-
1385
- ### Parameters
1386
-
1387
- | Name | Type | Description | Notes |
1388
- | ---- | ---- | ----------- | ----- |
1389
- | **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
1390
- | **wishlist_item** | [**CustomerWishListItem**](CustomerWishListItem.md) | Wishlist item to insert | |
1391
-
1392
- ### Return type
1393
-
1394
- [**CustomerWishListItem**](CustomerWishListItem.md)
1395
-
1396
- ### Authorization
1397
-
1398
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1399
-
1400
- ### HTTP request headers
1401
-
1402
- - **Content-Type**: application/json; charset=UTF-8
1403
- - **Accept**: application/json
1404
-
1405
-
1406
- ## merge_customer
1407
-
1408
- > merge_customer(customer_profile_oid, customer, opts)
1409
-
1410
- Merge customer into this customer
1411
-
1412
- Merge customer into this customer.
1413
-
1414
- ### Examples
1415
-
1416
- ```ruby
1417
- require 'time'
1418
- require 'ultracart_api'
1419
- require 'json'
1420
- require 'yaml'
1421
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1422
-
1423
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1424
- # As such, this might not be the best way to use this object.
1425
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1426
-
1427
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1428
- customer_profile_oid = 56 # Integer | The customer_profile_oid to update.
1429
- customer = UltracartClient::CustomerMergeRequest.new # CustomerMergeRequest | Customer to merge into this profile.
1430
- opts = {
1431
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
1432
- }
1433
-
1434
- begin
1435
- # Merge customer into this customer
1436
- api_instance.merge_customer(customer_profile_oid, customer, opts)
1437
- rescue UltracartClient::ApiError => e
1438
- puts "Error when calling CustomerApi->merge_customer: #{e}"
1439
- end
1440
- ```
1441
-
1442
- #### Using the merge_customer_with_http_info variant
1443
-
1444
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
1445
-
1446
- > <Array(nil, Integer, Hash)> merge_customer_with_http_info(customer_profile_oid, customer, opts)
1447
-
1448
- ```ruby
1449
- begin
1450
- # Merge customer into this customer
1451
- data, status_code, headers = api_instance.merge_customer_with_http_info(customer_profile_oid, customer, opts)
1452
- p status_code # => 2xx
1453
- p headers # => { ... }
1454
- p data # => nil
1455
- rescue UltracartClient::ApiError => e
1456
- puts "Error when calling CustomerApi->merge_customer_with_http_info: #{e}"
1457
- end
1458
- ```
1459
-
1460
- ### Parameters
1461
-
1462
- | Name | Type | Description | Notes |
1463
- | ---- | ---- | ----------- | ----- |
1464
- | **customer_profile_oid** | **Integer** | The customer_profile_oid to update. | |
1465
- | **customer** | [**CustomerMergeRequest**](CustomerMergeRequest.md) | Customer to merge into this profile. | |
1466
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1467
-
1468
- ### Return type
1469
-
1470
- nil (empty response body)
1471
-
1472
- ### Authorization
1473
-
1474
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1475
-
1476
- ### HTTP request headers
1477
-
1478
- - **Content-Type**: application/json; charset=UTF-8
1479
- - **Accept**: application/json
1480
-
1481
-
1482
- ## search_customer_profile_values
1483
-
1484
- > <LookupResponse> search_customer_profile_values(lookup_request)
1485
-
1486
- Searches for all matching values (using POST)
1487
-
1488
- ### Examples
1489
-
1490
- ```ruby
1491
- require 'time'
1492
- require 'ultracart_api'
1493
- require 'json'
1494
- require 'yaml'
1495
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1496
-
1497
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1498
- # As such, this might not be the best way to use this object.
1499
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1500
-
1501
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1502
- lookup_request = UltracartClient::LookupRequest.new # LookupRequest | LookupRequest
1503
-
1504
- begin
1505
- # Searches for all matching values (using POST)
1506
- result = api_instance.search_customer_profile_values(lookup_request)
1507
- p result
1508
- rescue UltracartClient::ApiError => e
1509
- puts "Error when calling CustomerApi->search_customer_profile_values: #{e}"
1510
- end
1511
- ```
1512
-
1513
- #### Using the search_customer_profile_values_with_http_info variant
1514
-
1515
- This returns an Array which contains the response data, status code and headers.
1516
-
1517
- > <Array(<LookupResponse>, Integer, Hash)> search_customer_profile_values_with_http_info(lookup_request)
1518
-
1519
- ```ruby
1520
- begin
1521
- # Searches for all matching values (using POST)
1522
- data, status_code, headers = api_instance.search_customer_profile_values_with_http_info(lookup_request)
1523
- p status_code # => 2xx
1524
- p headers # => { ... }
1525
- p data # => <LookupResponse>
1526
- rescue UltracartClient::ApiError => e
1527
- puts "Error when calling CustomerApi->search_customer_profile_values_with_http_info: #{e}"
1528
- end
1529
- ```
1530
-
1531
- ### Parameters
1532
-
1533
- | Name | Type | Description | Notes |
1534
- | ---- | ---- | ----------- | ----- |
1535
- | **lookup_request** | [**LookupRequest**](LookupRequest.md) | LookupRequest | |
1536
-
1537
- ### Return type
1538
-
1539
- [**LookupResponse**](LookupResponse.md)
1540
-
1541
- ### Authorization
1542
-
1543
- [ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1544
-
1545
- ### HTTP request headers
1546
-
1547
- - **Content-Type**: application/json
1548
- - **Accept**: application/json
1549
-
1550
-
1551
- ## update_customer
1552
-
1553
- > <CustomerResponse> update_customer(customer_profile_oid, customer, opts)
1554
-
1555
- Update a customer
1556
-
1557
- Update a customer on the UltraCart account.
1558
-
1559
- ### Examples
1560
-
1561
- ```ruby
1562
- require 'time'
1563
- require 'ultracart_api'
1564
- require 'json'
1565
- require 'yaml'
1566
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1567
-
1568
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1569
- # As such, this might not be the best way to use this object.
1570
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1571
-
1572
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1573
- customer_profile_oid = 56 # Integer | The customer_profile_oid to update.
1574
- customer = UltracartClient::Customer.new # Customer | Customer to update
1575
- opts = {
1576
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
1577
- }
1578
-
1579
- begin
1580
- # Update a customer
1581
- result = api_instance.update_customer(customer_profile_oid, customer, opts)
1582
- p result
1583
- rescue UltracartClient::ApiError => e
1584
- puts "Error when calling CustomerApi->update_customer: #{e}"
1585
- end
1586
- ```
1587
-
1588
- #### Using the update_customer_with_http_info variant
1589
-
1590
- This returns an Array which contains the response data, status code and headers.
1591
-
1592
- > <Array(<CustomerResponse>, Integer, Hash)> update_customer_with_http_info(customer_profile_oid, customer, opts)
1593
-
1594
- ```ruby
1595
- begin
1596
- # Update a customer
1597
- data, status_code, headers = api_instance.update_customer_with_http_info(customer_profile_oid, customer, opts)
1598
- p status_code # => 2xx
1599
- p headers # => { ... }
1600
- p data # => <CustomerResponse>
1601
- rescue UltracartClient::ApiError => e
1602
- puts "Error when calling CustomerApi->update_customer_with_http_info: #{e}"
1603
- end
1604
- ```
1605
-
1606
- ### Parameters
1607
-
1608
- | Name | Type | Description | Notes |
1609
- | ---- | ---- | ----------- | ----- |
1610
- | **customer_profile_oid** | **Integer** | The customer_profile_oid to update. | |
1611
- | **customer** | [**Customer**](Customer.md) | Customer to update | |
1612
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1613
-
1614
- ### Return type
1615
-
1616
- [**CustomerResponse**](CustomerResponse.md)
1617
-
1618
- ### Authorization
1619
-
1620
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1621
-
1622
- ### HTTP request headers
1623
-
1624
- - **Content-Type**: application/json; charset=UTF-8
1625
- - **Accept**: application/json
1626
-
1627
-
1628
- ## update_customer_email_lists
1629
-
1630
- > <CustomerEmailListChanges> update_customer_email_lists(customer_profile_oid, list_changes)
1631
-
1632
- Update email list subscriptions for a customer
1633
-
1634
- Update email list subscriptions for a customer
1635
-
1636
- ### Examples
1637
-
1638
- ```ruby
1639
- require 'time'
1640
- require 'ultracart_api'
1641
- require 'json'
1642
- require 'yaml'
1643
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1644
-
1645
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1646
- # As such, this might not be the best way to use this object.
1647
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1648
-
1649
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1650
- customer_profile_oid = 56 # Integer | The customer profile oid
1651
- list_changes = UltracartClient::CustomerEmailListChanges.new # CustomerEmailListChanges | List changes
1652
-
1653
- begin
1654
- # Update email list subscriptions for a customer
1655
- result = api_instance.update_customer_email_lists(customer_profile_oid, list_changes)
1656
- p result
1657
- rescue UltracartClient::ApiError => e
1658
- puts "Error when calling CustomerApi->update_customer_email_lists: #{e}"
1659
- end
1660
- ```
1661
-
1662
- #### Using the update_customer_email_lists_with_http_info variant
1663
-
1664
- This returns an Array which contains the response data, status code and headers.
1665
-
1666
- > <Array(<CustomerEmailListChanges>, Integer, Hash)> update_customer_email_lists_with_http_info(customer_profile_oid, list_changes)
1667
-
1668
- ```ruby
1669
- begin
1670
- # Update email list subscriptions for a customer
1671
- data, status_code, headers = api_instance.update_customer_email_lists_with_http_info(customer_profile_oid, list_changes)
1672
- p status_code # => 2xx
1673
- p headers # => { ... }
1674
- p data # => <CustomerEmailListChanges>
1675
- rescue UltracartClient::ApiError => e
1676
- puts "Error when calling CustomerApi->update_customer_email_lists_with_http_info: #{e}"
1677
- end
1678
- ```
1679
-
1680
- ### Parameters
1681
-
1682
- | Name | Type | Description | Notes |
1683
- | ---- | ---- | ----------- | ----- |
1684
- | **customer_profile_oid** | **Integer** | The customer profile oid | |
1685
- | **list_changes** | [**CustomerEmailListChanges**](CustomerEmailListChanges.md) | List changes | |
1686
-
1687
- ### Return type
1688
-
1689
- [**CustomerEmailListChanges**](CustomerEmailListChanges.md)
1690
-
1691
- ### Authorization
1692
-
1693
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1694
-
1695
- ### HTTP request headers
1696
-
1697
- - **Content-Type**: application/json; charset=UTF-8
1698
- - **Accept**: application/json
1699
-
1700
-
1701
- ## update_wish_list_item
1702
-
1703
- > <CustomerWishListItem> update_wish_list_item(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
1704
-
1705
- Update a customer wishlist item
1706
-
1707
- Update a customer wishlist item
1708
-
1709
- ### Examples
1710
-
1711
- ```ruby
1712
- require 'time'
1713
- require 'ultracart_api'
1714
- require 'json'
1715
- require 'yaml'
1716
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1717
-
1718
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1719
- # As such, this might not be the best way to use this object.
1720
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1721
-
1722
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1723
- customer_profile_oid = 56 # Integer | The customer oid for this wishlist.
1724
- customer_wishlist_item_oid = 56 # Integer | The wishlist oid for this wishlist item.
1725
- wishlist_item = UltracartClient::CustomerWishListItem.new # CustomerWishListItem | Wishlist item to update
1726
-
1727
- begin
1728
- # Update a customer wishlist item
1729
- result = api_instance.update_wish_list_item(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
1730
- p result
1731
- rescue UltracartClient::ApiError => e
1732
- puts "Error when calling CustomerApi->update_wish_list_item: #{e}"
1733
- end
1734
- ```
1735
-
1736
- #### Using the update_wish_list_item_with_http_info variant
1737
-
1738
- This returns an Array which contains the response data, status code and headers.
1739
-
1740
- > <Array(<CustomerWishListItem>, Integer, Hash)> update_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
1741
-
1742
- ```ruby
1743
- begin
1744
- # Update a customer wishlist item
1745
- data, status_code, headers = api_instance.update_wish_list_item_with_http_info(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
1746
- p status_code # => 2xx
1747
- p headers # => { ... }
1748
- p data # => <CustomerWishListItem>
1749
- rescue UltracartClient::ApiError => e
1750
- puts "Error when calling CustomerApi->update_wish_list_item_with_http_info: #{e}"
1751
- end
1752
- ```
1753
-
1754
- ### Parameters
1755
-
1756
- | Name | Type | Description | Notes |
1757
- | ---- | ---- | ----------- | ----- |
1758
- | **customer_profile_oid** | **Integer** | The customer oid for this wishlist. | |
1759
- | **customer_wishlist_item_oid** | **Integer** | The wishlist oid for this wishlist item. | |
1760
- | **wishlist_item** | [**CustomerWishListItem**](CustomerWishListItem.md) | Wishlist item to update | |
1761
-
1762
- ### Return type
1763
-
1764
- [**CustomerWishListItem**](CustomerWishListItem.md)
1765
-
1766
- ### Authorization
1767
-
1768
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1769
-
1770
- ### HTTP request headers
1771
-
1772
- - **Content-Type**: application/json; charset=UTF-8
1773
- - **Accept**: application/json
1774
-
1775
-
1776
- ## validate_email_verification_token
1777
-
1778
- > <EmailVerifyTokenValidateResponse> validate_email_verification_token(validation_request)
1779
-
1780
- Validate a token that can be used to verify a customer email address
1781
-
1782
- 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.
1783
-
1784
- ### Examples
1785
-
1786
- ```ruby
1787
- require 'time'
1788
- require 'ultracart_api'
1789
- require 'json'
1790
- require 'yaml'
1791
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1792
-
1793
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1794
- # As such, this might not be the best way to use this object.
1795
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1796
-
1797
- api = UltracartClient::CustomerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1798
- validation_request = UltracartClient::EmailVerifyTokenValidateRequest.new # EmailVerifyTokenValidateRequest | Token validation request
1799
-
1800
- begin
1801
- # Validate a token that can be used to verify a customer email address
1802
- result = api_instance.validate_email_verification_token(validation_request)
1803
- p result
1804
- rescue UltracartClient::ApiError => e
1805
- puts "Error when calling CustomerApi->validate_email_verification_token: #{e}"
1806
- end
1807
- ```
1808
-
1809
- #### Using the validate_email_verification_token_with_http_info variant
1810
-
1811
- This returns an Array which contains the response data, status code and headers.
1812
-
1813
- > <Array(<EmailVerifyTokenValidateResponse>, Integer, Hash)> validate_email_verification_token_with_http_info(validation_request)
1814
-
1815
- ```ruby
1816
- begin
1817
- # Validate a token that can be used to verify a customer email address
1818
- data, status_code, headers = api_instance.validate_email_verification_token_with_http_info(validation_request)
1819
- p status_code # => 2xx
1820
- p headers # => { ... }
1821
- p data # => <EmailVerifyTokenValidateResponse>
1822
- rescue UltracartClient::ApiError => e
1823
- puts "Error when calling CustomerApi->validate_email_verification_token_with_http_info: #{e}"
1824
- end
1825
- ```
1826
-
1827
- ### Parameters
1828
-
1829
- | Name | Type | Description | Notes |
1830
- | ---- | ---- | ----------- | ----- |
1831
- | **validation_request** | [**EmailVerifyTokenValidateRequest**](EmailVerifyTokenValidateRequest.md) | Token validation request | |
1832
-
1833
- ### Return type
1834
-
1835
- [**EmailVerifyTokenValidateResponse**](EmailVerifyTokenValidateResponse.md)
1836
-
1837
- ### Authorization
1838
-
1839
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1840
-
1841
- ### HTTP request headers
1842
-
1843
- - **Content-Type**: application/json
1844
- - **Accept**: application/json
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
+