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/AutoOrderApi.md CHANGED
@@ -1,903 +1,1250 @@
1
- # UltracartClient::AutoOrderApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**consolidate_auto_orders**](AutoOrderApi.md#consolidate_auto_orders) | **PUT** /auto_order/auto_orders/{auto_order_oid}/consolidate | Consolidates multiple auto orders |
8
- | [**establish_auto_order_by_reference_order_id**](AutoOrderApi.md#establish_auto_order_by_reference_order_id) | **POST** /auto_order/auto_orders/reference_order_id/{reference_order_id} | Establish an auto order by referencing a regular order id |
9
- | [**get_auto_order**](AutoOrderApi.md#get_auto_order) | **GET** /auto_order/auto_orders/{auto_order_oid} | Retrieve an auto order by oid |
10
- | [**get_auto_order_by_code**](AutoOrderApi.md#get_auto_order_by_code) | **GET** /auto_order/auto_orders/code/{auto_order_code} | Retrieve an auto order by code |
11
- | [**get_auto_order_by_reference_order_id**](AutoOrderApi.md#get_auto_order_by_reference_order_id) | **GET** /auto_order/auto_orders/reference_order_id/{reference_order_id} | Retrieve an auto order by order id |
12
- | [**get_auto_orders**](AutoOrderApi.md#get_auto_orders) | **GET** /auto_order/auto_orders | Retrieve auto orders |
13
- | [**get_auto_orders_batch**](AutoOrderApi.md#get_auto_orders_batch) | **POST** /auto_order/auto_orders/batch | Retrieve auto order batch |
14
- | [**get_auto_orders_by_query**](AutoOrderApi.md#get_auto_orders_by_query) | **POST** /auto_order/auto_orders/query | Retrieve auto orders by query |
15
- | [**pause_auto_order**](AutoOrderApi.md#pause_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid}/pause | Pause auto order |
16
- | [**update_auto_order**](AutoOrderApi.md#update_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid} | Update an auto order |
17
- | [**update_auto_orders_batch**](AutoOrderApi.md#update_auto_orders_batch) | **PUT** /auto_order/auto_orders/batch | Update multiple auto orders |
18
-
19
-
20
- ## consolidate_auto_orders
21
-
22
- > <AutoOrderResponse> consolidate_auto_orders(auto_order_oid, auto_order_consolidate, opts)
23
-
24
- Consolidates multiple auto orders
25
-
26
- Consolidates mutliple auto orders on the UltraCart account.
27
-
28
- ### Examples
29
-
30
- ```ruby
31
- require 'time'
32
- require 'ultracart_api'
33
- require 'json'
34
- require 'yaml'
35
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
36
-
37
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
38
- # As such, this might not be the best way to use this object.
39
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
40
-
41
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
42
- auto_order_oid = 56 # Integer | The auto order oid to consolidate into.
43
- auto_order_consolidate = UltracartClient::AutoOrderConsolidate.new # AutoOrderConsolidate | Auto orders to consolidate
44
- opts = {
45
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
46
- }
47
-
48
- begin
49
- # Consolidates multiple auto orders
50
- result = api_instance.consolidate_auto_orders(auto_order_oid, auto_order_consolidate, opts)
51
- p result
52
- rescue UltracartClient::ApiError => e
53
- puts "Error when calling AutoOrderApi->consolidate_auto_orders: #{e}"
54
- end
55
- ```
56
-
57
- #### Using the consolidate_auto_orders_with_http_info variant
58
-
59
- This returns an Array which contains the response data, status code and headers.
60
-
61
- > <Array(<AutoOrderResponse>, Integer, Hash)> consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
62
-
63
- ```ruby
64
- begin
65
- # Consolidates multiple auto orders
66
- data, status_code, headers = api_instance.consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
67
- p status_code # => 2xx
68
- p headers # => { ... }
69
- p data # => <AutoOrderResponse>
70
- rescue UltracartClient::ApiError => e
71
- puts "Error when calling AutoOrderApi->consolidate_auto_orders_with_http_info: #{e}"
72
- end
73
- ```
74
-
75
- ### Parameters
76
-
77
- | Name | Type | Description | Notes |
78
- | ---- | ---- | ----------- | ----- |
79
- | **auto_order_oid** | **Integer** | The auto order oid to consolidate into. | |
80
- | **auto_order_consolidate** | [**AutoOrderConsolidate**](AutoOrderConsolidate.md) | Auto orders to consolidate | |
81
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
82
-
83
- ### Return type
84
-
85
- [**AutoOrderResponse**](AutoOrderResponse.md)
86
-
87
- ### Authorization
88
-
89
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
90
-
91
- ### HTTP request headers
92
-
93
- - **Content-Type**: application/json; charset=UTF-8
94
- - **Accept**: application/json
95
-
96
-
97
- ## establish_auto_order_by_reference_order_id
98
-
99
- > <AutoOrderResponse> establish_auto_order_by_reference_order_id(reference_order_id, opts)
100
-
101
- Establish an auto order by referencing a regular order id
102
-
103
- Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
104
-
105
- ### Examples
106
-
107
- ```ruby
108
- require 'time'
109
- require 'ultracart_api'
110
- require 'json'
111
- require 'yaml'
112
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
113
-
114
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
115
- # As such, this might not be the best way to use this object.
116
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
117
-
118
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
119
- reference_order_id = 'reference_order_id_example' # String | The order id to attach this auto order to
120
- opts = {
121
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
122
- }
123
-
124
- begin
125
- # Establish an auto order by referencing a regular order id
126
- result = api_instance.establish_auto_order_by_reference_order_id(reference_order_id, opts)
127
- p result
128
- rescue UltracartClient::ApiError => e
129
- puts "Error when calling AutoOrderApi->establish_auto_order_by_reference_order_id: #{e}"
130
- end
131
- ```
132
-
133
- #### Using the establish_auto_order_by_reference_order_id_with_http_info variant
134
-
135
- This returns an Array which contains the response data, status code and headers.
136
-
137
- > <Array(<AutoOrderResponse>, Integer, Hash)> establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
138
-
139
- ```ruby
140
- begin
141
- # Establish an auto order by referencing a regular order id
142
- data, status_code, headers = api_instance.establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
143
- p status_code # => 2xx
144
- p headers # => { ... }
145
- p data # => <AutoOrderResponse>
146
- rescue UltracartClient::ApiError => e
147
- puts "Error when calling AutoOrderApi->establish_auto_order_by_reference_order_id_with_http_info: #{e}"
148
- end
149
- ```
150
-
151
- ### Parameters
152
-
153
- | Name | Type | Description | Notes |
154
- | ---- | ---- | ----------- | ----- |
155
- | **reference_order_id** | **String** | The order id to attach this auto order to | |
156
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
157
-
158
- ### Return type
159
-
160
- [**AutoOrderResponse**](AutoOrderResponse.md)
161
-
162
- ### Authorization
163
-
164
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
165
-
166
- ### HTTP request headers
167
-
168
- - **Content-Type**: Not defined
169
- - **Accept**: application/json
170
-
171
-
172
- ## get_auto_order
173
-
174
- > <AutoOrderResponse> get_auto_order(auto_order_oid, opts)
175
-
176
- Retrieve an auto order by oid
177
-
178
- Retrieves a single auto order using the specified auto order oid.
179
-
180
- ### Examples
181
-
182
- ```ruby
183
- require 'time'
184
- require 'ultracart_api'
185
- require 'json'
186
- require 'yaml'
187
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
188
-
189
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
190
- # As such, this might not be the best way to use this object.
191
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
192
-
193
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
194
- auto_order_oid = 56 # Integer | The auto order oid to retrieve.
195
- opts = {
196
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
197
- }
198
-
199
- begin
200
- # Retrieve an auto order by oid
201
- result = api_instance.get_auto_order(auto_order_oid, opts)
202
- p result
203
- rescue UltracartClient::ApiError => e
204
- puts "Error when calling AutoOrderApi->get_auto_order: #{e}"
205
- end
206
- ```
207
-
208
- #### Using the get_auto_order_with_http_info variant
209
-
210
- This returns an Array which contains the response data, status code and headers.
211
-
212
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_with_http_info(auto_order_oid, opts)
213
-
214
- ```ruby
215
- begin
216
- # Retrieve an auto order by oid
217
- data, status_code, headers = api_instance.get_auto_order_with_http_info(auto_order_oid, opts)
218
- p status_code # => 2xx
219
- p headers # => { ... }
220
- p data # => <AutoOrderResponse>
221
- rescue UltracartClient::ApiError => e
222
- puts "Error when calling AutoOrderApi->get_auto_order_with_http_info: #{e}"
223
- end
224
- ```
225
-
226
- ### Parameters
227
-
228
- | Name | Type | Description | Notes |
229
- | ---- | ---- | ----------- | ----- |
230
- | **auto_order_oid** | **Integer** | The auto order oid to retrieve. | |
231
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
232
-
233
- ### Return type
234
-
235
- [**AutoOrderResponse**](AutoOrderResponse.md)
236
-
237
- ### Authorization
238
-
239
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
240
-
241
- ### HTTP request headers
242
-
243
- - **Content-Type**: Not defined
244
- - **Accept**: application/json
245
-
246
-
247
- ## get_auto_order_by_code
248
-
249
- > <AutoOrderResponse> get_auto_order_by_code(auto_order_code, opts)
250
-
251
- Retrieve an auto order by code
252
-
253
- Retrieves a single auto order using the specified reference (original) order id.
254
-
255
- ### Examples
256
-
257
- ```ruby
258
- require 'time'
259
- require 'ultracart_api'
260
- require 'json'
261
- require 'yaml'
262
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
263
-
264
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
265
- # As such, this might not be the best way to use this object.
266
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
267
-
268
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
269
- auto_order_code = 'auto_order_code_example' # String | The auto order oid to retrieve.
270
- opts = {
271
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
272
- }
273
-
274
- begin
275
- # Retrieve an auto order by code
276
- result = api_instance.get_auto_order_by_code(auto_order_code, opts)
277
- p result
278
- rescue UltracartClient::ApiError => e
279
- puts "Error when calling AutoOrderApi->get_auto_order_by_code: #{e}"
280
- end
281
- ```
282
-
283
- #### Using the get_auto_order_by_code_with_http_info variant
284
-
285
- This returns an Array which contains the response data, status code and headers.
286
-
287
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_code_with_http_info(auto_order_code, opts)
288
-
289
- ```ruby
290
- begin
291
- # Retrieve an auto order by code
292
- data, status_code, headers = api_instance.get_auto_order_by_code_with_http_info(auto_order_code, opts)
293
- p status_code # => 2xx
294
- p headers # => { ... }
295
- p data # => <AutoOrderResponse>
296
- rescue UltracartClient::ApiError => e
297
- puts "Error when calling AutoOrderApi->get_auto_order_by_code_with_http_info: #{e}"
298
- end
299
- ```
300
-
301
- ### Parameters
302
-
303
- | Name | Type | Description | Notes |
304
- | ---- | ---- | ----------- | ----- |
305
- | **auto_order_code** | **String** | The auto order oid to retrieve. | |
306
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
307
-
308
- ### Return type
309
-
310
- [**AutoOrderResponse**](AutoOrderResponse.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_auto_order_by_reference_order_id
323
-
324
- > <AutoOrderResponse> get_auto_order_by_reference_order_id(reference_order_id, opts)
325
-
326
- Retrieve an auto order by order id
327
-
328
- Retrieves a single auto order using the specified reference (original) order id.
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::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
344
- reference_order_id = 'reference_order_id_example' # String | The auto order 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 an auto order by order id
351
- result = api_instance.get_auto_order_by_reference_order_id(reference_order_id, opts)
352
- p result
353
- rescue UltracartClient::ApiError => e
354
- puts "Error when calling AutoOrderApi->get_auto_order_by_reference_order_id: #{e}"
355
- end
356
- ```
357
-
358
- #### Using the get_auto_order_by_reference_order_id_with_http_info variant
359
-
360
- This returns an Array which contains the response data, status code and headers.
361
-
362
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
363
-
364
- ```ruby
365
- begin
366
- # Retrieve an auto order by order id
367
- data, status_code, headers = api_instance.get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
368
- p status_code # => 2xx
369
- p headers # => { ... }
370
- p data # => <AutoOrderResponse>
371
- rescue UltracartClient::ApiError => e
372
- puts "Error when calling AutoOrderApi->get_auto_order_by_reference_order_id_with_http_info: #{e}"
373
- end
374
- ```
375
-
376
- ### Parameters
377
-
378
- | Name | Type | Description | Notes |
379
- | ---- | ---- | ----------- | ----- |
380
- | **reference_order_id** | **String** | The auto order 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
- [**AutoOrderResponse**](AutoOrderResponse.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_auto_orders
398
-
399
- > <AutoOrdersResponse> get_auto_orders(opts)
400
-
401
- Retrieve auto orders
402
-
403
- Retrieves auto orders from the account. If no parameters are specified, all auto orders 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.
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::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
419
- opts = {
420
- auto_order_code: 'auto_order_code_example', # String | Auto order code
421
- original_order_id: 'original_order_id_example', # String | Original order id
422
- first_name: 'first_name_example', # String | First name
423
- last_name: 'last_name_example', # String | Last name
424
- company: 'company_example', # String | Company
425
- city: 'city_example', # String | City
426
- state: 'state_example', # String | State
427
- postal_code: 'postal_code_example', # String | Postal code
428
- country_code: 'country_code_example', # String | Country code (ISO-3166 two letter)
429
- phone: 'phone_example', # String | Phone
430
- email: 'email_example', # String | Email
431
- original_order_date_begin: 'original_order_date_begin_example', # String | Original order date begin
432
- original_order_date_end: 'original_order_date_end_example', # String | Original order date end
433
- next_shipment_date_begin: 'next_shipment_date_begin_example', # String | Next shipment date begin
434
- next_shipment_date_end: 'next_shipment_date_end_example', # String | Next shipment date end
435
- card_type: 'card_type_example', # String | Card type
436
- item_id: 'item_id_example', # String | Item ID
437
- status: 'status_example', # String | Status
438
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Max 200)
439
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
440
- _since: '_since_example', # String | Fetch auto orders that have been created/modified since this date/time.
441
- _sort: '_sort_example', # String | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
442
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
443
- }
444
-
445
- begin
446
- # Retrieve auto orders
447
- result = api_instance.get_auto_orders(opts)
448
- p result
449
- rescue UltracartClient::ApiError => e
450
- puts "Error when calling AutoOrderApi->get_auto_orders: #{e}"
451
- end
452
- ```
453
-
454
- #### Using the get_auto_orders_with_http_info variant
455
-
456
- This returns an Array which contains the response data, status code and headers.
457
-
458
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_with_http_info(opts)
459
-
460
- ```ruby
461
- begin
462
- # Retrieve auto orders
463
- data, status_code, headers = api_instance.get_auto_orders_with_http_info(opts)
464
- p status_code # => 2xx
465
- p headers # => { ... }
466
- p data # => <AutoOrdersResponse>
467
- rescue UltracartClient::ApiError => e
468
- puts "Error when calling AutoOrderApi->get_auto_orders_with_http_info: #{e}"
469
- end
470
- ```
471
-
472
- ### Parameters
473
-
474
- | Name | Type | Description | Notes |
475
- | ---- | ---- | ----------- | ----- |
476
- | **auto_order_code** | **String** | Auto order code | [optional] |
477
- | **original_order_id** | **String** | Original order id | [optional] |
478
- | **first_name** | **String** | First name | [optional] |
479
- | **last_name** | **String** | Last name | [optional] |
480
- | **company** | **String** | Company | [optional] |
481
- | **city** | **String** | City | [optional] |
482
- | **state** | **String** | State | [optional] |
483
- | **postal_code** | **String** | Postal code | [optional] |
484
- | **country_code** | **String** | Country code (ISO-3166 two letter) | [optional] |
485
- | **phone** | **String** | Phone | [optional] |
486
- | **email** | **String** | Email | [optional] |
487
- | **original_order_date_begin** | **String** | Original order date begin | [optional] |
488
- | **original_order_date_end** | **String** | Original order date end | [optional] |
489
- | **next_shipment_date_begin** | **String** | Next shipment date begin | [optional] |
490
- | **next_shipment_date_end** | **String** | Next shipment date end | [optional] |
491
- | **card_type** | **String** | Card type | [optional] |
492
- | **item_id** | **String** | Item ID | [optional] |
493
- | **status** | **String** | Status | [optional] |
494
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
495
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
496
- | **_since** | **String** | Fetch auto orders that have been created/modified since this date/time. | [optional] |
497
- | **_sort** | **String** | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
498
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
499
-
500
- ### Return type
501
-
502
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
503
-
504
- ### Authorization
505
-
506
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
507
-
508
- ### HTTP request headers
509
-
510
- - **Content-Type**: Not defined
511
- - **Accept**: application/json
512
-
513
-
514
- ## get_auto_orders_batch
515
-
516
- > <AutoOrdersResponse> get_auto_orders_batch(auto_order_batch, opts)
517
-
518
- Retrieve auto order batch
519
-
520
- Retrieves a group of auto orders from the account based on an array of auto order oids. If more than 200 auto order ids are specified, the API call will fail with a bad request error.
521
-
522
- ### Examples
523
-
524
- ```ruby
525
- require 'time'
526
- require 'ultracart_api'
527
- require 'json'
528
- require 'yaml'
529
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
530
-
531
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
532
- # As such, this might not be the best way to use this object.
533
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
534
-
535
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
536
- auto_order_batch = UltracartClient::AutoOrderQueryBatch.new # AutoOrderQueryBatch | Auto order batch
537
- opts = {
538
- _expand: '_expand_example' # String | The object expansion to perform on the result.
539
- }
540
-
541
- begin
542
- # Retrieve auto order batch
543
- result = api_instance.get_auto_orders_batch(auto_order_batch, opts)
544
- p result
545
- rescue UltracartClient::ApiError => e
546
- puts "Error when calling AutoOrderApi->get_auto_orders_batch: #{e}"
547
- end
548
- ```
549
-
550
- #### Using the get_auto_orders_batch_with_http_info variant
551
-
552
- This returns an Array which contains the response data, status code and headers.
553
-
554
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_batch_with_http_info(auto_order_batch, opts)
555
-
556
- ```ruby
557
- begin
558
- # Retrieve auto order batch
559
- data, status_code, headers = api_instance.get_auto_orders_batch_with_http_info(auto_order_batch, opts)
560
- p status_code # => 2xx
561
- p headers # => { ... }
562
- p data # => <AutoOrdersResponse>
563
- rescue UltracartClient::ApiError => e
564
- puts "Error when calling AutoOrderApi->get_auto_orders_batch_with_http_info: #{e}"
565
- end
566
- ```
567
-
568
- ### Parameters
569
-
570
- | Name | Type | Description | Notes |
571
- | ---- | ---- | ----------- | ----- |
572
- | **auto_order_batch** | [**AutoOrderQueryBatch**](AutoOrderQueryBatch.md) | Auto order batch | |
573
- | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
574
-
575
- ### Return type
576
-
577
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
578
-
579
- ### Authorization
580
-
581
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
582
-
583
- ### HTTP request headers
584
-
585
- - **Content-Type**: application/json
586
- - **Accept**: application/json
587
-
588
-
589
- ## get_auto_orders_by_query
590
-
591
- > <AutoOrdersResponse> get_auto_orders_by_query(auto_order_query, opts)
592
-
593
- Retrieve auto orders by query
594
-
595
- Retrieves a group of auto orders from the account based on a query object. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
596
-
597
- ### Examples
598
-
599
- ```ruby
600
- require 'time'
601
- require 'ultracart_api'
602
- require 'json'
603
- require 'yaml'
604
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
605
-
606
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
607
- # As such, this might not be the best way to use this object.
608
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
609
-
610
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
611
- auto_order_query = UltracartClient::AutoOrderQuery.new # AutoOrderQuery | Auto order query
612
- opts = {
613
- _limit: 56, # Integer | The maximum number of records to return on this one API call. (Maximum 200)
614
- _offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
615
- _sort: '_sort_example', # String | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
616
- _expand: '_expand_example' # String | The object expansion to perform on the result.
617
- }
618
-
619
- begin
620
- # Retrieve auto orders by query
621
- result = api_instance.get_auto_orders_by_query(auto_order_query, opts)
622
- p result
623
- rescue UltracartClient::ApiError => e
624
- puts "Error when calling AutoOrderApi->get_auto_orders_by_query: #{e}"
625
- end
626
- ```
627
-
628
- #### Using the get_auto_orders_by_query_with_http_info variant
629
-
630
- This returns an Array which contains the response data, status code and headers.
631
-
632
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_by_query_with_http_info(auto_order_query, opts)
633
-
634
- ```ruby
635
- begin
636
- # Retrieve auto orders by query
637
- data, status_code, headers = api_instance.get_auto_orders_by_query_with_http_info(auto_order_query, opts)
638
- p status_code # => 2xx
639
- p headers # => { ... }
640
- p data # => <AutoOrdersResponse>
641
- rescue UltracartClient::ApiError => e
642
- puts "Error when calling AutoOrderApi->get_auto_orders_by_query_with_http_info: #{e}"
643
- end
644
- ```
645
-
646
- ### Parameters
647
-
648
- | Name | Type | Description | Notes |
649
- | ---- | ---- | ----------- | ----- |
650
- | **auto_order_query** | [**AutoOrderQuery**](AutoOrderQuery.md) | Auto order query | |
651
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Maximum 200) | [optional][default to 100] |
652
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
653
- | **_sort** | **String** | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
654
- | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
655
-
656
- ### Return type
657
-
658
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
659
-
660
- ### Authorization
661
-
662
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
663
-
664
- ### HTTP request headers
665
-
666
- - **Content-Type**: application/json
667
- - **Accept**: application/json
668
-
669
-
670
- ## pause_auto_order
671
-
672
- > <AutoOrderResponse> pause_auto_order(auto_order_oid, auto_order, opts)
673
-
674
- Pause auto order
675
-
676
- Completely pause an auto order
677
-
678
- ### Examples
679
-
680
- ```ruby
681
- require 'time'
682
- require 'ultracart_api'
683
- require 'json'
684
- require 'yaml'
685
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
686
-
687
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
688
- # As such, this might not be the best way to use this object.
689
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
690
-
691
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
692
- auto_order_oid = 56 # Integer | The auto order oid to pause.
693
- auto_order = UltracartClient::AutoOrder.new # AutoOrder | Auto order to pause
694
- opts = {
695
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
696
- }
697
-
698
- begin
699
- # Pause auto order
700
- result = api_instance.pause_auto_order(auto_order_oid, auto_order, opts)
701
- p result
702
- rescue UltracartClient::ApiError => e
703
- puts "Error when calling AutoOrderApi->pause_auto_order: #{e}"
704
- end
705
- ```
706
-
707
- #### Using the pause_auto_order_with_http_info variant
708
-
709
- This returns an Array which contains the response data, status code and headers.
710
-
711
- > <Array(<AutoOrderResponse>, Integer, Hash)> pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
712
-
713
- ```ruby
714
- begin
715
- # Pause auto order
716
- data, status_code, headers = api_instance.pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
717
- p status_code # => 2xx
718
- p headers # => { ... }
719
- p data # => <AutoOrderResponse>
720
- rescue UltracartClient::ApiError => e
721
- puts "Error when calling AutoOrderApi->pause_auto_order_with_http_info: #{e}"
722
- end
723
- ```
724
-
725
- ### Parameters
726
-
727
- | Name | Type | Description | Notes |
728
- | ---- | ---- | ----------- | ----- |
729
- | **auto_order_oid** | **Integer** | The auto order oid to pause. | |
730
- | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to pause | |
731
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
732
-
733
- ### Return type
734
-
735
- [**AutoOrderResponse**](AutoOrderResponse.md)
736
-
737
- ### Authorization
738
-
739
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
740
-
741
- ### HTTP request headers
742
-
743
- - **Content-Type**: application/json; charset=UTF-8
744
- - **Accept**: application/json
745
-
746
-
747
- ## update_auto_order
748
-
749
- > <AutoOrderResponse> update_auto_order(auto_order_oid, auto_order, opts)
750
-
751
- Update an auto order
752
-
753
- Update an auto order on the UltraCart account.
754
-
755
- ### Examples
756
-
757
- ```ruby
758
- require 'time'
759
- require 'ultracart_api'
760
- require 'json'
761
- require 'yaml'
762
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
763
-
764
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
765
- # As such, this might not be the best way to use this object.
766
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
767
-
768
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
769
- auto_order_oid = 56 # Integer | The auto order oid to update.
770
- auto_order = UltracartClient::AutoOrder.new # AutoOrder | Auto order to update
771
- opts = {
772
- validate_original_order: 'validate_original_order_example', # String | Validate original order before updating
773
- _expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
774
- }
775
-
776
- begin
777
- # Update an auto order
778
- result = api_instance.update_auto_order(auto_order_oid, auto_order, opts)
779
- p result
780
- rescue UltracartClient::ApiError => e
781
- puts "Error when calling AutoOrderApi->update_auto_order: #{e}"
782
- end
783
- ```
784
-
785
- #### Using the update_auto_order_with_http_info variant
786
-
787
- This returns an Array which contains the response data, status code and headers.
788
-
789
- > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
790
-
791
- ```ruby
792
- begin
793
- # Update an auto order
794
- data, status_code, headers = api_instance.update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
795
- p status_code # => 2xx
796
- p headers # => { ... }
797
- p data # => <AutoOrderResponse>
798
- rescue UltracartClient::ApiError => e
799
- puts "Error when calling AutoOrderApi->update_auto_order_with_http_info: #{e}"
800
- end
801
- ```
802
-
803
- ### Parameters
804
-
805
- | Name | Type | Description | Notes |
806
- | ---- | ---- | ----------- | ----- |
807
- | **auto_order_oid** | **Integer** | The auto order oid to update. | |
808
- | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to update | |
809
- | **validate_original_order** | **String** | Validate original order before updating | [optional] |
810
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
811
-
812
- ### Return type
813
-
814
- [**AutoOrderResponse**](AutoOrderResponse.md)
815
-
816
- ### Authorization
817
-
818
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
819
-
820
- ### HTTP request headers
821
-
822
- - **Content-Type**: application/json; charset=UTF-8
823
- - **Accept**: application/json
824
-
825
-
826
- ## update_auto_orders_batch
827
-
828
- > <AutoOrdersResponse> update_auto_orders_batch(auto_orders_request, opts)
829
-
830
- Update multiple auto orders
831
-
832
- Update multiple auto orders on the UltraCart account.
833
-
834
- ### Examples
835
-
836
- ```ruby
837
- require 'time'
838
- require 'ultracart_api'
839
- require 'json'
840
- require 'yaml'
841
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
842
-
843
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
844
- # As such, this might not be the best way to use this object.
845
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
846
-
847
- api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
848
- auto_orders_request = UltracartClient::AutoOrdersRequest.new # AutoOrdersRequest | Auto orders to update (synchronous maximum 20 / asynchronous maximum 100)
849
- opts = {
850
- _expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
851
- _placeholders: true, # Boolean | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
852
- _async: true # Boolean | True if the operation should be run async. No result returned
853
- }
854
-
855
- begin
856
- # Update multiple auto orders
857
- result = api_instance.update_auto_orders_batch(auto_orders_request, opts)
858
- p result
859
- rescue UltracartClient::ApiError => e
860
- puts "Error when calling AutoOrderApi->update_auto_orders_batch: #{e}"
861
- end
862
- ```
863
-
864
- #### Using the update_auto_orders_batch_with_http_info variant
865
-
866
- This returns an Array which contains the response data, status code and headers.
867
-
868
- > <Array(<AutoOrdersResponse>, Integer, Hash)> update_auto_orders_batch_with_http_info(auto_orders_request, opts)
869
-
870
- ```ruby
871
- begin
872
- # Update multiple auto orders
873
- data, status_code, headers = api_instance.update_auto_orders_batch_with_http_info(auto_orders_request, opts)
874
- p status_code # => 2xx
875
- p headers # => { ... }
876
- p data # => <AutoOrdersResponse>
877
- rescue UltracartClient::ApiError => e
878
- puts "Error when calling AutoOrderApi->update_auto_orders_batch_with_http_info: #{e}"
879
- end
880
- ```
881
-
882
- ### Parameters
883
-
884
- | Name | Type | Description | Notes |
885
- | ---- | ---- | ----------- | ----- |
886
- | **auto_orders_request** | [**AutoOrdersRequest**](AutoOrdersRequest.md) | Auto orders to update (synchronous maximum 20 / asynchronous maximum 100) | |
887
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
888
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
889
- | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
890
-
891
- ### Return type
892
-
893
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
894
-
895
- ### Authorization
896
-
897
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
898
-
899
- ### HTTP request headers
900
-
901
- - **Content-Type**: application/json; charset=UTF-8
902
- - **Accept**: application/json
903
-
1
+ # UltracartClient::AutoOrderApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**consolidate_auto_orders**](AutoOrderApi.md#consolidate_auto_orders) | **PUT** /auto_order/auto_orders/{auto_order_oid}/consolidate | Consolidates multiple auto orders |
8
+ | [**establish_auto_order_by_reference_order_id**](AutoOrderApi.md#establish_auto_order_by_reference_order_id) | **POST** /auto_order/auto_orders/reference_order_id/{reference_order_id} | Establish an auto order by referencing a regular order id |
9
+ | [**get_auto_order**](AutoOrderApi.md#get_auto_order) | **GET** /auto_order/auto_orders/{auto_order_oid} | Retrieve an auto order by oid |
10
+ | [**get_auto_order_by_code**](AutoOrderApi.md#get_auto_order_by_code) | **GET** /auto_order/auto_orders/code/{auto_order_code} | Retrieve an auto order by code |
11
+ | [**get_auto_order_by_reference_order_id**](AutoOrderApi.md#get_auto_order_by_reference_order_id) | **GET** /auto_order/auto_orders/reference_order_id/{reference_order_id} | Retrieve an auto order by order id |
12
+ | [**get_auto_orders**](AutoOrderApi.md#get_auto_orders) | **GET** /auto_order/auto_orders | Retrieve auto orders |
13
+ | [**get_auto_orders_batch**](AutoOrderApi.md#get_auto_orders_batch) | **POST** /auto_order/auto_orders/batch | Retrieve auto order batch |
14
+ | [**get_auto_orders_by_query**](AutoOrderApi.md#get_auto_orders_by_query) | **POST** /auto_order/auto_orders/query | Retrieve auto orders by query |
15
+ | [**pause_auto_order**](AutoOrderApi.md#pause_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid}/pause | Pause auto order |
16
+ | [**update_auto_order**](AutoOrderApi.md#update_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid} | Update an auto order |
17
+ | [**update_auto_orders_batch**](AutoOrderApi.md#update_auto_orders_batch) | **PUT** /auto_order/auto_orders/batch | Update multiple auto orders |
18
+
19
+
20
+ ## consolidate_auto_orders
21
+
22
+ > <AutoOrderResponse> consolidate_auto_orders(auto_order_oid, auto_order_consolidate, opts)
23
+
24
+ Consolidates multiple auto orders
25
+
26
+ Consolidates mutliple auto orders on the UltraCart account.
27
+
28
+
29
+ ### Examples
30
+
31
+ ```ruby
32
+ require 'ultracart_api'
33
+ require_relative '../constants'
34
+
35
+ # consolidateAutoOrders
36
+ # an auto order with no items, the original_order is used for shipping, billing, and payment information.
37
+ # Once you have your empty auto order, add items to it and call updateAutoOrder.
38
+
39
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
40
+
41
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
42
+ expand = "items,items.future_schedules,original_order,rebill_orders"
43
+
44
+ target_auto_order_oid = 123456789 # set getAutoOrdersByQuery for retrieving auto orders where you can get their auto_order_oid.
45
+ consolidate_request = UltracartClient::AutoOrderConsolidate.new
46
+ consolidate_request.source_auto_order_oids = [23456789, 3456789] # these are the autoorder_oids you wish to consolidate into the target.
47
+
48
+ api_response = auto_order_api.consolidate_auto_orders(target_auto_order_oid, consolidate_request, { '_expand' => expand })
49
+
50
+ consolidated_auto_order = api_response.auto_order
51
+
52
+ # TODO: make sure the consolidated order has all the items and history of all orders.
53
+ puts consolidated_auto_order.inspect
54
+ ```
55
+
56
+
57
+ #### Using the consolidate_auto_orders_with_http_info variant
58
+
59
+ This returns an Array which contains the response data, status code and headers.
60
+
61
+ > <Array(<AutoOrderResponse>, Integer, Hash)> consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
62
+
63
+ ```ruby
64
+ begin
65
+ # Consolidates multiple auto orders
66
+ data, status_code, headers = api_instance.consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
67
+ p status_code # => 2xx
68
+ p headers # => { ... }
69
+ p data # => <AutoOrderResponse>
70
+ rescue UltracartClient::ApiError => e
71
+ puts "Error when calling AutoOrderApi->consolidate_auto_orders_with_http_info: #{e}"
72
+ end
73
+ ```
74
+
75
+ ### Parameters
76
+
77
+ | Name | Type | Description | Notes |
78
+ | ---- | ---- | ----------- | ----- |
79
+ | **auto_order_oid** | **Integer** | The auto order oid to consolidate into. | |
80
+ | **auto_order_consolidate** | [**AutoOrderConsolidate**](AutoOrderConsolidate.md) | Auto orders to consolidate | |
81
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
82
+
83
+ ### Return type
84
+
85
+ [**AutoOrderResponse**](AutoOrderResponse.md)
86
+
87
+ ### Authorization
88
+
89
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
90
+
91
+ ### HTTP request headers
92
+
93
+ - **Content-Type**: application/json; charset=UTF-8
94
+ - **Accept**: application/json
95
+
96
+
97
+ ## establish_auto_order_by_reference_order_id
98
+
99
+ > <AutoOrderResponse> establish_auto_order_by_reference_order_id(reference_order_id, opts)
100
+
101
+ Establish an auto order by referencing a regular order id
102
+
103
+ Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.
104
+
105
+
106
+ ### Examples
107
+
108
+ ```ruby
109
+ require 'ultracart_api'
110
+ require_relative '../constants'
111
+
112
+ # This method takes a normal order id and creates an empty auto order from it. While this might seem useless having
113
+ # an auto order with no items, the original_order is used for shipping, billing, and payment information.
114
+ # Once you have your empty auto order, add items to it and call updateAutoOrder.
115
+
116
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
117
+
118
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
119
+ expand = "items,items.future_schedules,original_order,rebill_orders"
120
+
121
+ original_order_id = "DEMO-123457"
122
+ api_response = auto_order_api.establish_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
123
+
124
+ empty_auto_order = api_response.auto_order
125
+ auto_order_oid = empty_auto_order.auto_order_oid
126
+
127
+ items = []
128
+ item = UltracartClient::AutoOrderItem.new
129
+ item.original_item_id = "ITEM_ABC" # This item should be configured with auto order features.
130
+ item.original_quantity = 1
131
+ item.arbitrary_unit_cost = 59.99
132
+ # Valid Frequencies
133
+ # "Weekly", "Biweekly", "Every...", "Every 10 Days", "Every 4 Weeks", "Every 6 Weeks", "Every 8 Weeks", "Every 24 Days", "Every 28 Days", "Monthly",
134
+ # "Every 45 Days", "Every 2 Months", "Every 3 Months", "Every 4 Months", "Every 5 Months", "Every 6 Months", "Yearly"
135
+ item.frequency = "Monthly"
136
+ items << item
137
+ empty_auto_order.items = items
138
+
139
+ validate_original_order = 'No'
140
+ api_response = auto_order_api.update_auto_order(auto_order_oid, empty_auto_order, { '_expand' => expand, validate_original_order: validate_original_order })
141
+ updated_auto_order = api_response.auto_order
142
+ puts updated_auto_order.inspect
143
+ ```
144
+
145
+
146
+ #### Using the establish_auto_order_by_reference_order_id_with_http_info variant
147
+
148
+ This returns an Array which contains the response data, status code and headers.
149
+
150
+ > <Array(<AutoOrderResponse>, Integer, Hash)> establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
151
+
152
+ ```ruby
153
+ begin
154
+ # Establish an auto order by referencing a regular order id
155
+ data, status_code, headers = api_instance.establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
156
+ p status_code # => 2xx
157
+ p headers # => { ... }
158
+ p data # => <AutoOrderResponse>
159
+ rescue UltracartClient::ApiError => e
160
+ puts "Error when calling AutoOrderApi->establish_auto_order_by_reference_order_id_with_http_info: #{e}"
161
+ end
162
+ ```
163
+
164
+ ### Parameters
165
+
166
+ | Name | Type | Description | Notes |
167
+ | ---- | ---- | ----------- | ----- |
168
+ | **reference_order_id** | **String** | The order id to attach this auto order to | |
169
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
170
+
171
+ ### Return type
172
+
173
+ [**AutoOrderResponse**](AutoOrderResponse.md)
174
+
175
+ ### Authorization
176
+
177
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
178
+
179
+ ### HTTP request headers
180
+
181
+ - **Content-Type**: Not defined
182
+ - **Accept**: application/json
183
+
184
+
185
+ ## get_auto_order
186
+
187
+ > <AutoOrderResponse> get_auto_order(auto_order_oid, opts)
188
+
189
+ Retrieve an auto order by oid
190
+
191
+ Retrieves a single auto order using the specified auto order oid.
192
+
193
+
194
+ ### Examples
195
+
196
+ ```ruby
197
+ require 'ultracart_api'
198
+ require_relative '../constants'
199
+
200
+ # retrieves an auto_order given the auto_order_oid;
201
+
202
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
203
+
204
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
205
+ expand = "items,items.future_schedules,original_order,rebill_orders"
206
+ auto_order_oid = 123456789 # If you don't know the oid, use getAutoOrdersByQuery for retrieving auto orders
207
+ api_response = auto_order_api.get_auto_order(auto_order_oid, { '_expand' => expand })
208
+ auto_order = api_response.auto_order
209
+ puts auto_order.inspect
210
+ ```
211
+
212
+
213
+ #### Using the get_auto_order_with_http_info variant
214
+
215
+ This returns an Array which contains the response data, status code and headers.
216
+
217
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_with_http_info(auto_order_oid, opts)
218
+
219
+ ```ruby
220
+ begin
221
+ # Retrieve an auto order by oid
222
+ data, status_code, headers = api_instance.get_auto_order_with_http_info(auto_order_oid, opts)
223
+ p status_code # => 2xx
224
+ p headers # => { ... }
225
+ p data # => <AutoOrderResponse>
226
+ rescue UltracartClient::ApiError => e
227
+ puts "Error when calling AutoOrderApi->get_auto_order_with_http_info: #{e}"
228
+ end
229
+ ```
230
+
231
+ ### Parameters
232
+
233
+ | Name | Type | Description | Notes |
234
+ | ---- | ---- | ----------- | ----- |
235
+ | **auto_order_oid** | **Integer** | The auto order oid to retrieve. | |
236
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
237
+
238
+ ### Return type
239
+
240
+ [**AutoOrderResponse**](AutoOrderResponse.md)
241
+
242
+ ### Authorization
243
+
244
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
245
+
246
+ ### HTTP request headers
247
+
248
+ - **Content-Type**: Not defined
249
+ - **Accept**: application/json
250
+
251
+
252
+ ## get_auto_order_by_code
253
+
254
+ > <AutoOrderResponse> get_auto_order_by_code(auto_order_code, opts)
255
+
256
+ Retrieve an auto order by code
257
+
258
+ Retrieves a single auto order using the specified reference (original) order id.
259
+
260
+
261
+ ### Examples
262
+
263
+ ```ruby
264
+ require 'ultracart_api'
265
+ require_relative '../constants'
266
+
267
+ # This example illustrates how to query an auto order when you know the 'code'. Each AutoOrder has a unique
268
+ # identifier used by UltraCart called an OID (Object Identifier). AutoOrders also have a unique code which
269
+ # is (arguably) an easy way for customers to discuss a specific auto order with a merchant.
270
+ # The codes look like this: "RT2A9CBSX9"
271
+ #
272
+ # It is doubtful that an UltraCart merchant will ever make use of this method.
273
+
274
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
275
+
276
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
277
+ # and may become stale. Please review the master website when in doubt.
278
+ # items
279
+ # items.future_schedules
280
+ # items.sample_schedule
281
+ # original_order
282
+ # original_order.affiliate
283
+ # original_order.affiliate.ledger
284
+ # original_order.auto_order
285
+ # original_order.billing
286
+ # original_order.buysafe
287
+ # original_order.channel_partner
288
+ # original_order.checkout
289
+ # original_order.coupon
290
+ # original_order.customer_profile
291
+ # original_order.digital_order
292
+ # original_order.edi
293
+ # original_order.fraud_score
294
+ # original_order.gift
295
+ # original_order.gift_certificate
296
+ # original_order.internal
297
+ # original_order.item
298
+ # original_order.linked_shipment
299
+ # original_order.marketing
300
+ # original_order.payment
301
+ # original_order.payment.transaction
302
+ # original_order.quote
303
+ # original_order.salesforce
304
+ # original_order.shipping
305
+ # original_order.summary
306
+ # original_order.taxes
307
+ # rebill_orders
308
+ # rebill_orders.affiliate
309
+ # rebill_orders.affiliate.ledger
310
+ # rebill_orders.auto_order
311
+ # rebill_orders.billing
312
+ # rebill_orders.buysafe
313
+ # rebill_orders.channel_partner
314
+ # rebill_orders.checkout
315
+ # rebill_orders.coupon
316
+ # rebill_orders.customer_profile
317
+ # rebill_orders.digital_order
318
+ # rebill_orders.edi
319
+ # rebill_orders.fraud_score
320
+ # rebill_orders.gift
321
+ # rebill_orders.gift_certificate
322
+ # rebill_orders.internal
323
+ # rebill_orders.item
324
+ # rebill_orders.linked_shipment
325
+ # rebill_orders.marketing
326
+ # rebill_orders.payment
327
+ # rebill_orders.payment.transaction
328
+ # rebill_orders.quote
329
+ # rebill_orders.salesforce
330
+ # rebill_orders.shipping
331
+ # rebill_orders.summary
332
+ # rebill_orders.taxes
333
+
334
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
335
+ code = "RT2A9CBSX9"
336
+ api_response = auto_order_api.get_auto_order_by_code(code, { '_expand' => expand })
337
+ auto_order = api_response.auto_order
338
+
339
+ # this will be verbose...
340
+ puts auto_order.inspect
341
+ ```
342
+
343
+
344
+ #### Using the get_auto_order_by_code_with_http_info variant
345
+
346
+ This returns an Array which contains the response data, status code and headers.
347
+
348
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_code_with_http_info(auto_order_code, opts)
349
+
350
+ ```ruby
351
+ begin
352
+ # Retrieve an auto order by code
353
+ data, status_code, headers = api_instance.get_auto_order_by_code_with_http_info(auto_order_code, opts)
354
+ p status_code # => 2xx
355
+ p headers # => { ... }
356
+ p data # => <AutoOrderResponse>
357
+ rescue UltracartClient::ApiError => e
358
+ puts "Error when calling AutoOrderApi->get_auto_order_by_code_with_http_info: #{e}"
359
+ end
360
+ ```
361
+
362
+ ### Parameters
363
+
364
+ | Name | Type | Description | Notes |
365
+ | ---- | ---- | ----------- | ----- |
366
+ | **auto_order_code** | **String** | The auto order oid to retrieve. | |
367
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
368
+
369
+ ### Return type
370
+
371
+ [**AutoOrderResponse**](AutoOrderResponse.md)
372
+
373
+ ### Authorization
374
+
375
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
376
+
377
+ ### HTTP request headers
378
+
379
+ - **Content-Type**: Not defined
380
+ - **Accept**: application/json
381
+
382
+
383
+ ## get_auto_order_by_reference_order_id
384
+
385
+ > <AutoOrderResponse> get_auto_order_by_reference_order_id(reference_order_id, opts)
386
+
387
+ Retrieve an auto order by order id
388
+
389
+ Retrieves a single auto order using the specified reference (original) order id.
390
+
391
+
392
+ ### Examples
393
+
394
+ ```ruby
395
+ require 'ultracart_api'
396
+ require_relative '../constants'
397
+
398
+ # This example illustrates how to query an auto order when you know the original order id.
399
+
400
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
401
+
402
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
403
+ # and may become stale. Please review the master website when in doubt.
404
+ # items
405
+ # items.future_schedules
406
+ # items.sample_schedule
407
+ # original_order
408
+ # original_order.affiliate
409
+ # original_order.affiliate.ledger
410
+ # original_order.auto_order
411
+ # original_order.billing
412
+ # original_order.buysafe
413
+ # original_order.channel_partner
414
+ # original_order.checkout
415
+ # original_order.coupon
416
+ # original_order.customer_profile
417
+ # original_order.digital_order
418
+ # original_order.edi
419
+ # original_order.fraud_score
420
+ # original_order.gift
421
+ # original_order.gift_certificate
422
+ # original_order.internal
423
+ # original_order.item
424
+ # original_order.linked_shipment
425
+ # original_order.marketing
426
+ # original_order.payment
427
+ # original_order.payment.transaction
428
+ # original_order.quote
429
+ # original_order.salesforce
430
+ # original_order.shipping
431
+ # original_order.summary
432
+ # original_order.taxes
433
+ # rebill_orders
434
+ # rebill_orders.affiliate
435
+ # rebill_orders.affiliate.ledger
436
+ # rebill_orders.auto_order
437
+ # rebill_orders.billing
438
+ # rebill_orders.buysafe
439
+ # rebill_orders.channel_partner
440
+ # rebill_orders.checkout
441
+ # rebill_orders.coupon
442
+ # rebill_orders.customer_profile
443
+ # rebill_orders.digital_order
444
+ # rebill_orders.edi
445
+ # rebill_orders.fraud_score
446
+ # rebill_orders.gift
447
+ # rebill_orders.gift_certificate
448
+ # rebill_orders.internal
449
+ # rebill_orders.item
450
+ # rebill_orders.linked_shipment
451
+ # rebill_orders.marketing
452
+ # rebill_orders.payment
453
+ # rebill_orders.payment.transaction
454
+ # rebill_orders.quote
455
+ # rebill_orders.salesforce
456
+ # rebill_orders.shipping
457
+ # rebill_orders.summary
458
+ # rebill_orders.taxes
459
+
460
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
461
+ original_order_id = "DEMO-12345678"
462
+ api_response = auto_order_api.get_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
463
+ auto_order = api_response.auto_order
464
+
465
+ # this will be verbose...
466
+ puts auto_order.inspect
467
+ ```
468
+
469
+
470
+ #### Using the get_auto_order_by_reference_order_id_with_http_info variant
471
+
472
+ This returns an Array which contains the response data, status code and headers.
473
+
474
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
475
+
476
+ ```ruby
477
+ begin
478
+ # Retrieve an auto order by order id
479
+ data, status_code, headers = api_instance.get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
480
+ p status_code # => 2xx
481
+ p headers # => { ... }
482
+ p data # => <AutoOrderResponse>
483
+ rescue UltracartClient::ApiError => e
484
+ puts "Error when calling AutoOrderApi->get_auto_order_by_reference_order_id_with_http_info: #{e}"
485
+ end
486
+ ```
487
+
488
+ ### Parameters
489
+
490
+ | Name | Type | Description | Notes |
491
+ | ---- | ---- | ----------- | ----- |
492
+ | **reference_order_id** | **String** | The auto order oid to retrieve. | |
493
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
494
+
495
+ ### Return type
496
+
497
+ [**AutoOrderResponse**](AutoOrderResponse.md)
498
+
499
+ ### Authorization
500
+
501
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
502
+
503
+ ### HTTP request headers
504
+
505
+ - **Content-Type**: Not defined
506
+ - **Accept**: application/json
507
+
508
+
509
+ ## get_auto_orders
510
+
511
+ > <AutoOrdersResponse> get_auto_orders(opts)
512
+
513
+ Retrieve auto orders
514
+
515
+ Retrieves auto orders from the account. If no parameters are specified, all auto orders 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.
516
+
517
+
518
+ ### Examples
519
+
520
+ ```ruby
521
+ require 'ultracart_api'
522
+ require_relative '../constants'
523
+
524
+ # getAutoOrders provides a query service on AutoOrders (aka subscriptions or recurring orders) within the UltraCart
525
+ # system. It was the first query provided and the most cumbersome to use. Please use getAutoOrdersByQuery for an
526
+ # easier query method. If you have multiple auto_order_oids and need the corresponding objects, consider
527
+ # getAutoOrdersBatch() to reduce call count.
528
+
529
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
530
+
531
+ def get_auto_order_chunk(auto_order_api, offset, limit)
532
+ expand = "items,original_order,rebill_orders"
533
+ # see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
534
+ #
535
+ # Possible Order Expansions:
536
+ #
537
+ # add_ons items.sample_schedule original_order.buysafe original_order.payment.transaction
538
+ # items original_order original_order.channel_partner original_order.quote
539
+ # items.future_schedules original_order.affiliate original_order.checkout original_order.salesforce
540
+ # original_order.affiliate.ledger original_order.coupon original_order.shipping
541
+ # original_order.auto_order original_order.customer_profile original_order.summary
542
+ # original_order.billing original_order.digital_order original_order.taxes
543
+ # rebill_orders original_order.edi rebill_orders.affiliate
544
+ # rebill_orders.affiliate.ledger original_order.fraud_score rebill_orders.auto_order
545
+ # rebill_orders.billing original_order.gift rebill_orders.buysafe
546
+ # rebill_orders.channel_partner original_order.gift_certificate rebill_orders.checkout
547
+ # rebill_orders.coupon original_order.internal rebill_orders.customer_profile
548
+ # rebill_orders.digital_order original_order.item rebill_orders.edi
549
+ # rebill_orders.fraud_score original_order.linked_shipment rebill_orders.gift
550
+ # rebill_orders.gift_certificate original_order.marketing rebill_orders.internal
551
+ # rebill_orders.item original_order.payment rebill_orders.linked_shipment
552
+ # rebill_orders.marketing rebill_orders.payment rebill_orders.quote
553
+ # rebill_orders.payment.transaction rebill_orders.salesforce rebill_orders.shipping
554
+ # rebill_orders.summary rebill_orders.taxes
555
+
556
+ auto_order_code = nil
557
+ original_order_id = nil
558
+ first_name = nil
559
+ last_name = nil
560
+ company = nil
561
+ city = nil
562
+ state = nil
563
+ postal_code = nil
564
+ country_code = nil
565
+ phone = nil
566
+ email = 'test@ultracart.com' # <-- for this example, we are only filtering on email address.
567
+ original_order_date_begin = nil
568
+ original_order_date_end = nil
569
+ next_shipment_date_begin = nil
570
+ next_shipment_date_end = nil
571
+ card_type = nil
572
+ item_id = nil
573
+ status = nil
574
+ since = nil
575
+ sort = nil
576
+
577
+ # see all these parameters? that is why you should use getAutoOrdersByQuery() instead of getAutoOrders()
578
+ api_response = auto_order_api.get_auto_orders(auto_order_code, original_order_id, first_name, last_name,
579
+ company, city, state, postal_code, country_code, phone, email, original_order_date_begin,
580
+ original_order_date_end, next_shipment_date_begin, next_shipment_date_end, card_type, item_id, status,
581
+ limit, offset, since, sort, { '_expand' => expand })
582
+
583
+ api_response.auto_orders || []
584
+ end
585
+
586
+ auto_orders = []
587
+
588
+ iteration = 1
589
+ offset = 0
590
+ limit = 200
591
+ ```
592
+
593
+
594
+ #### Using the get_auto_orders_with_http_info variant
595
+
596
+ This returns an Array which contains the response data, status code and headers.
597
+
598
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_with_http_info(opts)
599
+
600
+ ```ruby
601
+ begin
602
+ # Retrieve auto orders
603
+ data, status_code, headers = api_instance.get_auto_orders_with_http_info(opts)
604
+ p status_code # => 2xx
605
+ p headers # => { ... }
606
+ p data # => <AutoOrdersResponse>
607
+ rescue UltracartClient::ApiError => e
608
+ puts "Error when calling AutoOrderApi->get_auto_orders_with_http_info: #{e}"
609
+ end
610
+ ```
611
+
612
+ ### Parameters
613
+
614
+ | Name | Type | Description | Notes |
615
+ | ---- | ---- | ----------- | ----- |
616
+ | **auto_order_code** | **String** | Auto order code | [optional] |
617
+ | **original_order_id** | **String** | Original order id | [optional] |
618
+ | **first_name** | **String** | First name | [optional] |
619
+ | **last_name** | **String** | Last name | [optional] |
620
+ | **company** | **String** | Company | [optional] |
621
+ | **city** | **String** | City | [optional] |
622
+ | **state** | **String** | State | [optional] |
623
+ | **postal_code** | **String** | Postal code | [optional] |
624
+ | **country_code** | **String** | Country code (ISO-3166 two letter) | [optional] |
625
+ | **phone** | **String** | Phone | [optional] |
626
+ | **email** | **String** | Email | [optional] |
627
+ | **original_order_date_begin** | **String** | Original order date begin | [optional] |
628
+ | **original_order_date_end** | **String** | Original order date end | [optional] |
629
+ | **next_shipment_date_begin** | **String** | Next shipment date begin | [optional] |
630
+ | **next_shipment_date_end** | **String** | Next shipment date end | [optional] |
631
+ | **card_type** | **String** | Card type | [optional] |
632
+ | **item_id** | **String** | Item ID | [optional] |
633
+ | **status** | **String** | Status | [optional] |
634
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
635
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
636
+ | **_since** | **String** | Fetch auto orders that have been created/modified since this date/time. | [optional] |
637
+ | **_sort** | **String** | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
638
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
639
+
640
+ ### Return type
641
+
642
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
643
+
644
+ ### Authorization
645
+
646
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
647
+
648
+ ### HTTP request headers
649
+
650
+ - **Content-Type**: Not defined
651
+ - **Accept**: application/json
652
+
653
+
654
+ ## get_auto_orders_batch
655
+
656
+ > <AutoOrdersResponse> get_auto_orders_batch(auto_order_batch, opts)
657
+
658
+ Retrieve auto order batch
659
+
660
+ Retrieves a group of auto orders from the account based on an array of auto order oids. If more than 200 auto order ids are specified, the API call will fail with a bad request error.
661
+
662
+
663
+ ### Examples
664
+
665
+ ```ruby
666
+ require 'ultracart_api'
667
+ require_relative '../constants'
668
+
669
+ # This example illustrates how to retrieve auto orders when you have a list of auto_order_oid.
670
+
671
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
672
+
673
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
674
+ # and may become stale. Please review the master website when in doubt.
675
+ # items
676
+ # items.future_schedules
677
+ # items.sample_schedule
678
+ # original_order
679
+ # original_order.affiliate
680
+ # original_order.affiliate.ledger
681
+ # original_order.auto_order
682
+ # original_order.billing
683
+ # original_order.buysafe
684
+ # original_order.channel_partner
685
+ # original_order.checkout
686
+ # original_order.coupon
687
+ # original_order.customer_profile
688
+ # original_order.digital_order
689
+ # original_order.edi
690
+ # original_order.fraud_score
691
+ # original_order.gift
692
+ # original_order.gift_certificate
693
+ # original_order.internal
694
+ # original_order.item
695
+ # original_order.linked_shipment
696
+ # original_order.marketing
697
+ # original_order.payment
698
+ # original_order.payment.transaction
699
+ # original_order.quote
700
+ # original_order.salesforce
701
+ # original_order.shipping
702
+ # original_order.summary
703
+ # original_order.taxes
704
+ # rebill_orders
705
+ # rebill_orders.affiliate
706
+ # rebill_orders.affiliate.ledger
707
+ # rebill_orders.auto_order
708
+ # rebill_orders.billing
709
+ # rebill_orders.buysafe
710
+ # rebill_orders.channel_partner
711
+ # rebill_orders.checkout
712
+ # rebill_orders.coupon
713
+ # rebill_orders.customer_profile
714
+ # rebill_orders.digital_order
715
+ # rebill_orders.edi
716
+ # rebill_orders.fraud_score
717
+ # rebill_orders.gift
718
+ # rebill_orders.gift_certificate
719
+ # rebill_orders.internal
720
+ # rebill_orders.item
721
+ # rebill_orders.linked_shipment
722
+ # rebill_orders.marketing
723
+ # rebill_orders.payment
724
+ # rebill_orders.payment.transaction
725
+ # rebill_orders.quote
726
+ # rebill_orders.salesforce
727
+ # rebill_orders.shipping
728
+ # rebill_orders.summary
729
+ # rebill_orders.taxes
730
+
731
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
732
+ auto_order_oids = [123456, 234567, 345678, 456789]
733
+ batch_request = UltracartClient::AutoOrderQueryBatch.new
734
+ batch_request.auto_order_oids = auto_order_oids
735
+ api_response = auto_order_api.get_auto_orders_batch(batch_request, { '_expand' => expand })
736
+ auto_orders = api_response.auto_orders
737
+
738
+ # this will be verbose...
739
+ puts auto_orders.inspect
740
+ ```
741
+
742
+
743
+ #### Using the get_auto_orders_batch_with_http_info variant
744
+
745
+ This returns an Array which contains the response data, status code and headers.
746
+
747
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_batch_with_http_info(auto_order_batch, opts)
748
+
749
+ ```ruby
750
+ begin
751
+ # Retrieve auto order batch
752
+ data, status_code, headers = api_instance.get_auto_orders_batch_with_http_info(auto_order_batch, opts)
753
+ p status_code # => 2xx
754
+ p headers # => { ... }
755
+ p data # => <AutoOrdersResponse>
756
+ rescue UltracartClient::ApiError => e
757
+ puts "Error when calling AutoOrderApi->get_auto_orders_batch_with_http_info: #{e}"
758
+ end
759
+ ```
760
+
761
+ ### Parameters
762
+
763
+ | Name | Type | Description | Notes |
764
+ | ---- | ---- | ----------- | ----- |
765
+ | **auto_order_batch** | [**AutoOrderQueryBatch**](AutoOrderQueryBatch.md) | Auto order batch | |
766
+ | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
767
+
768
+ ### Return type
769
+
770
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
771
+
772
+ ### Authorization
773
+
774
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
775
+
776
+ ### HTTP request headers
777
+
778
+ - **Content-Type**: application/json
779
+ - **Accept**: application/json
780
+
781
+
782
+ ## get_auto_orders_by_query
783
+
784
+ > <AutoOrdersResponse> get_auto_orders_by_query(auto_order_query, opts)
785
+
786
+ Retrieve auto orders by query
787
+
788
+ Retrieves a group of auto orders from the account based on a query object. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
789
+
790
+
791
+ ### Examples
792
+
793
+ ```ruby
794
+ require 'ultracart_api'
795
+ require_relative '../constants'
796
+
797
+ # This example illustrates how to retrieve auto orders and handle pagination.
798
+
799
+ # Initialize the API
800
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
801
+
802
+ def get_auto_order_chunk(auto_order_api, offset, limit)
803
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
804
+ # and may become stale. Please review the master website when in doubt.
805
+ # items
806
+ # items.future_schedules
807
+ # items.sample_schedule
808
+ # original_order
809
+ # original_order.affiliate
810
+ # original_order.affiliate.ledger
811
+ # original_order.auto_order
812
+ # original_order.billing
813
+ # original_order.buysafe
814
+ # original_order.channel_partner
815
+ # original_order.checkout
816
+ # original_order.coupon
817
+ # original_order.customer_profile
818
+ # original_order.digital_order
819
+ # original_order.edi
820
+ # original_order.fraud_score
821
+ # original_order.gift
822
+ # original_order.gift_certificate
823
+ # original_order.internal
824
+ # original_order.item
825
+ # original_order.linked_shipment
826
+ # original_order.marketing
827
+ # original_order.payment
828
+ # original_order.payment.transaction
829
+ # original_order.quote
830
+ # original_order.salesforce
831
+ # original_order.shipping
832
+ # original_order.summary
833
+ # original_order.taxes
834
+ # rebill_orders
835
+ # rebill_orders.affiliate
836
+ # rebill_orders.affiliate.ledger
837
+ # rebill_orders.auto_order
838
+ # rebill_orders.billing
839
+ # rebill_orders.buysafe
840
+ # rebill_orders.channel_partner
841
+ # rebill_orders.checkout
842
+ # rebill_orders.coupon
843
+ # rebill_orders.customer_profile
844
+ # rebill_orders.digital_order
845
+ # rebill_orders.edi
846
+ # rebill_orders.fraud_score
847
+ # rebill_orders.gift
848
+ # rebill_orders.gift_certificate
849
+ # rebill_orders.internal
850
+ # rebill_orders.item
851
+ # rebill_orders.linked_shipment
852
+ # rebill_orders.marketing
853
+ # rebill_orders.payment
854
+ # rebill_orders.payment.transaction
855
+ # rebill_orders.quote
856
+ # rebill_orders.salesforce
857
+ # rebill_orders.shipping
858
+ # rebill_orders.summary
859
+ # rebill_orders.taxes
860
+
861
+ # contact us if you're unsure what you need
862
+ expand = "items,items.future_schedules,original_order,rebill_orders"
863
+
864
+ # These are the supported sorting fields:
865
+ # auto_order_code
866
+ # order_id
867
+ # shipping.company
868
+ # shipping.first_name
869
+ # shipping.last_name
870
+ # shipping.city
871
+ # shipping.state_region
872
+ # shipping.postal_code
873
+ # shipping.country_code
874
+ # billing.phone
875
+ # billing.email
876
+ # billing.cc_email
877
+ # billing.company
878
+ # billing.first_name
879
+ # billing.last_name
880
+ # billing.city
881
+ # billing.state
882
+ # billing.postal_code
883
+ # billing.country_code
884
+ # creation_dts
885
+ # payment.payment_dts
886
+ # checkout.screen_branding_theme_code
887
+ # next_shipment_dts
888
+
889
+ query = UltracartClient::AutoOrderQuery.new
890
+ query.email = "support@ultracart.com"
891
+
892
+ opts = {
893
+ _limit: limit,
894
+ _offset: offset,
895
+ _sort: "next_shipment_dts",
896
+ _expand: expand
897
+ }
898
+
899
+ api_response = auto_order_api.get_auto_orders_by_query(query, opts)
900
+
901
+ return [] if api_response.auto_orders.nil?
902
+ api_response.auto_orders
903
+ end
904
+
905
+ auto_orders = []
906
+ iteration = 1
907
+ offset = 0
908
+ limit = 200
909
+ more_records_to_fetch = true
910
+
911
+ begin
912
+ while more_records_to_fetch
913
+ puts "executing iteration #{iteration}"
914
+
915
+ chunk_of_orders = get_auto_order_chunk(auto_order_api, offset, limit)
916
+ auto_orders.concat(chunk_of_orders)
917
+ offset += limit
918
+ more_records_to_fetch = chunk_of_orders.length == limit
919
+ iteration += 1
920
+ end
921
+ rescue UltracartClient::ApiError => e
922
+ puts "ApiError occurred on iteration #{iteration}"
923
+ puts e.inspect
924
+ exit 1
925
+ end
926
+
927
+ # this will be verbose...
928
+ puts auto_orders.inspect
929
+ ```
930
+
931
+
932
+ #### Using the get_auto_orders_by_query_with_http_info variant
933
+
934
+ This returns an Array which contains the response data, status code and headers.
935
+
936
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_by_query_with_http_info(auto_order_query, opts)
937
+
938
+ ```ruby
939
+ begin
940
+ # Retrieve auto orders by query
941
+ data, status_code, headers = api_instance.get_auto_orders_by_query_with_http_info(auto_order_query, opts)
942
+ p status_code # => 2xx
943
+ p headers # => { ... }
944
+ p data # => <AutoOrdersResponse>
945
+ rescue UltracartClient::ApiError => e
946
+ puts "Error when calling AutoOrderApi->get_auto_orders_by_query_with_http_info: #{e}"
947
+ end
948
+ ```
949
+
950
+ ### Parameters
951
+
952
+ | Name | Type | Description | Notes |
953
+ | ---- | ---- | ----------- | ----- |
954
+ | **auto_order_query** | [**AutoOrderQuery**](AutoOrderQuery.md) | Auto order query | |
955
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Maximum 200) | [optional][default to 100] |
956
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
957
+ | **_sort** | **String** | The sort order of the auto orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
958
+ | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
959
+
960
+ ### Return type
961
+
962
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
963
+
964
+ ### Authorization
965
+
966
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
967
+
968
+ ### HTTP request headers
969
+
970
+ - **Content-Type**: application/json
971
+ - **Accept**: application/json
972
+
973
+
974
+ ## pause_auto_order
975
+
976
+ > <AutoOrderResponse> pause_auto_order(auto_order_oid, auto_order, opts)
977
+
978
+ Pause auto order
979
+
980
+ Completely pause an auto order
981
+
982
+
983
+ ### Examples
984
+
985
+ ```ruby
986
+ # This is a convenience method created for an UltraCart merchant to pause a large number of auto orders
987
+ # due to an inventory shortage. This is not new functionality and can be accomplished with the normal updateAutoOrder
988
+ # call. It does the following logic to an auto order:
989
+ # for each item in the auto order:
990
+ # if the item is not paused, pause it, setPause(true)
991
+ # save the changes by calling updateAutoOrder()
992
+ #
993
+ # Some warnings if you choose to use this method.
994
+ # There are no convenience methods to unpause auto orders.
995
+ # There are no convenience methods to query which auto orders are paused.
996
+ # We do not recommend pausing auto orders and the merchant is on their own to manage auto order state if they
997
+ # choose to begin pausing orders. Keep good track of what you're doing.
998
+
999
+ require_relative '../constants'
1000
+ require 'ultracart_api'
1001
+
1002
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1003
+
1004
+ expand = "items" # see https://www.ultracart.com/api/#resource_auto_order.html for list
1005
+ auto_order_oid = 123456789 # get an auto order and update it. There are many ways to retrieve an auto order.
1006
+ get_response = auto_order_api.get_auto_order(auto_order_oid, {_expand: expand})
1007
+ auto_order = get_response.auto_order
1008
+
1009
+ pause_response = auto_order_api.pause_auto_order(auto_order_oid, auto_order)
1010
+ paused_auto_order = pause_response.auto_order
1011
+ puts paused_auto_order.inspect
1012
+ ```
1013
+
1014
+
1015
+ #### Using the pause_auto_order_with_http_info variant
1016
+
1017
+ This returns an Array which contains the response data, status code and headers.
1018
+
1019
+ > <Array(<AutoOrderResponse>, Integer, Hash)> pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1020
+
1021
+ ```ruby
1022
+ begin
1023
+ # Pause auto order
1024
+ data, status_code, headers = api_instance.pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1025
+ p status_code # => 2xx
1026
+ p headers # => { ... }
1027
+ p data # => <AutoOrderResponse>
1028
+ rescue UltracartClient::ApiError => e
1029
+ puts "Error when calling AutoOrderApi->pause_auto_order_with_http_info: #{e}"
1030
+ end
1031
+ ```
1032
+
1033
+ ### Parameters
1034
+
1035
+ | Name | Type | Description | Notes |
1036
+ | ---- | ---- | ----------- | ----- |
1037
+ | **auto_order_oid** | **Integer** | The auto order oid to pause. | |
1038
+ | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to pause | |
1039
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1040
+
1041
+ ### Return type
1042
+
1043
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1044
+
1045
+ ### Authorization
1046
+
1047
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1048
+
1049
+ ### HTTP request headers
1050
+
1051
+ - **Content-Type**: application/json; charset=UTF-8
1052
+ - **Accept**: application/json
1053
+
1054
+
1055
+ ## update_auto_order
1056
+
1057
+ > <AutoOrderResponse> update_auto_order(auto_order_oid, auto_order, opts)
1058
+
1059
+ Update an auto order
1060
+
1061
+ Update an auto order on the UltraCart account.
1062
+
1063
+
1064
+ ### Examples
1065
+
1066
+ ```ruby
1067
+ # frozen_string_literal: true
1068
+
1069
+ # Rules for updating auto orders (recurring orders)
1070
+ # To change the item that is delivered, change the AutoOrder.items[x].arbitrary_item_id
1071
+ # To change the schedule (frequency) of when an item is delivered, change the original item. It controls schedule
1072
+ # To change the original item: AutoOrder.items[x].original_item_id
1073
+ #
1074
+ # Alternate method: Replace the item altogether. Delete the current one and replace it with another item
1075
+ # Note: The replacement item must be an auto order item. (Edit item in backend, click on Auto Order tab)
1076
+ # This is more complex as you must supply all the required fields.
1077
+
1078
+ require 'json'
1079
+ require 'ultracart_api'
1080
+
1081
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
1082
+ # ao is short for 'auto order', and is used heavily below.
1083
+ ao_api = UltracartClient::AutoOrderApi.new_using_api_key(simple_key, false, false)
1084
+ email = 'test@test.com'
1085
+
1086
+
1087
+ query = UltracartClient::AutoOrderQuery.new
1088
+ query.email = email
1089
+ expansion = 'items,items.future_schedules,items.simple_schedule,rebill_orders'
1090
+ ao_response = ao_api.get_auto_orders_by_query(query, { _expand: expansion })
1091
+
1092
+ # there should only be one auto order for a customer. that's typical.
1093
+ # If you are marketing more than one, than you must loop through the result set
1094
+ # and find the auto order you're looking for manually
1095
+
1096
+ auto_order = ao_response.auto_orders[0]
1097
+
1098
+ existing_item = 'OldItemID'
1099
+ upgrade_item = 'NewItemID'
1100
+
1101
+ auto_order.items.each do |auto_order_item|
1102
+ auto_order_item.arbitrary_item_id = upgrade_item if auto_order_item.original_item_id = existing_item
1103
+ end
1104
+
1105
+ # save the auto order with the updated item.
1106
+ ao_api.update_auto_order(auto_order, auto_order.auto_order_oid, { _expand: expansion })
1107
+
1108
+
1109
+
1110
+
1111
+ ```
1112
+
1113
+
1114
+ #### Using the update_auto_order_with_http_info variant
1115
+
1116
+ This returns an Array which contains the response data, status code and headers.
1117
+
1118
+ > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1119
+
1120
+ ```ruby
1121
+ begin
1122
+ # Update an auto order
1123
+ data, status_code, headers = api_instance.update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1124
+ p status_code # => 2xx
1125
+ p headers # => { ... }
1126
+ p data # => <AutoOrderResponse>
1127
+ rescue UltracartClient::ApiError => e
1128
+ puts "Error when calling AutoOrderApi->update_auto_order_with_http_info: #{e}"
1129
+ end
1130
+ ```
1131
+
1132
+ ### Parameters
1133
+
1134
+ | Name | Type | Description | Notes |
1135
+ | ---- | ---- | ----------- | ----- |
1136
+ | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1137
+ | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to update | |
1138
+ | **validate_original_order** | **String** | Validate original order before updating | [optional] |
1139
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1140
+
1141
+ ### Return type
1142
+
1143
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1144
+
1145
+ ### Authorization
1146
+
1147
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1148
+
1149
+ ### HTTP request headers
1150
+
1151
+ - **Content-Type**: application/json; charset=UTF-8
1152
+ - **Accept**: application/json
1153
+
1154
+
1155
+ ## update_auto_orders_batch
1156
+
1157
+ > <AutoOrdersResponse> update_auto_orders_batch(auto_orders_request, opts)
1158
+
1159
+ Update multiple auto orders
1160
+
1161
+ Update multiple auto orders on the UltraCart account.
1162
+
1163
+
1164
+ ### Examples
1165
+
1166
+ ```ruby
1167
+ require 'ultracart_api'
1168
+ require_relative '../constants'
1169
+
1170
+ # This method allows for updating multiple auto orders.
1171
+ # Warning: Take great care editing auto orders. They are complex.
1172
+ # Sometimes you must change the original_order to affect the auto_order. If you have questions about what fields
1173
+ # to update to achieve your desired change, contact UltraCart support. Better to ask and get it right than to
1174
+ # make a bad assumption and corrupt a thousand auto orders. UltraCart support is ready to assist.
1175
+
1176
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1177
+
1178
+ # The _async parameter is what it seems. True if async.
1179
+ # The max records allowed depends on the async flag. Synch max is 20, Asynch max is 100.
1180
+
1181
+ # if true, success returns back a 204 No Content. False returns back the updated orders.
1182
+ async = true
1183
+
1184
+ # since we're async, nothing is returned, so we don't care about expansions.
1185
+ # If you are doing a synchronous operation, then set your expand appropriately. set get_auto_orders
1186
+ # sample for expansion samples.
1187
+ expand = nil
1188
+
1189
+ # mostly used for UI, not needed for a pure scripting operation.
1190
+ placeholders = false
1191
+
1192
+ # TODO: This should be an array of auto orders that have been updated. See any get_auto_orders method for retrieval.
1193
+ auto_orders = []
1194
+
1195
+ auto_orders_request = UltracartClient::AutoOrdersRequest.new
1196
+ auto_orders_request.auto_orders = auto_orders
1197
+
1198
+ opts = {
1199
+ _expand: expand,
1200
+ _placeholders: placeholders,
1201
+ _async: async
1202
+ }
1203
+
1204
+ api_response = auto_order_api.update_auto_orders_batch(auto_orders_request, opts)
1205
+
1206
+ # something went wrong if we have a response.
1207
+ puts api_response.inspect unless api_response.nil?
1208
+ ```
1209
+
1210
+
1211
+ #### Using the update_auto_orders_batch_with_http_info variant
1212
+
1213
+ This returns an Array which contains the response data, status code and headers.
1214
+
1215
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1216
+
1217
+ ```ruby
1218
+ begin
1219
+ # Update multiple auto orders
1220
+ data, status_code, headers = api_instance.update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1221
+ p status_code # => 2xx
1222
+ p headers # => { ... }
1223
+ p data # => <AutoOrdersResponse>
1224
+ rescue UltracartClient::ApiError => e
1225
+ puts "Error when calling AutoOrderApi->update_auto_orders_batch_with_http_info: #{e}"
1226
+ end
1227
+ ```
1228
+
1229
+ ### Parameters
1230
+
1231
+ | Name | Type | Description | Notes |
1232
+ | ---- | ---- | ----------- | ----- |
1233
+ | **auto_orders_request** | [**AutoOrdersRequest**](AutoOrdersRequest.md) | Auto orders to update (synchronous maximum 20 / asynchronous maximum 100) | |
1234
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1235
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1236
+ | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
1237
+
1238
+ ### Return type
1239
+
1240
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
1241
+
1242
+ ### Authorization
1243
+
1244
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1245
+
1246
+ ### HTTP request headers
1247
+
1248
+ - **Content-Type**: application/json; charset=UTF-8
1249
+ - **Accept**: application/json
1250
+