ultracart_api 4.1.163 → 4.1.166

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +201 -201
  3. data/README.md +611 -602
  4. data/docs/AffiliateApi.md +455 -455
  5. data/docs/AutoOrderApi.md +1694 -1694
  6. data/docs/BulkApi.md +335 -335
  7. data/docs/ChannelPartnerApi.md +1678 -1678
  8. data/docs/CheckoutApi.md +1622 -1622
  9. data/docs/ConversationApi.md +7867 -7867
  10. data/docs/ConversationEmbedApi.md +226 -226
  11. data/docs/CouponApi.md +1522 -1522
  12. data/docs/CustomerApi.md +2849 -2849
  13. data/docs/DatawarehouseApi.md +1637 -1637
  14. data/docs/EmailCommseqEmailReviewStatus.md +32 -0
  15. data/docs/EmailCommseqEmailReviewStatusResponse.md +26 -0
  16. data/docs/EmailCommseqEmailReviewStatusesRequest.md +18 -0
  17. data/docs/EmailCommseqEmailReviewStatusesResponse.md +26 -0
  18. data/docs/FraudApi.md +332 -332
  19. data/docs/FulfillmentApi.md +567 -567
  20. data/docs/GiftCertificateApi.md +617 -617
  21. data/docs/IntegrationLogApi.md +290 -290
  22. data/docs/ItemApi.md +2502 -2502
  23. data/docs/OauthApi.md +311 -311
  24. data/docs/OrderApi.md +3396 -3396
  25. data/docs/SfvbApi.md +3883 -3883
  26. data/docs/SsoApi.md +223 -223
  27. data/docs/StorefrontApi.md +10143 -10035
  28. data/docs/TaxApi.md +1699 -1699
  29. data/docs/UserApi.md +606 -606
  30. data/docs/WebhookApi.md +840 -840
  31. data/docs/WorkflowApi.md +666 -666
  32. data/lib/ultracart_api/api/storefront_api.rb +143 -0
  33. data/lib/ultracart_api/models/email_commseq_email_review_status.rb +324 -0
  34. data/lib/ultracart_api/models/email_commseq_email_review_status_response.rb +256 -0
  35. data/lib/ultracart_api/models/email_commseq_email_review_statuses_request.rb +222 -0
  36. data/lib/ultracart_api/models/email_commseq_email_review_statuses_response.rb +258 -0
  37. data/lib/ultracart_api/version.rb +1 -1
  38. data/lib/ultracart_api.rb +4 -0
  39. metadata +11 -3
data/docs/AutoOrderApi.md CHANGED
@@ -1,1694 +1,1694 @@
1
- # UltracartClient::AutoOrderApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**attempt_auto_order_rebill**](AutoOrderApi.md#attempt_auto_order_rebill) | **POST** /auto_order/auto_orders/{auto_order_oid}/rebill | Attempt a failed rebill on an auto order |
8
- | [**cancel_auto_order_item_by_reference_order_id**](AutoOrderApi.md#cancel_auto_order_item_by_reference_order_id) | **POST** /auto_order/auto_orders/reference_order_id/{reference_order_id}/items/original/{original_item_id}/cancel | Cancel a single item on an auto order |
9
- | [**consolidate_auto_orders**](AutoOrderApi.md#consolidate_auto_orders) | **PUT** /auto_order/auto_orders/{auto_order_oid}/consolidate | Consolidates multiple auto orders |
10
- | [**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 |
11
- | [**get_auto_order**](AutoOrderApi.md#get_auto_order) | **GET** /auto_order/auto_orders/{auto_order_oid} | Retrieve an auto order by oid |
12
- | [**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 |
13
- | [**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 |
14
- | [**get_auto_order_cancel_reasons**](AutoOrderApi.md#get_auto_order_cancel_reasons) | **GET** /auto_order/auto_orders/cancel_reasons | Retrieve auto order cancel reasons. |
15
- | [**get_auto_order_emails**](AutoOrderApi.md#get_auto_order_emails) | **GET** /auto_order/auto_orders/{auto_order_oid}/emails | Retrieve email delivery information for this auto order. |
16
- | [**get_auto_orders**](AutoOrderApi.md#get_auto_orders) | **GET** /auto_order/auto_orders | Retrieve auto orders |
17
- | [**get_auto_orders_batch**](AutoOrderApi.md#get_auto_orders_batch) | **POST** /auto_order/auto_orders/batch | Retrieve auto order batch |
18
- | [**get_auto_orders_by_query**](AutoOrderApi.md#get_auto_orders_by_query) | **POST** /auto_order/auto_orders/query | Retrieve auto orders by query |
19
- | [**pause_auto_order**](AutoOrderApi.md#pause_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid}/pause | Pause auto order |
20
- | [**update_auto_order**](AutoOrderApi.md#update_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid} | Update an auto order |
21
- | [**update_auto_order_item_add_ons**](AutoOrderApi.md#update_auto_order_item_add_ons) | **PUT** /auto_order/auto_orders/{auto_order_oid}/items/{auto_order_item_oid}/add_ons | Update an auto order item add ons |
22
- | [**update_auto_order_item_properties**](AutoOrderApi.md#update_auto_order_item_properties) | **PUT** /auto_order/auto_orders/{auto_order_oid}/items/{auto_order_item_oid}/properties | Update an auto order item properties |
23
- | [**update_auto_order_payment**](AutoOrderApi.md#update_auto_order_payment) | **PUT** /auto_order/auto_orders/{auto_order_oid}/payment | Update the payment information on an auto order |
24
- | [**update_auto_order_properties**](AutoOrderApi.md#update_auto_order_properties) | **PUT** /auto_order/auto_orders/{auto_order_oid}/properties | Update an auto order properties |
25
- | [**update_auto_orders_batch**](AutoOrderApi.md#update_auto_orders_batch) | **PUT** /auto_order/auto_orders/batch | Update multiple auto orders |
26
-
27
-
28
- ## attempt_auto_order_rebill
29
-
30
- > <AutoOrderRebillResponse> attempt_auto_order_rebill(auto_order_oid, opts)
31
-
32
- Attempt a failed rebill on an auto order
33
-
34
- Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
35
-
36
-
37
- ### Examples
38
-
39
-
40
- (No example for this operation).
41
-
42
-
43
- #### Using the attempt_auto_order_rebill_with_http_info variant
44
-
45
- This returns an Array which contains the response data, status code and headers.
46
-
47
- > <Array(<AutoOrderRebillResponse>, Integer, Hash)> attempt_auto_order_rebill_with_http_info(auto_order_oid, opts)
48
-
49
- ```ruby
50
- begin
51
- # Attempt a failed rebill on an auto order
52
- data, status_code, headers = api_instance.attempt_auto_order_rebill_with_http_info(auto_order_oid, opts)
53
- p status_code # => 2xx
54
- p headers # => { ... }
55
- p data # => <AutoOrderRebillResponse>
56
- rescue UltracartClient::ApiError => e
57
- puts "Error when calling AutoOrderApi->attempt_auto_order_rebill_with_http_info: #{e}"
58
- end
59
- ```
60
-
61
- ### Parameters
62
-
63
- | Name | Type | Description | Notes |
64
- | ---- | ---- | ----------- | ----- |
65
- | **auto_order_oid** | **Integer** | The auto order oid to rebill. | |
66
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
67
-
68
- ### Return type
69
-
70
- [**AutoOrderRebillResponse**](AutoOrderRebillResponse.md)
71
-
72
- ### Authorization
73
-
74
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
75
-
76
- ### HTTP request headers
77
-
78
- - **Content-Type**: Not defined
79
- - **Accept**: application/json
80
-
81
-
82
- ## cancel_auto_order_item_by_reference_order_id
83
-
84
- > <AutoOrderResponse> cancel_auto_order_item_by_reference_order_id(reference_order_id, original_item_id, opts)
85
-
86
- Cancel a single item on an auto order
87
-
88
- Cancels a single item on an auto order identified by the original order id and the item's original_item_id. The request body may specify mode=_end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
89
-
90
-
91
- ### Examples
92
-
93
-
94
- (No example for this operation).
95
-
96
-
97
- #### Using the cancel_auto_order_item_by_reference_order_id_with_http_info variant
98
-
99
- This returns an Array which contains the response data, status code and headers.
100
-
101
- > <Array(<AutoOrderResponse>, Integer, Hash)> cancel_auto_order_item_by_reference_order_id_with_http_info(reference_order_id, original_item_id, opts)
102
-
103
- ```ruby
104
- begin
105
- # Cancel a single item on an auto order
106
- data, status_code, headers = api_instance.cancel_auto_order_item_by_reference_order_id_with_http_info(reference_order_id, original_item_id, opts)
107
- p status_code # => 2xx
108
- p headers # => { ... }
109
- p data # => <AutoOrderResponse>
110
- rescue UltracartClient::ApiError => e
111
- puts "Error when calling AutoOrderApi->cancel_auto_order_item_by_reference_order_id_with_http_info: #{e}"
112
- end
113
- ```
114
-
115
- ### Parameters
116
-
117
- | Name | Type | Description | Notes |
118
- | ---- | ---- | ----------- | ----- |
119
- | **reference_order_id** | **String** | The reference order id (original_order_id) of the auto order. | |
120
- | **original_item_id** | **String** | The original_item_id (SKU) of the item to cancel. | |
121
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
122
- | **auto_order_item_cancel_request** | [**AutoOrderItemCancelRequest**](AutoOrderItemCancelRequest.md) | Cancel request. Body is optional; omit for default mode&#x3D;_end. | [optional] |
123
-
124
- ### Return type
125
-
126
- [**AutoOrderResponse**](AutoOrderResponse.md)
127
-
128
- ### Authorization
129
-
130
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
131
-
132
- ### HTTP request headers
133
-
134
- - **Content-Type**: application/json; charset=UTF-8
135
- - **Accept**: application/json
136
-
137
-
138
- ## consolidate_auto_orders
139
-
140
- > <AutoOrderResponse> consolidate_auto_orders(auto_order_oid, auto_order_consolidate, opts)
141
-
142
- Consolidates multiple auto orders
143
-
144
- Consolidates mutliple auto orders on the UltraCart account.
145
-
146
-
147
- ### Examples
148
-
149
- ```ruby
150
- require 'ultracart_api'
151
- require_relative '../constants'
152
-
153
- # consolidateAutoOrders
154
- # an auto order with no items, the original_order is used for shipping, billing, and payment information.
155
- # Once you have your empty auto order, add items to it and call updateAutoOrder.
156
-
157
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
158
-
159
- # see https://www.ultracart.com/api/#resource_auto_order.html for list
160
- expand = "items,items.future_schedules,original_order,rebill_orders"
161
-
162
- target_auto_order_oid = 123456789 # set getAutoOrdersByQuery for retrieving auto orders where you can get their auto_order_oid.
163
- consolidate_request = UltracartClient::AutoOrderConsolidate.new
164
- consolidate_request.source_auto_order_oids = [23456789, 3456789] # these are the autoorder_oids you wish to consolidate into the target.
165
-
166
- api_response = auto_order_api.consolidate_auto_orders(target_auto_order_oid, consolidate_request, { '_expand' => expand })
167
-
168
- consolidated_auto_order = api_response.auto_order
169
-
170
- # TODO: make sure the consolidated order has all the items and history of all orders.
171
- puts consolidated_auto_order.inspect
172
- ```
173
-
174
-
175
- #### Using the consolidate_auto_orders_with_http_info variant
176
-
177
- This returns an Array which contains the response data, status code and headers.
178
-
179
- > <Array(<AutoOrderResponse>, Integer, Hash)> consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
180
-
181
- ```ruby
182
- begin
183
- # Consolidates multiple auto orders
184
- data, status_code, headers = api_instance.consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
185
- p status_code # => 2xx
186
- p headers # => { ... }
187
- p data # => <AutoOrderResponse>
188
- rescue UltracartClient::ApiError => e
189
- puts "Error when calling AutoOrderApi->consolidate_auto_orders_with_http_info: #{e}"
190
- end
191
- ```
192
-
193
- ### Parameters
194
-
195
- | Name | Type | Description | Notes |
196
- | ---- | ---- | ----------- | ----- |
197
- | **auto_order_oid** | **Integer** | The auto order oid to consolidate into. | |
198
- | **auto_order_consolidate** | [**AutoOrderConsolidate**](AutoOrderConsolidate.md) | Auto orders to consolidate | |
199
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
200
-
201
- ### Return type
202
-
203
- [**AutoOrderResponse**](AutoOrderResponse.md)
204
-
205
- ### Authorization
206
-
207
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
208
-
209
- ### HTTP request headers
210
-
211
- - **Content-Type**: application/json; charset=UTF-8
212
- - **Accept**: application/json
213
-
214
-
215
- ## establish_auto_order_by_reference_order_id
216
-
217
- > <AutoOrderResponse> establish_auto_order_by_reference_order_id(reference_order_id, opts)
218
-
219
- Establish an auto order by referencing a regular order id
220
-
221
- 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.
222
-
223
-
224
- ### Examples
225
-
226
- ```ruby
227
- require 'ultracart_api'
228
- require_relative '../constants'
229
-
230
- # This method takes a normal order id and creates an empty auto order from it. While this might seem useless having
231
- # an auto order with no items, the original_order is used for shipping, billing, and payment information.
232
- # Once you have your empty auto order, add items to it and call updateAutoOrder.
233
-
234
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
235
-
236
- # see https://www.ultracart.com/api/#resource_auto_order.html for list
237
- expand = "items,items.future_schedules,original_order,rebill_orders"
238
-
239
- original_order_id = "DEMO-123457"
240
- api_response = auto_order_api.establish_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
241
-
242
- empty_auto_order = api_response.auto_order
243
- auto_order_oid = empty_auto_order.auto_order_oid
244
-
245
- items = []
246
- item = UltracartClient::AutoOrderItem.new
247
- item.original_item_id = "ITEM_ABC" # This item should be configured with auto order features.
248
- item.original_quantity = 1
249
- item.arbitrary_unit_cost = 59.99
250
- # Valid Frequencies
251
- # "Weekly", "Biweekly", "Every...", "Every 10 Days", "Every 4 Weeks", "Every 6 Weeks", "Every 8 Weeks", "Every 24 Days", "Every 28 Days", "Monthly",
252
- # "Every 45 Days", "Every 2 Months", "Every 3 Months", "Every 4 Months", "Every 5 Months", "Every 6 Months", "Yearly"
253
- item.frequency = "Monthly"
254
- items << item
255
- empty_auto_order.items = items
256
-
257
- validate_original_order = 'No'
258
- api_response = auto_order_api.update_auto_order(auto_order_oid, empty_auto_order, { '_expand' => expand, validate_original_order: validate_original_order })
259
- updated_auto_order = api_response.auto_order
260
- puts updated_auto_order.inspect
261
- ```
262
-
263
-
264
- #### Using the establish_auto_order_by_reference_order_id_with_http_info variant
265
-
266
- This returns an Array which contains the response data, status code and headers.
267
-
268
- > <Array(<AutoOrderResponse>, Integer, Hash)> establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
269
-
270
- ```ruby
271
- begin
272
- # Establish an auto order by referencing a regular order id
273
- data, status_code, headers = api_instance.establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
274
- p status_code # => 2xx
275
- p headers # => { ... }
276
- p data # => <AutoOrderResponse>
277
- rescue UltracartClient::ApiError => e
278
- puts "Error when calling AutoOrderApi->establish_auto_order_by_reference_order_id_with_http_info: #{e}"
279
- end
280
- ```
281
-
282
- ### Parameters
283
-
284
- | Name | Type | Description | Notes |
285
- | ---- | ---- | ----------- | ----- |
286
- | **reference_order_id** | **String** | The order id to attach this auto order to | |
287
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
288
-
289
- ### Return type
290
-
291
- [**AutoOrderResponse**](AutoOrderResponse.md)
292
-
293
- ### Authorization
294
-
295
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
296
-
297
- ### HTTP request headers
298
-
299
- - **Content-Type**: Not defined
300
- - **Accept**: application/json
301
-
302
-
303
- ## get_auto_order
304
-
305
- > <AutoOrderResponse> get_auto_order(auto_order_oid, opts)
306
-
307
- Retrieve an auto order by oid
308
-
309
- Retrieves a single auto order using the specified auto order oid.
310
-
311
-
312
- ### Examples
313
-
314
- ```ruby
315
- require 'ultracart_api'
316
- require_relative '../constants'
317
-
318
- # retrieves an auto_order given the auto_order_oid;
319
-
320
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
321
-
322
- # see https://www.ultracart.com/api/#resource_auto_order.html for list
323
- expand = "items,items.future_schedules,original_order,rebill_orders"
324
- auto_order_oid = 123456789 # If you don't know the oid, use getAutoOrdersByQuery for retrieving auto orders
325
- api_response = auto_order_api.get_auto_order(auto_order_oid, { '_expand' => expand })
326
- auto_order = api_response.auto_order
327
- puts auto_order.inspect
328
- ```
329
-
330
-
331
- #### Using the get_auto_order_with_http_info variant
332
-
333
- This returns an Array which contains the response data, status code and headers.
334
-
335
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_with_http_info(auto_order_oid, opts)
336
-
337
- ```ruby
338
- begin
339
- # Retrieve an auto order by oid
340
- data, status_code, headers = api_instance.get_auto_order_with_http_info(auto_order_oid, opts)
341
- p status_code # => 2xx
342
- p headers # => { ... }
343
- p data # => <AutoOrderResponse>
344
- rescue UltracartClient::ApiError => e
345
- puts "Error when calling AutoOrderApi->get_auto_order_with_http_info: #{e}"
346
- end
347
- ```
348
-
349
- ### Parameters
350
-
351
- | Name | Type | Description | Notes |
352
- | ---- | ---- | ----------- | ----- |
353
- | **auto_order_oid** | **Integer** | The auto order oid to retrieve. | |
354
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
355
-
356
- ### Return type
357
-
358
- [**AutoOrderResponse**](AutoOrderResponse.md)
359
-
360
- ### Authorization
361
-
362
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
363
-
364
- ### HTTP request headers
365
-
366
- - **Content-Type**: Not defined
367
- - **Accept**: application/json
368
-
369
-
370
- ## get_auto_order_by_code
371
-
372
- > <AutoOrderResponse> get_auto_order_by_code(auto_order_code, opts)
373
-
374
- Retrieve an auto order by code
375
-
376
- Retrieves a single auto order using the specified reference (original) order id.
377
-
378
-
379
- ### Examples
380
-
381
- ```ruby
382
- require 'ultracart_api'
383
- require_relative '../constants'
384
-
385
- # This example illustrates how to query an auto order when you know the 'code'. Each AutoOrder has a unique
386
- # identifier used by UltraCart called an OID (Object Identifier). AutoOrders also have a unique code which
387
- # is (arguably) an easy way for customers to discuss a specific auto order with a merchant.
388
- # The codes look like this: "RT2A9CBSX9"
389
- #
390
- # It is doubtful that an UltraCart merchant will ever make use of this method.
391
-
392
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
393
-
394
- # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
395
- # and may become stale. Please review the master website when in doubt.
396
- # items
397
- # items.future_schedules
398
- # items.sample_schedule
399
- # original_order
400
- # original_order.affiliate
401
- # original_order.affiliate.ledger
402
- # original_order.auto_order
403
- # original_order.billing
404
- # original_order.buysafe
405
- # original_order.channel_partner
406
- # original_order.checkout
407
- # original_order.coupon
408
- # original_order.customer_profile
409
- # original_order.digital_order
410
- # original_order.edi
411
- # original_order.fraud_score
412
- # original_order.gift
413
- # original_order.gift_certificate
414
- # original_order.internal
415
- # original_order.item
416
- # original_order.linked_shipment
417
- # original_order.marketing
418
- # original_order.payment
419
- # original_order.payment.transaction
420
- # original_order.quote
421
- # original_order.salesforce
422
- # original_order.shipping
423
- # original_order.summary
424
- # original_order.taxes
425
- # rebill_orders
426
- # rebill_orders.affiliate
427
- # rebill_orders.affiliate.ledger
428
- # rebill_orders.auto_order
429
- # rebill_orders.billing
430
- # rebill_orders.buysafe
431
- # rebill_orders.channel_partner
432
- # rebill_orders.checkout
433
- # rebill_orders.coupon
434
- # rebill_orders.customer_profile
435
- # rebill_orders.digital_order
436
- # rebill_orders.edi
437
- # rebill_orders.fraud_score
438
- # rebill_orders.gift
439
- # rebill_orders.gift_certificate
440
- # rebill_orders.internal
441
- # rebill_orders.item
442
- # rebill_orders.linked_shipment
443
- # rebill_orders.marketing
444
- # rebill_orders.payment
445
- # rebill_orders.payment.transaction
446
- # rebill_orders.quote
447
- # rebill_orders.salesforce
448
- # rebill_orders.shipping
449
- # rebill_orders.summary
450
- # rebill_orders.taxes
451
-
452
- expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
453
- code = "RT2A9CBSX9"
454
- api_response = auto_order_api.get_auto_order_by_code(code, { '_expand' => expand })
455
- auto_order = api_response.auto_order
456
-
457
- # this will be verbose...
458
- puts auto_order.inspect
459
- ```
460
-
461
-
462
- #### Using the get_auto_order_by_code_with_http_info variant
463
-
464
- This returns an Array which contains the response data, status code and headers.
465
-
466
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_code_with_http_info(auto_order_code, opts)
467
-
468
- ```ruby
469
- begin
470
- # Retrieve an auto order by code
471
- data, status_code, headers = api_instance.get_auto_order_by_code_with_http_info(auto_order_code, opts)
472
- p status_code # => 2xx
473
- p headers # => { ... }
474
- p data # => <AutoOrderResponse>
475
- rescue UltracartClient::ApiError => e
476
- puts "Error when calling AutoOrderApi->get_auto_order_by_code_with_http_info: #{e}"
477
- end
478
- ```
479
-
480
- ### Parameters
481
-
482
- | Name | Type | Description | Notes |
483
- | ---- | ---- | ----------- | ----- |
484
- | **auto_order_code** | **String** | The auto order oid to retrieve. | |
485
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
486
-
487
- ### Return type
488
-
489
- [**AutoOrderResponse**](AutoOrderResponse.md)
490
-
491
- ### Authorization
492
-
493
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
494
-
495
- ### HTTP request headers
496
-
497
- - **Content-Type**: Not defined
498
- - **Accept**: application/json
499
-
500
-
501
- ## get_auto_order_by_reference_order_id
502
-
503
- > <AutoOrderResponse> get_auto_order_by_reference_order_id(reference_order_id, opts)
504
-
505
- Retrieve an auto order by order id
506
-
507
- Retrieves a single auto order using the specified reference (original) order id.
508
-
509
-
510
- ### Examples
511
-
512
- ```ruby
513
- require 'ultracart_api'
514
- require_relative '../constants'
515
-
516
- # This example illustrates how to query an auto order when you know the original order id.
517
-
518
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
519
-
520
- # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
521
- # and may become stale. Please review the master website when in doubt.
522
- # items
523
- # items.future_schedules
524
- # items.sample_schedule
525
- # original_order
526
- # original_order.affiliate
527
- # original_order.affiliate.ledger
528
- # original_order.auto_order
529
- # original_order.billing
530
- # original_order.buysafe
531
- # original_order.channel_partner
532
- # original_order.checkout
533
- # original_order.coupon
534
- # original_order.customer_profile
535
- # original_order.digital_order
536
- # original_order.edi
537
- # original_order.fraud_score
538
- # original_order.gift
539
- # original_order.gift_certificate
540
- # original_order.internal
541
- # original_order.item
542
- # original_order.linked_shipment
543
- # original_order.marketing
544
- # original_order.payment
545
- # original_order.payment.transaction
546
- # original_order.quote
547
- # original_order.salesforce
548
- # original_order.shipping
549
- # original_order.summary
550
- # original_order.taxes
551
- # rebill_orders
552
- # rebill_orders.affiliate
553
- # rebill_orders.affiliate.ledger
554
- # rebill_orders.auto_order
555
- # rebill_orders.billing
556
- # rebill_orders.buysafe
557
- # rebill_orders.channel_partner
558
- # rebill_orders.checkout
559
- # rebill_orders.coupon
560
- # rebill_orders.customer_profile
561
- # rebill_orders.digital_order
562
- # rebill_orders.edi
563
- # rebill_orders.fraud_score
564
- # rebill_orders.gift
565
- # rebill_orders.gift_certificate
566
- # rebill_orders.internal
567
- # rebill_orders.item
568
- # rebill_orders.linked_shipment
569
- # rebill_orders.marketing
570
- # rebill_orders.payment
571
- # rebill_orders.payment.transaction
572
- # rebill_orders.quote
573
- # rebill_orders.salesforce
574
- # rebill_orders.shipping
575
- # rebill_orders.summary
576
- # rebill_orders.taxes
577
-
578
- expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
579
- original_order_id = "DEMO-12345678"
580
- api_response = auto_order_api.get_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
581
- auto_order = api_response.auto_order
582
-
583
- # this will be verbose...
584
- puts auto_order.inspect
585
- ```
586
-
587
-
588
- #### Using the get_auto_order_by_reference_order_id_with_http_info variant
589
-
590
- This returns an Array which contains the response data, status code and headers.
591
-
592
- > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
593
-
594
- ```ruby
595
- begin
596
- # Retrieve an auto order by order id
597
- data, status_code, headers = api_instance.get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
598
- p status_code # => 2xx
599
- p headers # => { ... }
600
- p data # => <AutoOrderResponse>
601
- rescue UltracartClient::ApiError => e
602
- puts "Error when calling AutoOrderApi->get_auto_order_by_reference_order_id_with_http_info: #{e}"
603
- end
604
- ```
605
-
606
- ### Parameters
607
-
608
- | Name | Type | Description | Notes |
609
- | ---- | ---- | ----------- | ----- |
610
- | **reference_order_id** | **String** | The auto order oid to retrieve. | |
611
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
612
-
613
- ### Return type
614
-
615
- [**AutoOrderResponse**](AutoOrderResponse.md)
616
-
617
- ### Authorization
618
-
619
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
620
-
621
- ### HTTP request headers
622
-
623
- - **Content-Type**: Not defined
624
- - **Accept**: application/json
625
-
626
-
627
- ## get_auto_order_cancel_reasons
628
-
629
- > <AutoOrderCancelReasonsResponse> get_auto_order_cancel_reasons
630
-
631
- Retrieve auto order cancel reasons.
632
-
633
- Retrieves auto order cancel reasons.
634
-
635
-
636
- ### Examples
637
-
638
-
639
- (No example for this operation).
640
-
641
-
642
- #### Using the get_auto_order_cancel_reasons_with_http_info variant
643
-
644
- This returns an Array which contains the response data, status code and headers.
645
-
646
- > <Array(<AutoOrderCancelReasonsResponse>, Integer, Hash)> get_auto_order_cancel_reasons_with_http_info
647
-
648
- ```ruby
649
- begin
650
- # Retrieve auto order cancel reasons.
651
- data, status_code, headers = api_instance.get_auto_order_cancel_reasons_with_http_info
652
- p status_code # => 2xx
653
- p headers # => { ... }
654
- p data # => <AutoOrderCancelReasonsResponse>
655
- rescue UltracartClient::ApiError => e
656
- puts "Error when calling AutoOrderApi->get_auto_order_cancel_reasons_with_http_info: #{e}"
657
- end
658
- ```
659
-
660
- ### Parameters
661
-
662
- This endpoint does not need any parameter.
663
-
664
- ### Return type
665
-
666
- [**AutoOrderCancelReasonsResponse**](AutoOrderCancelReasonsResponse.md)
667
-
668
- ### Authorization
669
-
670
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
671
-
672
- ### HTTP request headers
673
-
674
- - **Content-Type**: Not defined
675
- - **Accept**: application/json
676
-
677
-
678
- ## get_auto_order_emails
679
-
680
- > <AutoOrderEmailsResponse> get_auto_order_emails(auto_order_oid)
681
-
682
- Retrieve email delivery information for this auto order.
683
-
684
- Retrieves email delivery records associated with the specified auto order.
685
-
686
-
687
- ### Examples
688
-
689
-
690
- (No example for this operation).
691
-
692
-
693
- #### Using the get_auto_order_emails_with_http_info variant
694
-
695
- This returns an Array which contains the response data, status code and headers.
696
-
697
- > <Array(<AutoOrderEmailsResponse>, Integer, Hash)> get_auto_order_emails_with_http_info(auto_order_oid)
698
-
699
- ```ruby
700
- begin
701
- # Retrieve email delivery information for this auto order.
702
- data, status_code, headers = api_instance.get_auto_order_emails_with_http_info(auto_order_oid)
703
- p status_code # => 2xx
704
- p headers # => { ... }
705
- p data # => <AutoOrderEmailsResponse>
706
- rescue UltracartClient::ApiError => e
707
- puts "Error when calling AutoOrderApi->get_auto_order_emails_with_http_info: #{e}"
708
- end
709
- ```
710
-
711
- ### Parameters
712
-
713
- | Name | Type | Description | Notes |
714
- | ---- | ---- | ----------- | ----- |
715
- | **auto_order_oid** | **Integer** | The auto order oid to retrieve email delivery information for. | |
716
-
717
- ### Return type
718
-
719
- [**AutoOrderEmailsResponse**](AutoOrderEmailsResponse.md)
720
-
721
- ### Authorization
722
-
723
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
724
-
725
- ### HTTP request headers
726
-
727
- - **Content-Type**: Not defined
728
- - **Accept**: application/json
729
-
730
-
731
- ## get_auto_orders
732
-
733
- > <AutoOrdersResponse> get_auto_orders(opts)
734
-
735
- Retrieve auto orders
736
-
737
- 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.
738
-
739
-
740
- ### Examples
741
-
742
- ```ruby
743
- require 'ultracart_api'
744
- require_relative '../constants'
745
-
746
- # getAutoOrders provides a query service on AutoOrders (aka subscriptions or recurring orders) within the UltraCart
747
- # system. It was the first query provided and the most cumbersome to use. Please use getAutoOrdersByQuery for an
748
- # easier query method. If you have multiple auto_order_oids and need the corresponding objects, consider
749
- # getAutoOrdersBatch() to reduce call count.
750
-
751
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
752
-
753
- def get_auto_order_chunk(auto_order_api, offset, limit)
754
- expand = "items,original_order,rebill_orders"
755
- # see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
756
- #
757
- # Possible Order Expansions:
758
- #
759
- # add_ons items.sample_schedule original_order.buysafe original_order.payment.transaction
760
- # items original_order original_order.channel_partner original_order.quote
761
- # items.future_schedules original_order.affiliate original_order.checkout original_order.salesforce
762
- # original_order.affiliate.ledger original_order.coupon original_order.shipping
763
- # original_order.auto_order original_order.customer_profile original_order.summary
764
- # original_order.billing original_order.digital_order original_order.taxes
765
- # rebill_orders original_order.edi rebill_orders.affiliate
766
- # rebill_orders.affiliate.ledger original_order.fraud_score rebill_orders.auto_order
767
- # rebill_orders.billing original_order.gift rebill_orders.buysafe
768
- # rebill_orders.channel_partner original_order.gift_certificate rebill_orders.checkout
769
- # rebill_orders.coupon original_order.internal rebill_orders.customer_profile
770
- # rebill_orders.digital_order original_order.item rebill_orders.edi
771
- # rebill_orders.fraud_score original_order.linked_shipment rebill_orders.gift
772
- # rebill_orders.gift_certificate original_order.marketing rebill_orders.internal
773
- # rebill_orders.item original_order.payment rebill_orders.linked_shipment
774
- # rebill_orders.marketing rebill_orders.payment rebill_orders.quote
775
- # rebill_orders.payment.transaction rebill_orders.salesforce rebill_orders.shipping
776
- # rebill_orders.summary rebill_orders.taxes
777
-
778
- auto_order_code = nil
779
- original_order_id = nil
780
- first_name = nil
781
- last_name = nil
782
- company = nil
783
- city = nil
784
- state = nil
785
- postal_code = nil
786
- country_code = nil
787
- phone = nil
788
- email = 'test@ultracart.com' # <-- for this example, we are only filtering on email address.
789
- original_order_date_begin = nil
790
- original_order_date_end = nil
791
- next_shipment_date_begin = nil
792
- next_shipment_date_end = nil
793
- card_type = nil
794
- item_id = nil
795
- status = nil
796
- since = nil
797
- sort = nil
798
-
799
- # see all these parameters? that is why you should use getAutoOrdersByQuery() instead of getAutoOrders()
800
- api_response = auto_order_api.get_auto_orders(auto_order_code, original_order_id, first_name, last_name,
801
- company, city, state, postal_code, country_code, phone, email, original_order_date_begin,
802
- original_order_date_end, next_shipment_date_begin, next_shipment_date_end, card_type, item_id, status,
803
- limit, offset, since, sort, { '_expand' => expand })
804
-
805
- api_response.auto_orders || []
806
- end
807
-
808
- auto_orders = []
809
-
810
- iteration = 1
811
- offset = 0
812
- limit = 200
813
- ```
814
-
815
-
816
- #### Using the get_auto_orders_with_http_info variant
817
-
818
- This returns an Array which contains the response data, status code and headers.
819
-
820
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_with_http_info(opts)
821
-
822
- ```ruby
823
- begin
824
- # Retrieve auto orders
825
- data, status_code, headers = api_instance.get_auto_orders_with_http_info(opts)
826
- p status_code # => 2xx
827
- p headers # => { ... }
828
- p data # => <AutoOrdersResponse>
829
- rescue UltracartClient::ApiError => e
830
- puts "Error when calling AutoOrderApi->get_auto_orders_with_http_info: #{e}"
831
- end
832
- ```
833
-
834
- ### Parameters
835
-
836
- | Name | Type | Description | Notes |
837
- | ---- | ---- | ----------- | ----- |
838
- | **auto_order_code** | **String** | Auto order code | [optional] |
839
- | **original_order_id** | **String** | Original order id | [optional] |
840
- | **first_name** | **String** | First name | [optional] |
841
- | **last_name** | **String** | Last name | [optional] |
842
- | **company** | **String** | Company | [optional] |
843
- | **city** | **String** | City | [optional] |
844
- | **state** | **String** | State | [optional] |
845
- | **postal_code** | **String** | Postal code | [optional] |
846
- | **country_code** | **String** | Country code (ISO-3166 two letter) | [optional] |
847
- | **phone** | **String** | Phone | [optional] |
848
- | **email** | **String** | Email | [optional] |
849
- | **original_order_date_begin** | **String** | Original order date begin | [optional] |
850
- | **original_order_date_end** | **String** | Original order date end | [optional] |
851
- | **next_shipment_date_begin** | **String** | Next shipment date begin | [optional] |
852
- | **next_shipment_date_end** | **String** | Next shipment date end | [optional] |
853
- | **card_type** | **String** | Card type | [optional] |
854
- | **item_id** | **String** | Item ID | [optional] |
855
- | **status** | **String** | Status | [optional] |
856
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
857
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
858
- | **_since** | **String** | Fetch auto orders that have been created/modified since this date/time. | [optional] |
859
- | **_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] |
860
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
861
-
862
- ### Return type
863
-
864
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
865
-
866
- ### Authorization
867
-
868
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
869
-
870
- ### HTTP request headers
871
-
872
- - **Content-Type**: Not defined
873
- - **Accept**: application/json
874
-
875
-
876
- ## get_auto_orders_batch
877
-
878
- > <AutoOrdersResponse> get_auto_orders_batch(auto_order_batch, opts)
879
-
880
- Retrieve auto order batch
881
-
882
- 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.
883
-
884
-
885
- ### Examples
886
-
887
- ```ruby
888
- require 'ultracart_api'
889
- require_relative '../constants'
890
-
891
- # This example illustrates how to retrieve auto orders when you have a list of auto_order_oid.
892
-
893
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
894
-
895
- # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
896
- # and may become stale. Please review the master website when in doubt.
897
- # items
898
- # items.future_schedules
899
- # items.sample_schedule
900
- # original_order
901
- # original_order.affiliate
902
- # original_order.affiliate.ledger
903
- # original_order.auto_order
904
- # original_order.billing
905
- # original_order.buysafe
906
- # original_order.channel_partner
907
- # original_order.checkout
908
- # original_order.coupon
909
- # original_order.customer_profile
910
- # original_order.digital_order
911
- # original_order.edi
912
- # original_order.fraud_score
913
- # original_order.gift
914
- # original_order.gift_certificate
915
- # original_order.internal
916
- # original_order.item
917
- # original_order.linked_shipment
918
- # original_order.marketing
919
- # original_order.payment
920
- # original_order.payment.transaction
921
- # original_order.quote
922
- # original_order.salesforce
923
- # original_order.shipping
924
- # original_order.summary
925
- # original_order.taxes
926
- # rebill_orders
927
- # rebill_orders.affiliate
928
- # rebill_orders.affiliate.ledger
929
- # rebill_orders.auto_order
930
- # rebill_orders.billing
931
- # rebill_orders.buysafe
932
- # rebill_orders.channel_partner
933
- # rebill_orders.checkout
934
- # rebill_orders.coupon
935
- # rebill_orders.customer_profile
936
- # rebill_orders.digital_order
937
- # rebill_orders.edi
938
- # rebill_orders.fraud_score
939
- # rebill_orders.gift
940
- # rebill_orders.gift_certificate
941
- # rebill_orders.internal
942
- # rebill_orders.item
943
- # rebill_orders.linked_shipment
944
- # rebill_orders.marketing
945
- # rebill_orders.payment
946
- # rebill_orders.payment.transaction
947
- # rebill_orders.quote
948
- # rebill_orders.salesforce
949
- # rebill_orders.shipping
950
- # rebill_orders.summary
951
- # rebill_orders.taxes
952
-
953
- expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
954
- auto_order_oids = [123456, 234567, 345678, 456789]
955
- batch_request = UltracartClient::AutoOrderQueryBatch.new
956
- batch_request.auto_order_oids = auto_order_oids
957
- api_response = auto_order_api.get_auto_orders_batch(batch_request, { '_expand' => expand })
958
- auto_orders = api_response.auto_orders
959
-
960
- # this will be verbose...
961
- puts auto_orders.inspect
962
- ```
963
-
964
-
965
- #### Using the get_auto_orders_batch_with_http_info variant
966
-
967
- This returns an Array which contains the response data, status code and headers.
968
-
969
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_batch_with_http_info(auto_order_batch, opts)
970
-
971
- ```ruby
972
- begin
973
- # Retrieve auto order batch
974
- data, status_code, headers = api_instance.get_auto_orders_batch_with_http_info(auto_order_batch, opts)
975
- p status_code # => 2xx
976
- p headers # => { ... }
977
- p data # => <AutoOrdersResponse>
978
- rescue UltracartClient::ApiError => e
979
- puts "Error when calling AutoOrderApi->get_auto_orders_batch_with_http_info: #{e}"
980
- end
981
- ```
982
-
983
- ### Parameters
984
-
985
- | Name | Type | Description | Notes |
986
- | ---- | ---- | ----------- | ----- |
987
- | **auto_order_batch** | [**AutoOrderQueryBatch**](AutoOrderQueryBatch.md) | Auto order batch | |
988
- | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
989
-
990
- ### Return type
991
-
992
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
993
-
994
- ### Authorization
995
-
996
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
997
-
998
- ### HTTP request headers
999
-
1000
- - **Content-Type**: application/json
1001
- - **Accept**: application/json
1002
-
1003
-
1004
- ## get_auto_orders_by_query
1005
-
1006
- > <AutoOrdersResponse> get_auto_orders_by_query(auto_order_query, opts)
1007
-
1008
- Retrieve auto orders by query
1009
-
1010
- 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.
1011
-
1012
-
1013
- ### Examples
1014
-
1015
- ```ruby
1016
- require 'ultracart_api'
1017
- require_relative '../constants'
1018
-
1019
- # This example illustrates how to retrieve auto orders and handle pagination.
1020
-
1021
- # Initialize the API
1022
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1023
-
1024
- def get_auto_order_chunk(auto_order_api, offset, limit)
1025
- # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
1026
- # and may become stale. Please review the master website when in doubt.
1027
- # items
1028
- # items.future_schedules
1029
- # items.sample_schedule
1030
- # original_order
1031
- # original_order.affiliate
1032
- # original_order.affiliate.ledger
1033
- # original_order.auto_order
1034
- # original_order.billing
1035
- # original_order.buysafe
1036
- # original_order.channel_partner
1037
- # original_order.checkout
1038
- # original_order.coupon
1039
- # original_order.customer_profile
1040
- # original_order.digital_order
1041
- # original_order.edi
1042
- # original_order.fraud_score
1043
- # original_order.gift
1044
- # original_order.gift_certificate
1045
- # original_order.internal
1046
- # original_order.item
1047
- # original_order.linked_shipment
1048
- # original_order.marketing
1049
- # original_order.payment
1050
- # original_order.payment.transaction
1051
- # original_order.quote
1052
- # original_order.salesforce
1053
- # original_order.shipping
1054
- # original_order.summary
1055
- # original_order.taxes
1056
- # rebill_orders
1057
- # rebill_orders.affiliate
1058
- # rebill_orders.affiliate.ledger
1059
- # rebill_orders.auto_order
1060
- # rebill_orders.billing
1061
- # rebill_orders.buysafe
1062
- # rebill_orders.channel_partner
1063
- # rebill_orders.checkout
1064
- # rebill_orders.coupon
1065
- # rebill_orders.customer_profile
1066
- # rebill_orders.digital_order
1067
- # rebill_orders.edi
1068
- # rebill_orders.fraud_score
1069
- # rebill_orders.gift
1070
- # rebill_orders.gift_certificate
1071
- # rebill_orders.internal
1072
- # rebill_orders.item
1073
- # rebill_orders.linked_shipment
1074
- # rebill_orders.marketing
1075
- # rebill_orders.payment
1076
- # rebill_orders.payment.transaction
1077
- # rebill_orders.quote
1078
- # rebill_orders.salesforce
1079
- # rebill_orders.shipping
1080
- # rebill_orders.summary
1081
- # rebill_orders.taxes
1082
-
1083
- # contact us if you're unsure what you need
1084
- expand = "items,items.future_schedules,original_order,rebill_orders"
1085
-
1086
- # These are the supported sorting fields:
1087
- # auto_order_code
1088
- # order_id
1089
- # shipping.company
1090
- # shipping.first_name
1091
- # shipping.last_name
1092
- # shipping.city
1093
- # shipping.state_region
1094
- # shipping.postal_code
1095
- # shipping.country_code
1096
- # billing.phone
1097
- # billing.email
1098
- # billing.cc_email
1099
- # billing.company
1100
- # billing.first_name
1101
- # billing.last_name
1102
- # billing.city
1103
- # billing.state
1104
- # billing.postal_code
1105
- # billing.country_code
1106
- # creation_dts
1107
- # payment.payment_dts
1108
- # checkout.screen_branding_theme_code
1109
- # next_shipment_dts
1110
-
1111
- query = UltracartClient::AutoOrderQuery.new
1112
- query.email = "support@ultracart.com"
1113
-
1114
- opts = {
1115
- _limit: limit,
1116
- _offset: offset,
1117
- _sort: "next_shipment_dts",
1118
- _expand: expand
1119
- }
1120
-
1121
- api_response = auto_order_api.get_auto_orders_by_query(query, opts)
1122
-
1123
- return [] if api_response.auto_orders.nil?
1124
- api_response.auto_orders
1125
- end
1126
-
1127
- auto_orders = []
1128
- iteration = 1
1129
- offset = 0
1130
- limit = 200
1131
- more_records_to_fetch = true
1132
-
1133
- begin
1134
- while more_records_to_fetch
1135
- puts "executing iteration #{iteration}"
1136
-
1137
- chunk_of_orders = get_auto_order_chunk(auto_order_api, offset, limit)
1138
- auto_orders.concat(chunk_of_orders)
1139
- offset += limit
1140
- more_records_to_fetch = chunk_of_orders.length == limit
1141
- iteration += 1
1142
- end
1143
- rescue UltracartClient::ApiError => e
1144
- puts "ApiError occurred on iteration #{iteration}"
1145
- puts e.inspect
1146
- exit 1
1147
- end
1148
-
1149
- # this will be verbose...
1150
- puts auto_orders.inspect
1151
- ```
1152
-
1153
-
1154
- #### Using the get_auto_orders_by_query_with_http_info variant
1155
-
1156
- This returns an Array which contains the response data, status code and headers.
1157
-
1158
- > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_by_query_with_http_info(auto_order_query, opts)
1159
-
1160
- ```ruby
1161
- begin
1162
- # Retrieve auto orders by query
1163
- data, status_code, headers = api_instance.get_auto_orders_by_query_with_http_info(auto_order_query, opts)
1164
- p status_code # => 2xx
1165
- p headers # => { ... }
1166
- p data # => <AutoOrdersResponse>
1167
- rescue UltracartClient::ApiError => e
1168
- puts "Error when calling AutoOrderApi->get_auto_orders_by_query_with_http_info: #{e}"
1169
- end
1170
- ```
1171
-
1172
- ### Parameters
1173
-
1174
- | Name | Type | Description | Notes |
1175
- | ---- | ---- | ----------- | ----- |
1176
- | **auto_order_query** | [**AutoOrderQuery**](AutoOrderQuery.md) | Auto order query | |
1177
- | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Maximum 200) | [optional][default to 100] |
1178
- | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
1179
- | **_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] |
1180
- | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
1181
-
1182
- ### Return type
1183
-
1184
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
1185
-
1186
- ### Authorization
1187
-
1188
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1189
-
1190
- ### HTTP request headers
1191
-
1192
- - **Content-Type**: application/json
1193
- - **Accept**: application/json
1194
-
1195
-
1196
- ## pause_auto_order
1197
-
1198
- > <AutoOrderResponse> pause_auto_order(auto_order_oid, auto_order, opts)
1199
-
1200
- Pause auto order
1201
-
1202
- Completely pause an auto order
1203
-
1204
-
1205
- ### Examples
1206
-
1207
- ```ruby
1208
- # This is a convenience method created for an UltraCart merchant to pause a large number of auto orders
1209
- # due to an inventory shortage. This is not new functionality and can be accomplished with the normal updateAutoOrder
1210
- # call. It does the following logic to an auto order:
1211
- # for each item in the auto order:
1212
- # if the item is not paused, pause it, setPause(true)
1213
- # save the changes by calling updateAutoOrder()
1214
- #
1215
- # Some warnings if you choose to use this method.
1216
- # There are no convenience methods to unpause auto orders.
1217
- # There are no convenience methods to query which auto orders are paused.
1218
- # We do not recommend pausing auto orders and the merchant is on their own to manage auto order state if they
1219
- # choose to begin pausing orders. Keep good track of what you're doing.
1220
-
1221
- require_relative '../constants'
1222
- require 'ultracart_api'
1223
-
1224
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1225
-
1226
- expand = "items" # see https://www.ultracart.com/api/#resource_auto_order.html for list
1227
- auto_order_oid = 123456789 # get an auto order and update it. There are many ways to retrieve an auto order.
1228
- get_response = auto_order_api.get_auto_order(auto_order_oid, {_expand: expand})
1229
- auto_order = get_response.auto_order
1230
-
1231
- pause_response = auto_order_api.pause_auto_order(auto_order_oid, auto_order)
1232
- paused_auto_order = pause_response.auto_order
1233
- puts paused_auto_order.inspect
1234
- ```
1235
-
1236
-
1237
- #### Using the pause_auto_order_with_http_info variant
1238
-
1239
- This returns an Array which contains the response data, status code and headers.
1240
-
1241
- > <Array(<AutoOrderResponse>, Integer, Hash)> pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1242
-
1243
- ```ruby
1244
- begin
1245
- # Pause auto order
1246
- data, status_code, headers = api_instance.pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1247
- p status_code # => 2xx
1248
- p headers # => { ... }
1249
- p data # => <AutoOrderResponse>
1250
- rescue UltracartClient::ApiError => e
1251
- puts "Error when calling AutoOrderApi->pause_auto_order_with_http_info: #{e}"
1252
- end
1253
- ```
1254
-
1255
- ### Parameters
1256
-
1257
- | Name | Type | Description | Notes |
1258
- | ---- | ---- | ----------- | ----- |
1259
- | **auto_order_oid** | **Integer** | The auto order oid to pause. | |
1260
- | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to pause | |
1261
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1262
-
1263
- ### Return type
1264
-
1265
- [**AutoOrderResponse**](AutoOrderResponse.md)
1266
-
1267
- ### Authorization
1268
-
1269
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1270
-
1271
- ### HTTP request headers
1272
-
1273
- - **Content-Type**: application/json; charset=UTF-8
1274
- - **Accept**: application/json
1275
-
1276
-
1277
- ## update_auto_order
1278
-
1279
- > <AutoOrderResponse> update_auto_order(auto_order_oid, auto_order, opts)
1280
-
1281
- Update an auto order
1282
-
1283
- Update an auto order on the UltraCart account. To cancel an auto order, set enabled to false and supply either cancel_reason or canceled_by_user, which records the change as a cancellation and fires the auto order cancel notifications. Setting enabled to false without either field records a disable.
1284
-
1285
-
1286
- ### Examples
1287
-
1288
- ```ruby
1289
- # frozen_string_literal: true
1290
-
1291
- # Rules for updating auto orders (recurring orders)
1292
- # To change the item that is delivered, change the AutoOrder.items[x].arbitrary_item_id
1293
- # To change the schedule (frequency) of when an item is delivered, change the original item. It controls schedule
1294
- # To change the original item: AutoOrder.items[x].original_item_id
1295
- #
1296
- # Alternate method: Replace the item altogether. Delete the current one and replace it with another item
1297
- # Note: The replacement item must be an auto order item. (Edit item in backend, click on Auto Order tab)
1298
- # This is more complex as you must supply all the required fields.
1299
-
1300
- require 'json'
1301
- require 'ultracart_api'
1302
-
1303
- simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
1304
- # ao is short for 'auto order', and is used heavily below.
1305
- ao_api = UltracartClient::AutoOrderApi.new_using_api_key(simple_key, false, false)
1306
- email = 'test@test.com'
1307
-
1308
-
1309
- query = UltracartClient::AutoOrderQuery.new
1310
- query.email = email
1311
- expansion = 'items,items.future_schedules,items.simple_schedule,rebill_orders'
1312
- ao_response = ao_api.get_auto_orders_by_query(query, { _expand: expansion })
1313
-
1314
- # there should only be one auto order for a customer. that's typical.
1315
- # If you are marketing more than one, than you must loop through the result set
1316
- # and find the auto order you're looking for manually
1317
-
1318
- auto_order = ao_response.auto_orders[0]
1319
-
1320
- existing_item = 'OldItemID'
1321
- upgrade_item = 'NewItemID'
1322
-
1323
- auto_order.items.each do |auto_order_item|
1324
- auto_order_item.arbitrary_item_id = upgrade_item if auto_order_item.original_item_id = existing_item
1325
- end
1326
-
1327
- # save the auto order with the updated item.
1328
- ao_api.update_auto_order(auto_order, auto_order.auto_order_oid, { _expand: expansion })
1329
-
1330
-
1331
-
1332
-
1333
- ```
1334
-
1335
-
1336
- #### Using the update_auto_order_with_http_info variant
1337
-
1338
- This returns an Array which contains the response data, status code and headers.
1339
-
1340
- > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1341
-
1342
- ```ruby
1343
- begin
1344
- # Update an auto order
1345
- data, status_code, headers = api_instance.update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1346
- p status_code # => 2xx
1347
- p headers # => { ... }
1348
- p data # => <AutoOrderResponse>
1349
- rescue UltracartClient::ApiError => e
1350
- puts "Error when calling AutoOrderApi->update_auto_order_with_http_info: #{e}"
1351
- end
1352
- ```
1353
-
1354
- ### Parameters
1355
-
1356
- | Name | Type | Description | Notes |
1357
- | ---- | ---- | ----------- | ----- |
1358
- | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1359
- | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to update | |
1360
- | **validate_original_order** | **String** | Validate original order before updating | [optional] |
1361
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1362
-
1363
- ### Return type
1364
-
1365
- [**AutoOrderResponse**](AutoOrderResponse.md)
1366
-
1367
- ### Authorization
1368
-
1369
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1370
-
1371
- ### HTTP request headers
1372
-
1373
- - **Content-Type**: application/json; charset=UTF-8
1374
- - **Accept**: application/json
1375
-
1376
-
1377
- ## update_auto_order_item_add_ons
1378
-
1379
- > <AutoOrderResponse> update_auto_order_item_add_ons(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1380
-
1381
- Update an auto order item add ons
1382
-
1383
- Update an auto order item add ons. Returns the auto order based upon expansion
1384
-
1385
-
1386
- ### Examples
1387
-
1388
-
1389
- (No example for this operation).
1390
-
1391
-
1392
- #### Using the update_auto_order_item_add_ons_with_http_info variant
1393
-
1394
- This returns an Array which contains the response data, status code and headers.
1395
-
1396
- > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_item_add_ons_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1397
-
1398
- ```ruby
1399
- begin
1400
- # Update an auto order item add ons
1401
- data, status_code, headers = api_instance.update_auto_order_item_add_ons_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1402
- p status_code # => 2xx
1403
- p headers # => { ... }
1404
- p data # => <AutoOrderResponse>
1405
- rescue UltracartClient::ApiError => e
1406
- puts "Error when calling AutoOrderApi->update_auto_order_item_add_ons_with_http_info: #{e}"
1407
- end
1408
- ```
1409
-
1410
- ### Parameters
1411
-
1412
- | Name | Type | Description | Notes |
1413
- | ---- | ---- | ----------- | ----- |
1414
- | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1415
- | **auto_order_item_oid** | **Integer** | The auto order item oid to update. | |
1416
- | **auto_order_add_ons_update_request** | [**AutoOrderAddonItemsUpdateRequest**](AutoOrderAddonItemsUpdateRequest.md) | Auto order add ons update request | |
1417
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1418
-
1419
- ### Return type
1420
-
1421
- [**AutoOrderResponse**](AutoOrderResponse.md)
1422
-
1423
- ### Authorization
1424
-
1425
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1426
-
1427
- ### HTTP request headers
1428
-
1429
- - **Content-Type**: application/json; charset=UTF-8
1430
- - **Accept**: application/json
1431
-
1432
-
1433
- ## update_auto_order_item_properties
1434
-
1435
- > <AutoOrderResponse> update_auto_order_item_properties(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1436
-
1437
- Update an auto order item properties
1438
-
1439
- Update an auto order item properties. Returns the auto order based upon expansion
1440
-
1441
-
1442
- ### Examples
1443
-
1444
-
1445
- (No example for this operation).
1446
-
1447
-
1448
- #### Using the update_auto_order_item_properties_with_http_info variant
1449
-
1450
- This returns an Array which contains the response data, status code and headers.
1451
-
1452
- > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_item_properties_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1453
-
1454
- ```ruby
1455
- begin
1456
- # Update an auto order item properties
1457
- data, status_code, headers = api_instance.update_auto_order_item_properties_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1458
- p status_code # => 2xx
1459
- p headers # => { ... }
1460
- p data # => <AutoOrderResponse>
1461
- rescue UltracartClient::ApiError => e
1462
- puts "Error when calling AutoOrderApi->update_auto_order_item_properties_with_http_info: #{e}"
1463
- end
1464
- ```
1465
-
1466
- ### Parameters
1467
-
1468
- | Name | Type | Description | Notes |
1469
- | ---- | ---- | ----------- | ----- |
1470
- | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1471
- | **auto_order_item_oid** | **Integer** | The auto order item oid to update. | |
1472
- | **auto_order_properties_update_request** | [**AutoOrderPropertiesUpdateRequest**](AutoOrderPropertiesUpdateRequest.md) | Auto order property update request | |
1473
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1474
-
1475
- ### Return type
1476
-
1477
- [**AutoOrderResponse**](AutoOrderResponse.md)
1478
-
1479
- ### Authorization
1480
-
1481
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1482
-
1483
- ### HTTP request headers
1484
-
1485
- - **Content-Type**: application/json; charset=UTF-8
1486
- - **Accept**: application/json
1487
-
1488
-
1489
- ## update_auto_order_payment
1490
-
1491
- > <AutoOrderRebillResponse> update_auto_order_payment(auto_order_oid, auto_order_payment_update_request, opts)
1492
-
1493
- Update the payment information on an auto order
1494
-
1495
- Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1496
-
1497
-
1498
- ### Examples
1499
-
1500
-
1501
- (No example for this operation).
1502
-
1503
-
1504
- #### Using the update_auto_order_payment_with_http_info variant
1505
-
1506
- This returns an Array which contains the response data, status code and headers.
1507
-
1508
- > <Array(<AutoOrderRebillResponse>, Integer, Hash)> update_auto_order_payment_with_http_info(auto_order_oid, auto_order_payment_update_request, opts)
1509
-
1510
- ```ruby
1511
- begin
1512
- # Update the payment information on an auto order
1513
- data, status_code, headers = api_instance.update_auto_order_payment_with_http_info(auto_order_oid, auto_order_payment_update_request, opts)
1514
- p status_code # => 2xx
1515
- p headers # => { ... }
1516
- p data # => <AutoOrderRebillResponse>
1517
- rescue UltracartClient::ApiError => e
1518
- puts "Error when calling AutoOrderApi->update_auto_order_payment_with_http_info: #{e}"
1519
- end
1520
- ```
1521
-
1522
- ### Parameters
1523
-
1524
- | Name | Type | Description | Notes |
1525
- | ---- | ---- | ----------- | ----- |
1526
- | **auto_order_oid** | **Integer** | The auto order oid to update payment information on. | |
1527
- | **auto_order_payment_update_request** | [**AutoOrderPaymentUpdateRequest**](AutoOrderPaymentUpdateRequest.md) | Payment information to place on the auto order | |
1528
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1529
-
1530
- ### Return type
1531
-
1532
- [**AutoOrderRebillResponse**](AutoOrderRebillResponse.md)
1533
-
1534
- ### Authorization
1535
-
1536
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1537
-
1538
- ### HTTP request headers
1539
-
1540
- - **Content-Type**: application/json; charset=UTF-8
1541
- - **Accept**: application/json
1542
-
1543
-
1544
- ## update_auto_order_properties
1545
-
1546
- > <AutoOrderResponse> update_auto_order_properties(auto_order_oid, auto_order_properties_update_request, opts)
1547
-
1548
- Update an auto order properties
1549
-
1550
- Update an auto order properties. Returns the auto order based upon expansion
1551
-
1552
-
1553
- ### Examples
1554
-
1555
-
1556
- (No example for this operation).
1557
-
1558
-
1559
- #### Using the update_auto_order_properties_with_http_info variant
1560
-
1561
- This returns an Array which contains the response data, status code and headers.
1562
-
1563
- > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_properties_with_http_info(auto_order_oid, auto_order_properties_update_request, opts)
1564
-
1565
- ```ruby
1566
- begin
1567
- # Update an auto order properties
1568
- data, status_code, headers = api_instance.update_auto_order_properties_with_http_info(auto_order_oid, auto_order_properties_update_request, opts)
1569
- p status_code # => 2xx
1570
- p headers # => { ... }
1571
- p data # => <AutoOrderResponse>
1572
- rescue UltracartClient::ApiError => e
1573
- puts "Error when calling AutoOrderApi->update_auto_order_properties_with_http_info: #{e}"
1574
- end
1575
- ```
1576
-
1577
- ### Parameters
1578
-
1579
- | Name | Type | Description | Notes |
1580
- | ---- | ---- | ----------- | ----- |
1581
- | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1582
- | **auto_order_properties_update_request** | [**AutoOrderPropertiesUpdateRequest**](AutoOrderPropertiesUpdateRequest.md) | Auto order property update request | |
1583
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1584
-
1585
- ### Return type
1586
-
1587
- [**AutoOrderResponse**](AutoOrderResponse.md)
1588
-
1589
- ### Authorization
1590
-
1591
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1592
-
1593
- ### HTTP request headers
1594
-
1595
- - **Content-Type**: application/json; charset=UTF-8
1596
- - **Accept**: application/json
1597
-
1598
-
1599
- ## update_auto_orders_batch
1600
-
1601
- > <AutoOrdersResponse> update_auto_orders_batch(auto_orders_request, opts)
1602
-
1603
- Update multiple auto orders
1604
-
1605
- Update multiple auto orders on the UltraCart account. To cancel an auto order, set enabled to false and supply either cancel_reason or canceled_by_user, which records the change as a cancellation and fires the auto order cancel notifications. Setting enabled to false without either field records a disable.
1606
-
1607
-
1608
- ### Examples
1609
-
1610
- ```ruby
1611
- require 'ultracart_api'
1612
- require_relative '../constants'
1613
-
1614
- # This method allows for updating multiple auto orders.
1615
- # Warning: Take great care editing auto orders. They are complex.
1616
- # Sometimes you must change the original_order to affect the auto_order. If you have questions about what fields
1617
- # to update to achieve your desired change, contact UltraCart support. Better to ask and get it right than to
1618
- # make a bad assumption and corrupt a thousand auto orders. UltraCart support is ready to assist.
1619
-
1620
- auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1621
-
1622
- # The _async parameter is what it seems. True if async.
1623
- # The max records allowed depends on the async flag. Synch max is 20, Asynch max is 100.
1624
-
1625
- # if true, success returns back a 204 No Content. False returns back the updated orders.
1626
- async = true
1627
-
1628
- # since we're async, nothing is returned, so we don't care about expansions.
1629
- # If you are doing a synchronous operation, then set your expand appropriately. set get_auto_orders
1630
- # sample for expansion samples.
1631
- expand = nil
1632
-
1633
- # mostly used for UI, not needed for a pure scripting operation.
1634
- placeholders = false
1635
-
1636
- # TODO: This should be an array of auto orders that have been updated. See any get_auto_orders method for retrieval.
1637
- auto_orders = []
1638
-
1639
- auto_orders_request = UltracartClient::AutoOrdersRequest.new
1640
- auto_orders_request.auto_orders = auto_orders
1641
-
1642
- opts = {
1643
- _expand: expand,
1644
- _placeholders: placeholders,
1645
- _async: async
1646
- }
1647
-
1648
- api_response = auto_order_api.update_auto_orders_batch(auto_orders_request, opts)
1649
-
1650
- # something went wrong if we have a response.
1651
- puts api_response.inspect unless api_response.nil?
1652
- ```
1653
-
1654
-
1655
- #### Using the update_auto_orders_batch_with_http_info variant
1656
-
1657
- This returns an Array which contains the response data, status code and headers.
1658
-
1659
- > <Array(<AutoOrdersResponse>, Integer, Hash)> update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1660
-
1661
- ```ruby
1662
- begin
1663
- # Update multiple auto orders
1664
- data, status_code, headers = api_instance.update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1665
- p status_code # => 2xx
1666
- p headers # => { ... }
1667
- p data # => <AutoOrdersResponse>
1668
- rescue UltracartClient::ApiError => e
1669
- puts "Error when calling AutoOrderApi->update_auto_orders_batch_with_http_info: #{e}"
1670
- end
1671
- ```
1672
-
1673
- ### Parameters
1674
-
1675
- | Name | Type | Description | Notes |
1676
- | ---- | ---- | ----------- | ----- |
1677
- | **auto_orders_request** | [**AutoOrdersRequest**](AutoOrdersRequest.md) | Auto orders to update (synchronous maximum 20 / asynchronous maximum 100) | |
1678
- | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1679
- | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1680
- | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
1681
-
1682
- ### Return type
1683
-
1684
- [**AutoOrdersResponse**](AutoOrdersResponse.md)
1685
-
1686
- ### Authorization
1687
-
1688
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1689
-
1690
- ### HTTP request headers
1691
-
1692
- - **Content-Type**: application/json; charset=UTF-8
1693
- - **Accept**: application/json
1694
-
1
+ # UltracartClient::AutoOrderApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**attempt_auto_order_rebill**](AutoOrderApi.md#attempt_auto_order_rebill) | **POST** /auto_order/auto_orders/{auto_order_oid}/rebill | Attempt a failed rebill on an auto order |
8
+ | [**cancel_auto_order_item_by_reference_order_id**](AutoOrderApi.md#cancel_auto_order_item_by_reference_order_id) | **POST** /auto_order/auto_orders/reference_order_id/{reference_order_id}/items/original/{original_item_id}/cancel | Cancel a single item on an auto order |
9
+ | [**consolidate_auto_orders**](AutoOrderApi.md#consolidate_auto_orders) | **PUT** /auto_order/auto_orders/{auto_order_oid}/consolidate | Consolidates multiple auto orders |
10
+ | [**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 |
11
+ | [**get_auto_order**](AutoOrderApi.md#get_auto_order) | **GET** /auto_order/auto_orders/{auto_order_oid} | Retrieve an auto order by oid |
12
+ | [**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 |
13
+ | [**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 |
14
+ | [**get_auto_order_cancel_reasons**](AutoOrderApi.md#get_auto_order_cancel_reasons) | **GET** /auto_order/auto_orders/cancel_reasons | Retrieve auto order cancel reasons. |
15
+ | [**get_auto_order_emails**](AutoOrderApi.md#get_auto_order_emails) | **GET** /auto_order/auto_orders/{auto_order_oid}/emails | Retrieve email delivery information for this auto order. |
16
+ | [**get_auto_orders**](AutoOrderApi.md#get_auto_orders) | **GET** /auto_order/auto_orders | Retrieve auto orders |
17
+ | [**get_auto_orders_batch**](AutoOrderApi.md#get_auto_orders_batch) | **POST** /auto_order/auto_orders/batch | Retrieve auto order batch |
18
+ | [**get_auto_orders_by_query**](AutoOrderApi.md#get_auto_orders_by_query) | **POST** /auto_order/auto_orders/query | Retrieve auto orders by query |
19
+ | [**pause_auto_order**](AutoOrderApi.md#pause_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid}/pause | Pause auto order |
20
+ | [**update_auto_order**](AutoOrderApi.md#update_auto_order) | **PUT** /auto_order/auto_orders/{auto_order_oid} | Update an auto order |
21
+ | [**update_auto_order_item_add_ons**](AutoOrderApi.md#update_auto_order_item_add_ons) | **PUT** /auto_order/auto_orders/{auto_order_oid}/items/{auto_order_item_oid}/add_ons | Update an auto order item add ons |
22
+ | [**update_auto_order_item_properties**](AutoOrderApi.md#update_auto_order_item_properties) | **PUT** /auto_order/auto_orders/{auto_order_oid}/items/{auto_order_item_oid}/properties | Update an auto order item properties |
23
+ | [**update_auto_order_payment**](AutoOrderApi.md#update_auto_order_payment) | **PUT** /auto_order/auto_orders/{auto_order_oid}/payment | Update the payment information on an auto order |
24
+ | [**update_auto_order_properties**](AutoOrderApi.md#update_auto_order_properties) | **PUT** /auto_order/auto_orders/{auto_order_oid}/properties | Update an auto order properties |
25
+ | [**update_auto_orders_batch**](AutoOrderApi.md#update_auto_orders_batch) | **PUT** /auto_order/auto_orders/batch | Update multiple auto orders |
26
+
27
+
28
+ ## attempt_auto_order_rebill
29
+
30
+ > <AutoOrderRebillResponse> attempt_auto_order_rebill(auto_order_oid, opts)
31
+
32
+ Attempt a failed rebill on an auto order
33
+
34
+ Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
35
+
36
+
37
+ ### Examples
38
+
39
+
40
+ (No example for this operation).
41
+
42
+
43
+ #### Using the attempt_auto_order_rebill_with_http_info variant
44
+
45
+ This returns an Array which contains the response data, status code and headers.
46
+
47
+ > <Array(<AutoOrderRebillResponse>, Integer, Hash)> attempt_auto_order_rebill_with_http_info(auto_order_oid, opts)
48
+
49
+ ```ruby
50
+ begin
51
+ # Attempt a failed rebill on an auto order
52
+ data, status_code, headers = api_instance.attempt_auto_order_rebill_with_http_info(auto_order_oid, opts)
53
+ p status_code # => 2xx
54
+ p headers # => { ... }
55
+ p data # => <AutoOrderRebillResponse>
56
+ rescue UltracartClient::ApiError => e
57
+ puts "Error when calling AutoOrderApi->attempt_auto_order_rebill_with_http_info: #{e}"
58
+ end
59
+ ```
60
+
61
+ ### Parameters
62
+
63
+ | Name | Type | Description | Notes |
64
+ | ---- | ---- | ----------- | ----- |
65
+ | **auto_order_oid** | **Integer** | The auto order oid to rebill. | |
66
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
67
+
68
+ ### Return type
69
+
70
+ [**AutoOrderRebillResponse**](AutoOrderRebillResponse.md)
71
+
72
+ ### Authorization
73
+
74
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
75
+
76
+ ### HTTP request headers
77
+
78
+ - **Content-Type**: Not defined
79
+ - **Accept**: application/json
80
+
81
+
82
+ ## cancel_auto_order_item_by_reference_order_id
83
+
84
+ > <AutoOrderResponse> cancel_auto_order_item_by_reference_order_id(reference_order_id, original_item_id, opts)
85
+
86
+ Cancel a single item on an auto order
87
+
88
+ Cancels a single item on an auto order identified by the original order id and the item's original_item_id. The request body may specify mode=_end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
89
+
90
+
91
+ ### Examples
92
+
93
+
94
+ (No example for this operation).
95
+
96
+
97
+ #### Using the cancel_auto_order_item_by_reference_order_id_with_http_info variant
98
+
99
+ This returns an Array which contains the response data, status code and headers.
100
+
101
+ > <Array(<AutoOrderResponse>, Integer, Hash)> cancel_auto_order_item_by_reference_order_id_with_http_info(reference_order_id, original_item_id, opts)
102
+
103
+ ```ruby
104
+ begin
105
+ # Cancel a single item on an auto order
106
+ data, status_code, headers = api_instance.cancel_auto_order_item_by_reference_order_id_with_http_info(reference_order_id, original_item_id, opts)
107
+ p status_code # => 2xx
108
+ p headers # => { ... }
109
+ p data # => <AutoOrderResponse>
110
+ rescue UltracartClient::ApiError => e
111
+ puts "Error when calling AutoOrderApi->cancel_auto_order_item_by_reference_order_id_with_http_info: #{e}"
112
+ end
113
+ ```
114
+
115
+ ### Parameters
116
+
117
+ | Name | Type | Description | Notes |
118
+ | ---- | ---- | ----------- | ----- |
119
+ | **reference_order_id** | **String** | The reference order id (original_order_id) of the auto order. | |
120
+ | **original_item_id** | **String** | The original_item_id (SKU) of the item to cancel. | |
121
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
122
+ | **auto_order_item_cancel_request** | [**AutoOrderItemCancelRequest**](AutoOrderItemCancelRequest.md) | Cancel request. Body is optional; omit for default mode&#x3D;_end. | [optional] |
123
+
124
+ ### Return type
125
+
126
+ [**AutoOrderResponse**](AutoOrderResponse.md)
127
+
128
+ ### Authorization
129
+
130
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
131
+
132
+ ### HTTP request headers
133
+
134
+ - **Content-Type**: application/json; charset=UTF-8
135
+ - **Accept**: application/json
136
+
137
+
138
+ ## consolidate_auto_orders
139
+
140
+ > <AutoOrderResponse> consolidate_auto_orders(auto_order_oid, auto_order_consolidate, opts)
141
+
142
+ Consolidates multiple auto orders
143
+
144
+ Consolidates mutliple auto orders on the UltraCart account.
145
+
146
+
147
+ ### Examples
148
+
149
+ ```ruby
150
+ require 'ultracart_api'
151
+ require_relative '../constants'
152
+
153
+ # consolidateAutoOrders
154
+ # an auto order with no items, the original_order is used for shipping, billing, and payment information.
155
+ # Once you have your empty auto order, add items to it and call updateAutoOrder.
156
+
157
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
158
+
159
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
160
+ expand = "items,items.future_schedules,original_order,rebill_orders"
161
+
162
+ target_auto_order_oid = 123456789 # set getAutoOrdersByQuery for retrieving auto orders where you can get their auto_order_oid.
163
+ consolidate_request = UltracartClient::AutoOrderConsolidate.new
164
+ consolidate_request.source_auto_order_oids = [23456789, 3456789] # these are the autoorder_oids you wish to consolidate into the target.
165
+
166
+ api_response = auto_order_api.consolidate_auto_orders(target_auto_order_oid, consolidate_request, { '_expand' => expand })
167
+
168
+ consolidated_auto_order = api_response.auto_order
169
+
170
+ # TODO: make sure the consolidated order has all the items and history of all orders.
171
+ puts consolidated_auto_order.inspect
172
+ ```
173
+
174
+
175
+ #### Using the consolidate_auto_orders_with_http_info variant
176
+
177
+ This returns an Array which contains the response data, status code and headers.
178
+
179
+ > <Array(<AutoOrderResponse>, Integer, Hash)> consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
180
+
181
+ ```ruby
182
+ begin
183
+ # Consolidates multiple auto orders
184
+ data, status_code, headers = api_instance.consolidate_auto_orders_with_http_info(auto_order_oid, auto_order_consolidate, opts)
185
+ p status_code # => 2xx
186
+ p headers # => { ... }
187
+ p data # => <AutoOrderResponse>
188
+ rescue UltracartClient::ApiError => e
189
+ puts "Error when calling AutoOrderApi->consolidate_auto_orders_with_http_info: #{e}"
190
+ end
191
+ ```
192
+
193
+ ### Parameters
194
+
195
+ | Name | Type | Description | Notes |
196
+ | ---- | ---- | ----------- | ----- |
197
+ | **auto_order_oid** | **Integer** | The auto order oid to consolidate into. | |
198
+ | **auto_order_consolidate** | [**AutoOrderConsolidate**](AutoOrderConsolidate.md) | Auto orders to consolidate | |
199
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
200
+
201
+ ### Return type
202
+
203
+ [**AutoOrderResponse**](AutoOrderResponse.md)
204
+
205
+ ### Authorization
206
+
207
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
208
+
209
+ ### HTTP request headers
210
+
211
+ - **Content-Type**: application/json; charset=UTF-8
212
+ - **Accept**: application/json
213
+
214
+
215
+ ## establish_auto_order_by_reference_order_id
216
+
217
+ > <AutoOrderResponse> establish_auto_order_by_reference_order_id(reference_order_id, opts)
218
+
219
+ Establish an auto order by referencing a regular order id
220
+
221
+ 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.
222
+
223
+
224
+ ### Examples
225
+
226
+ ```ruby
227
+ require 'ultracart_api'
228
+ require_relative '../constants'
229
+
230
+ # This method takes a normal order id and creates an empty auto order from it. While this might seem useless having
231
+ # an auto order with no items, the original_order is used for shipping, billing, and payment information.
232
+ # Once you have your empty auto order, add items to it and call updateAutoOrder.
233
+
234
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
235
+
236
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
237
+ expand = "items,items.future_schedules,original_order,rebill_orders"
238
+
239
+ original_order_id = "DEMO-123457"
240
+ api_response = auto_order_api.establish_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
241
+
242
+ empty_auto_order = api_response.auto_order
243
+ auto_order_oid = empty_auto_order.auto_order_oid
244
+
245
+ items = []
246
+ item = UltracartClient::AutoOrderItem.new
247
+ item.original_item_id = "ITEM_ABC" # This item should be configured with auto order features.
248
+ item.original_quantity = 1
249
+ item.arbitrary_unit_cost = 59.99
250
+ # Valid Frequencies
251
+ # "Weekly", "Biweekly", "Every...", "Every 10 Days", "Every 4 Weeks", "Every 6 Weeks", "Every 8 Weeks", "Every 24 Days", "Every 28 Days", "Monthly",
252
+ # "Every 45 Days", "Every 2 Months", "Every 3 Months", "Every 4 Months", "Every 5 Months", "Every 6 Months", "Yearly"
253
+ item.frequency = "Monthly"
254
+ items << item
255
+ empty_auto_order.items = items
256
+
257
+ validate_original_order = 'No'
258
+ api_response = auto_order_api.update_auto_order(auto_order_oid, empty_auto_order, { '_expand' => expand, validate_original_order: validate_original_order })
259
+ updated_auto_order = api_response.auto_order
260
+ puts updated_auto_order.inspect
261
+ ```
262
+
263
+
264
+ #### Using the establish_auto_order_by_reference_order_id_with_http_info variant
265
+
266
+ This returns an Array which contains the response data, status code and headers.
267
+
268
+ > <Array(<AutoOrderResponse>, Integer, Hash)> establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
269
+
270
+ ```ruby
271
+ begin
272
+ # Establish an auto order by referencing a regular order id
273
+ data, status_code, headers = api_instance.establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
274
+ p status_code # => 2xx
275
+ p headers # => { ... }
276
+ p data # => <AutoOrderResponse>
277
+ rescue UltracartClient::ApiError => e
278
+ puts "Error when calling AutoOrderApi->establish_auto_order_by_reference_order_id_with_http_info: #{e}"
279
+ end
280
+ ```
281
+
282
+ ### Parameters
283
+
284
+ | Name | Type | Description | Notes |
285
+ | ---- | ---- | ----------- | ----- |
286
+ | **reference_order_id** | **String** | The order id to attach this auto order to | |
287
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
288
+
289
+ ### Return type
290
+
291
+ [**AutoOrderResponse**](AutoOrderResponse.md)
292
+
293
+ ### Authorization
294
+
295
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
296
+
297
+ ### HTTP request headers
298
+
299
+ - **Content-Type**: Not defined
300
+ - **Accept**: application/json
301
+
302
+
303
+ ## get_auto_order
304
+
305
+ > <AutoOrderResponse> get_auto_order(auto_order_oid, opts)
306
+
307
+ Retrieve an auto order by oid
308
+
309
+ Retrieves a single auto order using the specified auto order oid.
310
+
311
+
312
+ ### Examples
313
+
314
+ ```ruby
315
+ require 'ultracart_api'
316
+ require_relative '../constants'
317
+
318
+ # retrieves an auto_order given the auto_order_oid;
319
+
320
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
321
+
322
+ # see https://www.ultracart.com/api/#resource_auto_order.html for list
323
+ expand = "items,items.future_schedules,original_order,rebill_orders"
324
+ auto_order_oid = 123456789 # If you don't know the oid, use getAutoOrdersByQuery for retrieving auto orders
325
+ api_response = auto_order_api.get_auto_order(auto_order_oid, { '_expand' => expand })
326
+ auto_order = api_response.auto_order
327
+ puts auto_order.inspect
328
+ ```
329
+
330
+
331
+ #### Using the get_auto_order_with_http_info variant
332
+
333
+ This returns an Array which contains the response data, status code and headers.
334
+
335
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_with_http_info(auto_order_oid, opts)
336
+
337
+ ```ruby
338
+ begin
339
+ # Retrieve an auto order by oid
340
+ data, status_code, headers = api_instance.get_auto_order_with_http_info(auto_order_oid, opts)
341
+ p status_code # => 2xx
342
+ p headers # => { ... }
343
+ p data # => <AutoOrderResponse>
344
+ rescue UltracartClient::ApiError => e
345
+ puts "Error when calling AutoOrderApi->get_auto_order_with_http_info: #{e}"
346
+ end
347
+ ```
348
+
349
+ ### Parameters
350
+
351
+ | Name | Type | Description | Notes |
352
+ | ---- | ---- | ----------- | ----- |
353
+ | **auto_order_oid** | **Integer** | The auto order oid to retrieve. | |
354
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
355
+
356
+ ### Return type
357
+
358
+ [**AutoOrderResponse**](AutoOrderResponse.md)
359
+
360
+ ### Authorization
361
+
362
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
363
+
364
+ ### HTTP request headers
365
+
366
+ - **Content-Type**: Not defined
367
+ - **Accept**: application/json
368
+
369
+
370
+ ## get_auto_order_by_code
371
+
372
+ > <AutoOrderResponse> get_auto_order_by_code(auto_order_code, opts)
373
+
374
+ Retrieve an auto order by code
375
+
376
+ Retrieves a single auto order using the specified reference (original) order id.
377
+
378
+
379
+ ### Examples
380
+
381
+ ```ruby
382
+ require 'ultracart_api'
383
+ require_relative '../constants'
384
+
385
+ # This example illustrates how to query an auto order when you know the 'code'. Each AutoOrder has a unique
386
+ # identifier used by UltraCart called an OID (Object Identifier). AutoOrders also have a unique code which
387
+ # is (arguably) an easy way for customers to discuss a specific auto order with a merchant.
388
+ # The codes look like this: "RT2A9CBSX9"
389
+ #
390
+ # It is doubtful that an UltraCart merchant will ever make use of this method.
391
+
392
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
393
+
394
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
395
+ # and may become stale. Please review the master website when in doubt.
396
+ # items
397
+ # items.future_schedules
398
+ # items.sample_schedule
399
+ # original_order
400
+ # original_order.affiliate
401
+ # original_order.affiliate.ledger
402
+ # original_order.auto_order
403
+ # original_order.billing
404
+ # original_order.buysafe
405
+ # original_order.channel_partner
406
+ # original_order.checkout
407
+ # original_order.coupon
408
+ # original_order.customer_profile
409
+ # original_order.digital_order
410
+ # original_order.edi
411
+ # original_order.fraud_score
412
+ # original_order.gift
413
+ # original_order.gift_certificate
414
+ # original_order.internal
415
+ # original_order.item
416
+ # original_order.linked_shipment
417
+ # original_order.marketing
418
+ # original_order.payment
419
+ # original_order.payment.transaction
420
+ # original_order.quote
421
+ # original_order.salesforce
422
+ # original_order.shipping
423
+ # original_order.summary
424
+ # original_order.taxes
425
+ # rebill_orders
426
+ # rebill_orders.affiliate
427
+ # rebill_orders.affiliate.ledger
428
+ # rebill_orders.auto_order
429
+ # rebill_orders.billing
430
+ # rebill_orders.buysafe
431
+ # rebill_orders.channel_partner
432
+ # rebill_orders.checkout
433
+ # rebill_orders.coupon
434
+ # rebill_orders.customer_profile
435
+ # rebill_orders.digital_order
436
+ # rebill_orders.edi
437
+ # rebill_orders.fraud_score
438
+ # rebill_orders.gift
439
+ # rebill_orders.gift_certificate
440
+ # rebill_orders.internal
441
+ # rebill_orders.item
442
+ # rebill_orders.linked_shipment
443
+ # rebill_orders.marketing
444
+ # rebill_orders.payment
445
+ # rebill_orders.payment.transaction
446
+ # rebill_orders.quote
447
+ # rebill_orders.salesforce
448
+ # rebill_orders.shipping
449
+ # rebill_orders.summary
450
+ # rebill_orders.taxes
451
+
452
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
453
+ code = "RT2A9CBSX9"
454
+ api_response = auto_order_api.get_auto_order_by_code(code, { '_expand' => expand })
455
+ auto_order = api_response.auto_order
456
+
457
+ # this will be verbose...
458
+ puts auto_order.inspect
459
+ ```
460
+
461
+
462
+ #### Using the get_auto_order_by_code_with_http_info variant
463
+
464
+ This returns an Array which contains the response data, status code and headers.
465
+
466
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_code_with_http_info(auto_order_code, opts)
467
+
468
+ ```ruby
469
+ begin
470
+ # Retrieve an auto order by code
471
+ data, status_code, headers = api_instance.get_auto_order_by_code_with_http_info(auto_order_code, opts)
472
+ p status_code # => 2xx
473
+ p headers # => { ... }
474
+ p data # => <AutoOrderResponse>
475
+ rescue UltracartClient::ApiError => e
476
+ puts "Error when calling AutoOrderApi->get_auto_order_by_code_with_http_info: #{e}"
477
+ end
478
+ ```
479
+
480
+ ### Parameters
481
+
482
+ | Name | Type | Description | Notes |
483
+ | ---- | ---- | ----------- | ----- |
484
+ | **auto_order_code** | **String** | The auto order oid to retrieve. | |
485
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
486
+
487
+ ### Return type
488
+
489
+ [**AutoOrderResponse**](AutoOrderResponse.md)
490
+
491
+ ### Authorization
492
+
493
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
494
+
495
+ ### HTTP request headers
496
+
497
+ - **Content-Type**: Not defined
498
+ - **Accept**: application/json
499
+
500
+
501
+ ## get_auto_order_by_reference_order_id
502
+
503
+ > <AutoOrderResponse> get_auto_order_by_reference_order_id(reference_order_id, opts)
504
+
505
+ Retrieve an auto order by order id
506
+
507
+ Retrieves a single auto order using the specified reference (original) order id.
508
+
509
+
510
+ ### Examples
511
+
512
+ ```ruby
513
+ require 'ultracart_api'
514
+ require_relative '../constants'
515
+
516
+ # This example illustrates how to query an auto order when you know the original order id.
517
+
518
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
519
+
520
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
521
+ # and may become stale. Please review the master website when in doubt.
522
+ # items
523
+ # items.future_schedules
524
+ # items.sample_schedule
525
+ # original_order
526
+ # original_order.affiliate
527
+ # original_order.affiliate.ledger
528
+ # original_order.auto_order
529
+ # original_order.billing
530
+ # original_order.buysafe
531
+ # original_order.channel_partner
532
+ # original_order.checkout
533
+ # original_order.coupon
534
+ # original_order.customer_profile
535
+ # original_order.digital_order
536
+ # original_order.edi
537
+ # original_order.fraud_score
538
+ # original_order.gift
539
+ # original_order.gift_certificate
540
+ # original_order.internal
541
+ # original_order.item
542
+ # original_order.linked_shipment
543
+ # original_order.marketing
544
+ # original_order.payment
545
+ # original_order.payment.transaction
546
+ # original_order.quote
547
+ # original_order.salesforce
548
+ # original_order.shipping
549
+ # original_order.summary
550
+ # original_order.taxes
551
+ # rebill_orders
552
+ # rebill_orders.affiliate
553
+ # rebill_orders.affiliate.ledger
554
+ # rebill_orders.auto_order
555
+ # rebill_orders.billing
556
+ # rebill_orders.buysafe
557
+ # rebill_orders.channel_partner
558
+ # rebill_orders.checkout
559
+ # rebill_orders.coupon
560
+ # rebill_orders.customer_profile
561
+ # rebill_orders.digital_order
562
+ # rebill_orders.edi
563
+ # rebill_orders.fraud_score
564
+ # rebill_orders.gift
565
+ # rebill_orders.gift_certificate
566
+ # rebill_orders.internal
567
+ # rebill_orders.item
568
+ # rebill_orders.linked_shipment
569
+ # rebill_orders.marketing
570
+ # rebill_orders.payment
571
+ # rebill_orders.payment.transaction
572
+ # rebill_orders.quote
573
+ # rebill_orders.salesforce
574
+ # rebill_orders.shipping
575
+ # rebill_orders.summary
576
+ # rebill_orders.taxes
577
+
578
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
579
+ original_order_id = "DEMO-12345678"
580
+ api_response = auto_order_api.get_auto_order_by_reference_order_id(original_order_id, { '_expand' => expand })
581
+ auto_order = api_response.auto_order
582
+
583
+ # this will be verbose...
584
+ puts auto_order.inspect
585
+ ```
586
+
587
+
588
+ #### Using the get_auto_order_by_reference_order_id_with_http_info variant
589
+
590
+ This returns an Array which contains the response data, status code and headers.
591
+
592
+ > <Array(<AutoOrderResponse>, Integer, Hash)> get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
593
+
594
+ ```ruby
595
+ begin
596
+ # Retrieve an auto order by order id
597
+ data, status_code, headers = api_instance.get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts)
598
+ p status_code # => 2xx
599
+ p headers # => { ... }
600
+ p data # => <AutoOrderResponse>
601
+ rescue UltracartClient::ApiError => e
602
+ puts "Error when calling AutoOrderApi->get_auto_order_by_reference_order_id_with_http_info: #{e}"
603
+ end
604
+ ```
605
+
606
+ ### Parameters
607
+
608
+ | Name | Type | Description | Notes |
609
+ | ---- | ---- | ----------- | ----- |
610
+ | **reference_order_id** | **String** | The auto order oid to retrieve. | |
611
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
612
+
613
+ ### Return type
614
+
615
+ [**AutoOrderResponse**](AutoOrderResponse.md)
616
+
617
+ ### Authorization
618
+
619
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
620
+
621
+ ### HTTP request headers
622
+
623
+ - **Content-Type**: Not defined
624
+ - **Accept**: application/json
625
+
626
+
627
+ ## get_auto_order_cancel_reasons
628
+
629
+ > <AutoOrderCancelReasonsResponse> get_auto_order_cancel_reasons
630
+
631
+ Retrieve auto order cancel reasons.
632
+
633
+ Retrieves auto order cancel reasons.
634
+
635
+
636
+ ### Examples
637
+
638
+
639
+ (No example for this operation).
640
+
641
+
642
+ #### Using the get_auto_order_cancel_reasons_with_http_info variant
643
+
644
+ This returns an Array which contains the response data, status code and headers.
645
+
646
+ > <Array(<AutoOrderCancelReasonsResponse>, Integer, Hash)> get_auto_order_cancel_reasons_with_http_info
647
+
648
+ ```ruby
649
+ begin
650
+ # Retrieve auto order cancel reasons.
651
+ data, status_code, headers = api_instance.get_auto_order_cancel_reasons_with_http_info
652
+ p status_code # => 2xx
653
+ p headers # => { ... }
654
+ p data # => <AutoOrderCancelReasonsResponse>
655
+ rescue UltracartClient::ApiError => e
656
+ puts "Error when calling AutoOrderApi->get_auto_order_cancel_reasons_with_http_info: #{e}"
657
+ end
658
+ ```
659
+
660
+ ### Parameters
661
+
662
+ This endpoint does not need any parameter.
663
+
664
+ ### Return type
665
+
666
+ [**AutoOrderCancelReasonsResponse**](AutoOrderCancelReasonsResponse.md)
667
+
668
+ ### Authorization
669
+
670
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
671
+
672
+ ### HTTP request headers
673
+
674
+ - **Content-Type**: Not defined
675
+ - **Accept**: application/json
676
+
677
+
678
+ ## get_auto_order_emails
679
+
680
+ > <AutoOrderEmailsResponse> get_auto_order_emails(auto_order_oid)
681
+
682
+ Retrieve email delivery information for this auto order.
683
+
684
+ Retrieves email delivery records associated with the specified auto order.
685
+
686
+
687
+ ### Examples
688
+
689
+
690
+ (No example for this operation).
691
+
692
+
693
+ #### Using the get_auto_order_emails_with_http_info variant
694
+
695
+ This returns an Array which contains the response data, status code and headers.
696
+
697
+ > <Array(<AutoOrderEmailsResponse>, Integer, Hash)> get_auto_order_emails_with_http_info(auto_order_oid)
698
+
699
+ ```ruby
700
+ begin
701
+ # Retrieve email delivery information for this auto order.
702
+ data, status_code, headers = api_instance.get_auto_order_emails_with_http_info(auto_order_oid)
703
+ p status_code # => 2xx
704
+ p headers # => { ... }
705
+ p data # => <AutoOrderEmailsResponse>
706
+ rescue UltracartClient::ApiError => e
707
+ puts "Error when calling AutoOrderApi->get_auto_order_emails_with_http_info: #{e}"
708
+ end
709
+ ```
710
+
711
+ ### Parameters
712
+
713
+ | Name | Type | Description | Notes |
714
+ | ---- | ---- | ----------- | ----- |
715
+ | **auto_order_oid** | **Integer** | The auto order oid to retrieve email delivery information for. | |
716
+
717
+ ### Return type
718
+
719
+ [**AutoOrderEmailsResponse**](AutoOrderEmailsResponse.md)
720
+
721
+ ### Authorization
722
+
723
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
724
+
725
+ ### HTTP request headers
726
+
727
+ - **Content-Type**: Not defined
728
+ - **Accept**: application/json
729
+
730
+
731
+ ## get_auto_orders
732
+
733
+ > <AutoOrdersResponse> get_auto_orders(opts)
734
+
735
+ Retrieve auto orders
736
+
737
+ 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.
738
+
739
+
740
+ ### Examples
741
+
742
+ ```ruby
743
+ require 'ultracart_api'
744
+ require_relative '../constants'
745
+
746
+ # getAutoOrders provides a query service on AutoOrders (aka subscriptions or recurring orders) within the UltraCart
747
+ # system. It was the first query provided and the most cumbersome to use. Please use getAutoOrdersByQuery for an
748
+ # easier query method. If you have multiple auto_order_oids and need the corresponding objects, consider
749
+ # getAutoOrdersBatch() to reduce call count.
750
+
751
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
752
+
753
+ def get_auto_order_chunk(auto_order_api, offset, limit)
754
+ expand = "items,original_order,rebill_orders"
755
+ # see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
756
+ #
757
+ # Possible Order Expansions:
758
+ #
759
+ # add_ons items.sample_schedule original_order.buysafe original_order.payment.transaction
760
+ # items original_order original_order.channel_partner original_order.quote
761
+ # items.future_schedules original_order.affiliate original_order.checkout original_order.salesforce
762
+ # original_order.affiliate.ledger original_order.coupon original_order.shipping
763
+ # original_order.auto_order original_order.customer_profile original_order.summary
764
+ # original_order.billing original_order.digital_order original_order.taxes
765
+ # rebill_orders original_order.edi rebill_orders.affiliate
766
+ # rebill_orders.affiliate.ledger original_order.fraud_score rebill_orders.auto_order
767
+ # rebill_orders.billing original_order.gift rebill_orders.buysafe
768
+ # rebill_orders.channel_partner original_order.gift_certificate rebill_orders.checkout
769
+ # rebill_orders.coupon original_order.internal rebill_orders.customer_profile
770
+ # rebill_orders.digital_order original_order.item rebill_orders.edi
771
+ # rebill_orders.fraud_score original_order.linked_shipment rebill_orders.gift
772
+ # rebill_orders.gift_certificate original_order.marketing rebill_orders.internal
773
+ # rebill_orders.item original_order.payment rebill_orders.linked_shipment
774
+ # rebill_orders.marketing rebill_orders.payment rebill_orders.quote
775
+ # rebill_orders.payment.transaction rebill_orders.salesforce rebill_orders.shipping
776
+ # rebill_orders.summary rebill_orders.taxes
777
+
778
+ auto_order_code = nil
779
+ original_order_id = nil
780
+ first_name = nil
781
+ last_name = nil
782
+ company = nil
783
+ city = nil
784
+ state = nil
785
+ postal_code = nil
786
+ country_code = nil
787
+ phone = nil
788
+ email = 'test@ultracart.com' # <-- for this example, we are only filtering on email address.
789
+ original_order_date_begin = nil
790
+ original_order_date_end = nil
791
+ next_shipment_date_begin = nil
792
+ next_shipment_date_end = nil
793
+ card_type = nil
794
+ item_id = nil
795
+ status = nil
796
+ since = nil
797
+ sort = nil
798
+
799
+ # see all these parameters? that is why you should use getAutoOrdersByQuery() instead of getAutoOrders()
800
+ api_response = auto_order_api.get_auto_orders(auto_order_code, original_order_id, first_name, last_name,
801
+ company, city, state, postal_code, country_code, phone, email, original_order_date_begin,
802
+ original_order_date_end, next_shipment_date_begin, next_shipment_date_end, card_type, item_id, status,
803
+ limit, offset, since, sort, { '_expand' => expand })
804
+
805
+ api_response.auto_orders || []
806
+ end
807
+
808
+ auto_orders = []
809
+
810
+ iteration = 1
811
+ offset = 0
812
+ limit = 200
813
+ ```
814
+
815
+
816
+ #### Using the get_auto_orders_with_http_info variant
817
+
818
+ This returns an Array which contains the response data, status code and headers.
819
+
820
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_with_http_info(opts)
821
+
822
+ ```ruby
823
+ begin
824
+ # Retrieve auto orders
825
+ data, status_code, headers = api_instance.get_auto_orders_with_http_info(opts)
826
+ p status_code # => 2xx
827
+ p headers # => { ... }
828
+ p data # => <AutoOrdersResponse>
829
+ rescue UltracartClient::ApiError => e
830
+ puts "Error when calling AutoOrderApi->get_auto_orders_with_http_info: #{e}"
831
+ end
832
+ ```
833
+
834
+ ### Parameters
835
+
836
+ | Name | Type | Description | Notes |
837
+ | ---- | ---- | ----------- | ----- |
838
+ | **auto_order_code** | **String** | Auto order code | [optional] |
839
+ | **original_order_id** | **String** | Original order id | [optional] |
840
+ | **first_name** | **String** | First name | [optional] |
841
+ | **last_name** | **String** | Last name | [optional] |
842
+ | **company** | **String** | Company | [optional] |
843
+ | **city** | **String** | City | [optional] |
844
+ | **state** | **String** | State | [optional] |
845
+ | **postal_code** | **String** | Postal code | [optional] |
846
+ | **country_code** | **String** | Country code (ISO-3166 two letter) | [optional] |
847
+ | **phone** | **String** | Phone | [optional] |
848
+ | **email** | **String** | Email | [optional] |
849
+ | **original_order_date_begin** | **String** | Original order date begin | [optional] |
850
+ | **original_order_date_end** | **String** | Original order date end | [optional] |
851
+ | **next_shipment_date_begin** | **String** | Next shipment date begin | [optional] |
852
+ | **next_shipment_date_end** | **String** | Next shipment date end | [optional] |
853
+ | **card_type** | **String** | Card type | [optional] |
854
+ | **item_id** | **String** | Item ID | [optional] |
855
+ | **status** | **String** | Status | [optional] |
856
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Max 200) | [optional][default to 100] |
857
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
858
+ | **_since** | **String** | Fetch auto orders that have been created/modified since this date/time. | [optional] |
859
+ | **_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] |
860
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
861
+
862
+ ### Return type
863
+
864
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
865
+
866
+ ### Authorization
867
+
868
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
869
+
870
+ ### HTTP request headers
871
+
872
+ - **Content-Type**: Not defined
873
+ - **Accept**: application/json
874
+
875
+
876
+ ## get_auto_orders_batch
877
+
878
+ > <AutoOrdersResponse> get_auto_orders_batch(auto_order_batch, opts)
879
+
880
+ Retrieve auto order batch
881
+
882
+ 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.
883
+
884
+
885
+ ### Examples
886
+
887
+ ```ruby
888
+ require 'ultracart_api'
889
+ require_relative '../constants'
890
+
891
+ # This example illustrates how to retrieve auto orders when you have a list of auto_order_oid.
892
+
893
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
894
+
895
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
896
+ # and may become stale. Please review the master website when in doubt.
897
+ # items
898
+ # items.future_schedules
899
+ # items.sample_schedule
900
+ # original_order
901
+ # original_order.affiliate
902
+ # original_order.affiliate.ledger
903
+ # original_order.auto_order
904
+ # original_order.billing
905
+ # original_order.buysafe
906
+ # original_order.channel_partner
907
+ # original_order.checkout
908
+ # original_order.coupon
909
+ # original_order.customer_profile
910
+ # original_order.digital_order
911
+ # original_order.edi
912
+ # original_order.fraud_score
913
+ # original_order.gift
914
+ # original_order.gift_certificate
915
+ # original_order.internal
916
+ # original_order.item
917
+ # original_order.linked_shipment
918
+ # original_order.marketing
919
+ # original_order.payment
920
+ # original_order.payment.transaction
921
+ # original_order.quote
922
+ # original_order.salesforce
923
+ # original_order.shipping
924
+ # original_order.summary
925
+ # original_order.taxes
926
+ # rebill_orders
927
+ # rebill_orders.affiliate
928
+ # rebill_orders.affiliate.ledger
929
+ # rebill_orders.auto_order
930
+ # rebill_orders.billing
931
+ # rebill_orders.buysafe
932
+ # rebill_orders.channel_partner
933
+ # rebill_orders.checkout
934
+ # rebill_orders.coupon
935
+ # rebill_orders.customer_profile
936
+ # rebill_orders.digital_order
937
+ # rebill_orders.edi
938
+ # rebill_orders.fraud_score
939
+ # rebill_orders.gift
940
+ # rebill_orders.gift_certificate
941
+ # rebill_orders.internal
942
+ # rebill_orders.item
943
+ # rebill_orders.linked_shipment
944
+ # rebill_orders.marketing
945
+ # rebill_orders.payment
946
+ # rebill_orders.payment.transaction
947
+ # rebill_orders.quote
948
+ # rebill_orders.salesforce
949
+ # rebill_orders.shipping
950
+ # rebill_orders.summary
951
+ # rebill_orders.taxes
952
+
953
+ expand = "items,items.future_schedules,original_order,rebill_orders" # contact us if you're unsure what you need
954
+ auto_order_oids = [123456, 234567, 345678, 456789]
955
+ batch_request = UltracartClient::AutoOrderQueryBatch.new
956
+ batch_request.auto_order_oids = auto_order_oids
957
+ api_response = auto_order_api.get_auto_orders_batch(batch_request, { '_expand' => expand })
958
+ auto_orders = api_response.auto_orders
959
+
960
+ # this will be verbose...
961
+ puts auto_orders.inspect
962
+ ```
963
+
964
+
965
+ #### Using the get_auto_orders_batch_with_http_info variant
966
+
967
+ This returns an Array which contains the response data, status code and headers.
968
+
969
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_batch_with_http_info(auto_order_batch, opts)
970
+
971
+ ```ruby
972
+ begin
973
+ # Retrieve auto order batch
974
+ data, status_code, headers = api_instance.get_auto_orders_batch_with_http_info(auto_order_batch, opts)
975
+ p status_code # => 2xx
976
+ p headers # => { ... }
977
+ p data # => <AutoOrdersResponse>
978
+ rescue UltracartClient::ApiError => e
979
+ puts "Error when calling AutoOrderApi->get_auto_orders_batch_with_http_info: #{e}"
980
+ end
981
+ ```
982
+
983
+ ### Parameters
984
+
985
+ | Name | Type | Description | Notes |
986
+ | ---- | ---- | ----------- | ----- |
987
+ | **auto_order_batch** | [**AutoOrderQueryBatch**](AutoOrderQueryBatch.md) | Auto order batch | |
988
+ | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
989
+
990
+ ### Return type
991
+
992
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
993
+
994
+ ### Authorization
995
+
996
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
997
+
998
+ ### HTTP request headers
999
+
1000
+ - **Content-Type**: application/json
1001
+ - **Accept**: application/json
1002
+
1003
+
1004
+ ## get_auto_orders_by_query
1005
+
1006
+ > <AutoOrdersResponse> get_auto_orders_by_query(auto_order_query, opts)
1007
+
1008
+ Retrieve auto orders by query
1009
+
1010
+ 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.
1011
+
1012
+
1013
+ ### Examples
1014
+
1015
+ ```ruby
1016
+ require 'ultracart_api'
1017
+ require_relative '../constants'
1018
+
1019
+ # This example illustrates how to retrieve auto orders and handle pagination.
1020
+
1021
+ # Initialize the API
1022
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1023
+
1024
+ def get_auto_order_chunk(auto_order_api, offset, limit)
1025
+ # These are the possible expansion values for auto orders. This list is taken from www.ultracart.com/api/
1026
+ # and may become stale. Please review the master website when in doubt.
1027
+ # items
1028
+ # items.future_schedules
1029
+ # items.sample_schedule
1030
+ # original_order
1031
+ # original_order.affiliate
1032
+ # original_order.affiliate.ledger
1033
+ # original_order.auto_order
1034
+ # original_order.billing
1035
+ # original_order.buysafe
1036
+ # original_order.channel_partner
1037
+ # original_order.checkout
1038
+ # original_order.coupon
1039
+ # original_order.customer_profile
1040
+ # original_order.digital_order
1041
+ # original_order.edi
1042
+ # original_order.fraud_score
1043
+ # original_order.gift
1044
+ # original_order.gift_certificate
1045
+ # original_order.internal
1046
+ # original_order.item
1047
+ # original_order.linked_shipment
1048
+ # original_order.marketing
1049
+ # original_order.payment
1050
+ # original_order.payment.transaction
1051
+ # original_order.quote
1052
+ # original_order.salesforce
1053
+ # original_order.shipping
1054
+ # original_order.summary
1055
+ # original_order.taxes
1056
+ # rebill_orders
1057
+ # rebill_orders.affiliate
1058
+ # rebill_orders.affiliate.ledger
1059
+ # rebill_orders.auto_order
1060
+ # rebill_orders.billing
1061
+ # rebill_orders.buysafe
1062
+ # rebill_orders.channel_partner
1063
+ # rebill_orders.checkout
1064
+ # rebill_orders.coupon
1065
+ # rebill_orders.customer_profile
1066
+ # rebill_orders.digital_order
1067
+ # rebill_orders.edi
1068
+ # rebill_orders.fraud_score
1069
+ # rebill_orders.gift
1070
+ # rebill_orders.gift_certificate
1071
+ # rebill_orders.internal
1072
+ # rebill_orders.item
1073
+ # rebill_orders.linked_shipment
1074
+ # rebill_orders.marketing
1075
+ # rebill_orders.payment
1076
+ # rebill_orders.payment.transaction
1077
+ # rebill_orders.quote
1078
+ # rebill_orders.salesforce
1079
+ # rebill_orders.shipping
1080
+ # rebill_orders.summary
1081
+ # rebill_orders.taxes
1082
+
1083
+ # contact us if you're unsure what you need
1084
+ expand = "items,items.future_schedules,original_order,rebill_orders"
1085
+
1086
+ # These are the supported sorting fields:
1087
+ # auto_order_code
1088
+ # order_id
1089
+ # shipping.company
1090
+ # shipping.first_name
1091
+ # shipping.last_name
1092
+ # shipping.city
1093
+ # shipping.state_region
1094
+ # shipping.postal_code
1095
+ # shipping.country_code
1096
+ # billing.phone
1097
+ # billing.email
1098
+ # billing.cc_email
1099
+ # billing.company
1100
+ # billing.first_name
1101
+ # billing.last_name
1102
+ # billing.city
1103
+ # billing.state
1104
+ # billing.postal_code
1105
+ # billing.country_code
1106
+ # creation_dts
1107
+ # payment.payment_dts
1108
+ # checkout.screen_branding_theme_code
1109
+ # next_shipment_dts
1110
+
1111
+ query = UltracartClient::AutoOrderQuery.new
1112
+ query.email = "support@ultracart.com"
1113
+
1114
+ opts = {
1115
+ _limit: limit,
1116
+ _offset: offset,
1117
+ _sort: "next_shipment_dts",
1118
+ _expand: expand
1119
+ }
1120
+
1121
+ api_response = auto_order_api.get_auto_orders_by_query(query, opts)
1122
+
1123
+ return [] if api_response.auto_orders.nil?
1124
+ api_response.auto_orders
1125
+ end
1126
+
1127
+ auto_orders = []
1128
+ iteration = 1
1129
+ offset = 0
1130
+ limit = 200
1131
+ more_records_to_fetch = true
1132
+
1133
+ begin
1134
+ while more_records_to_fetch
1135
+ puts "executing iteration #{iteration}"
1136
+
1137
+ chunk_of_orders = get_auto_order_chunk(auto_order_api, offset, limit)
1138
+ auto_orders.concat(chunk_of_orders)
1139
+ offset += limit
1140
+ more_records_to_fetch = chunk_of_orders.length == limit
1141
+ iteration += 1
1142
+ end
1143
+ rescue UltracartClient::ApiError => e
1144
+ puts "ApiError occurred on iteration #{iteration}"
1145
+ puts e.inspect
1146
+ exit 1
1147
+ end
1148
+
1149
+ # this will be verbose...
1150
+ puts auto_orders.inspect
1151
+ ```
1152
+
1153
+
1154
+ #### Using the get_auto_orders_by_query_with_http_info variant
1155
+
1156
+ This returns an Array which contains the response data, status code and headers.
1157
+
1158
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> get_auto_orders_by_query_with_http_info(auto_order_query, opts)
1159
+
1160
+ ```ruby
1161
+ begin
1162
+ # Retrieve auto orders by query
1163
+ data, status_code, headers = api_instance.get_auto_orders_by_query_with_http_info(auto_order_query, opts)
1164
+ p status_code # => 2xx
1165
+ p headers # => { ... }
1166
+ p data # => <AutoOrdersResponse>
1167
+ rescue UltracartClient::ApiError => e
1168
+ puts "Error when calling AutoOrderApi->get_auto_orders_by_query_with_http_info: #{e}"
1169
+ end
1170
+ ```
1171
+
1172
+ ### Parameters
1173
+
1174
+ | Name | Type | Description | Notes |
1175
+ | ---- | ---- | ----------- | ----- |
1176
+ | **auto_order_query** | [**AutoOrderQuery**](AutoOrderQuery.md) | Auto order query | |
1177
+ | **_limit** | **Integer** | The maximum number of records to return on this one API call. (Maximum 200) | [optional][default to 100] |
1178
+ | **_offset** | **Integer** | Pagination of the record set. Offset is a zero based index. | [optional][default to 0] |
1179
+ | **_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] |
1180
+ | **_expand** | **String** | The object expansion to perform on the result. | [optional] |
1181
+
1182
+ ### Return type
1183
+
1184
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
1185
+
1186
+ ### Authorization
1187
+
1188
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1189
+
1190
+ ### HTTP request headers
1191
+
1192
+ - **Content-Type**: application/json
1193
+ - **Accept**: application/json
1194
+
1195
+
1196
+ ## pause_auto_order
1197
+
1198
+ > <AutoOrderResponse> pause_auto_order(auto_order_oid, auto_order, opts)
1199
+
1200
+ Pause auto order
1201
+
1202
+ Completely pause an auto order
1203
+
1204
+
1205
+ ### Examples
1206
+
1207
+ ```ruby
1208
+ # This is a convenience method created for an UltraCart merchant to pause a large number of auto orders
1209
+ # due to an inventory shortage. This is not new functionality and can be accomplished with the normal updateAutoOrder
1210
+ # call. It does the following logic to an auto order:
1211
+ # for each item in the auto order:
1212
+ # if the item is not paused, pause it, setPause(true)
1213
+ # save the changes by calling updateAutoOrder()
1214
+ #
1215
+ # Some warnings if you choose to use this method.
1216
+ # There are no convenience methods to unpause auto orders.
1217
+ # There are no convenience methods to query which auto orders are paused.
1218
+ # We do not recommend pausing auto orders and the merchant is on their own to manage auto order state if they
1219
+ # choose to begin pausing orders. Keep good track of what you're doing.
1220
+
1221
+ require_relative '../constants'
1222
+ require 'ultracart_api'
1223
+
1224
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1225
+
1226
+ expand = "items" # see https://www.ultracart.com/api/#resource_auto_order.html for list
1227
+ auto_order_oid = 123456789 # get an auto order and update it. There are many ways to retrieve an auto order.
1228
+ get_response = auto_order_api.get_auto_order(auto_order_oid, {_expand: expand})
1229
+ auto_order = get_response.auto_order
1230
+
1231
+ pause_response = auto_order_api.pause_auto_order(auto_order_oid, auto_order)
1232
+ paused_auto_order = pause_response.auto_order
1233
+ puts paused_auto_order.inspect
1234
+ ```
1235
+
1236
+
1237
+ #### Using the pause_auto_order_with_http_info variant
1238
+
1239
+ This returns an Array which contains the response data, status code and headers.
1240
+
1241
+ > <Array(<AutoOrderResponse>, Integer, Hash)> pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1242
+
1243
+ ```ruby
1244
+ begin
1245
+ # Pause auto order
1246
+ data, status_code, headers = api_instance.pause_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1247
+ p status_code # => 2xx
1248
+ p headers # => { ... }
1249
+ p data # => <AutoOrderResponse>
1250
+ rescue UltracartClient::ApiError => e
1251
+ puts "Error when calling AutoOrderApi->pause_auto_order_with_http_info: #{e}"
1252
+ end
1253
+ ```
1254
+
1255
+ ### Parameters
1256
+
1257
+ | Name | Type | Description | Notes |
1258
+ | ---- | ---- | ----------- | ----- |
1259
+ | **auto_order_oid** | **Integer** | The auto order oid to pause. | |
1260
+ | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to pause | |
1261
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1262
+
1263
+ ### Return type
1264
+
1265
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1266
+
1267
+ ### Authorization
1268
+
1269
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1270
+
1271
+ ### HTTP request headers
1272
+
1273
+ - **Content-Type**: application/json; charset=UTF-8
1274
+ - **Accept**: application/json
1275
+
1276
+
1277
+ ## update_auto_order
1278
+
1279
+ > <AutoOrderResponse> update_auto_order(auto_order_oid, auto_order, opts)
1280
+
1281
+ Update an auto order
1282
+
1283
+ Update an auto order on the UltraCart account. To cancel an auto order, set enabled to false and supply either cancel_reason or canceled_by_user, which records the change as a cancellation and fires the auto order cancel notifications. Setting enabled to false without either field records a disable.
1284
+
1285
+
1286
+ ### Examples
1287
+
1288
+ ```ruby
1289
+ # frozen_string_literal: true
1290
+
1291
+ # Rules for updating auto orders (recurring orders)
1292
+ # To change the item that is delivered, change the AutoOrder.items[x].arbitrary_item_id
1293
+ # To change the schedule (frequency) of when an item is delivered, change the original item. It controls schedule
1294
+ # To change the original item: AutoOrder.items[x].original_item_id
1295
+ #
1296
+ # Alternate method: Replace the item altogether. Delete the current one and replace it with another item
1297
+ # Note: The replacement item must be an auto order item. (Edit item in backend, click on Auto Order tab)
1298
+ # This is more complex as you must supply all the required fields.
1299
+
1300
+ require 'json'
1301
+ require 'ultracart_api'
1302
+
1303
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
1304
+ # ao is short for 'auto order', and is used heavily below.
1305
+ ao_api = UltracartClient::AutoOrderApi.new_using_api_key(simple_key, false, false)
1306
+ email = 'test@test.com'
1307
+
1308
+
1309
+ query = UltracartClient::AutoOrderQuery.new
1310
+ query.email = email
1311
+ expansion = 'items,items.future_schedules,items.simple_schedule,rebill_orders'
1312
+ ao_response = ao_api.get_auto_orders_by_query(query, { _expand: expansion })
1313
+
1314
+ # there should only be one auto order for a customer. that's typical.
1315
+ # If you are marketing more than one, than you must loop through the result set
1316
+ # and find the auto order you're looking for manually
1317
+
1318
+ auto_order = ao_response.auto_orders[0]
1319
+
1320
+ existing_item = 'OldItemID'
1321
+ upgrade_item = 'NewItemID'
1322
+
1323
+ auto_order.items.each do |auto_order_item|
1324
+ auto_order_item.arbitrary_item_id = upgrade_item if auto_order_item.original_item_id = existing_item
1325
+ end
1326
+
1327
+ # save the auto order with the updated item.
1328
+ ao_api.update_auto_order(auto_order, auto_order.auto_order_oid, { _expand: expansion })
1329
+
1330
+
1331
+
1332
+
1333
+ ```
1334
+
1335
+
1336
+ #### Using the update_auto_order_with_http_info variant
1337
+
1338
+ This returns an Array which contains the response data, status code and headers.
1339
+
1340
+ > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1341
+
1342
+ ```ruby
1343
+ begin
1344
+ # Update an auto order
1345
+ data, status_code, headers = api_instance.update_auto_order_with_http_info(auto_order_oid, auto_order, opts)
1346
+ p status_code # => 2xx
1347
+ p headers # => { ... }
1348
+ p data # => <AutoOrderResponse>
1349
+ rescue UltracartClient::ApiError => e
1350
+ puts "Error when calling AutoOrderApi->update_auto_order_with_http_info: #{e}"
1351
+ end
1352
+ ```
1353
+
1354
+ ### Parameters
1355
+
1356
+ | Name | Type | Description | Notes |
1357
+ | ---- | ---- | ----------- | ----- |
1358
+ | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1359
+ | **auto_order** | [**AutoOrder**](AutoOrder.md) | Auto order to update | |
1360
+ | **validate_original_order** | **String** | Validate original order before updating | [optional] |
1361
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1362
+
1363
+ ### Return type
1364
+
1365
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1366
+
1367
+ ### Authorization
1368
+
1369
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1370
+
1371
+ ### HTTP request headers
1372
+
1373
+ - **Content-Type**: application/json; charset=UTF-8
1374
+ - **Accept**: application/json
1375
+
1376
+
1377
+ ## update_auto_order_item_add_ons
1378
+
1379
+ > <AutoOrderResponse> update_auto_order_item_add_ons(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1380
+
1381
+ Update an auto order item add ons
1382
+
1383
+ Update an auto order item add ons. Returns the auto order based upon expansion
1384
+
1385
+
1386
+ ### Examples
1387
+
1388
+
1389
+ (No example for this operation).
1390
+
1391
+
1392
+ #### Using the update_auto_order_item_add_ons_with_http_info variant
1393
+
1394
+ This returns an Array which contains the response data, status code and headers.
1395
+
1396
+ > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_item_add_ons_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1397
+
1398
+ ```ruby
1399
+ begin
1400
+ # Update an auto order item add ons
1401
+ data, status_code, headers = api_instance.update_auto_order_item_add_ons_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_add_ons_update_request, opts)
1402
+ p status_code # => 2xx
1403
+ p headers # => { ... }
1404
+ p data # => <AutoOrderResponse>
1405
+ rescue UltracartClient::ApiError => e
1406
+ puts "Error when calling AutoOrderApi->update_auto_order_item_add_ons_with_http_info: #{e}"
1407
+ end
1408
+ ```
1409
+
1410
+ ### Parameters
1411
+
1412
+ | Name | Type | Description | Notes |
1413
+ | ---- | ---- | ----------- | ----- |
1414
+ | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1415
+ | **auto_order_item_oid** | **Integer** | The auto order item oid to update. | |
1416
+ | **auto_order_add_ons_update_request** | [**AutoOrderAddonItemsUpdateRequest**](AutoOrderAddonItemsUpdateRequest.md) | Auto order add ons update request | |
1417
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1418
+
1419
+ ### Return type
1420
+
1421
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1422
+
1423
+ ### Authorization
1424
+
1425
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1426
+
1427
+ ### HTTP request headers
1428
+
1429
+ - **Content-Type**: application/json; charset=UTF-8
1430
+ - **Accept**: application/json
1431
+
1432
+
1433
+ ## update_auto_order_item_properties
1434
+
1435
+ > <AutoOrderResponse> update_auto_order_item_properties(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1436
+
1437
+ Update an auto order item properties
1438
+
1439
+ Update an auto order item properties. Returns the auto order based upon expansion
1440
+
1441
+
1442
+ ### Examples
1443
+
1444
+
1445
+ (No example for this operation).
1446
+
1447
+
1448
+ #### Using the update_auto_order_item_properties_with_http_info variant
1449
+
1450
+ This returns an Array which contains the response data, status code and headers.
1451
+
1452
+ > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_item_properties_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1453
+
1454
+ ```ruby
1455
+ begin
1456
+ # Update an auto order item properties
1457
+ data, status_code, headers = api_instance.update_auto_order_item_properties_with_http_info(auto_order_oid, auto_order_item_oid, auto_order_properties_update_request, opts)
1458
+ p status_code # => 2xx
1459
+ p headers # => { ... }
1460
+ p data # => <AutoOrderResponse>
1461
+ rescue UltracartClient::ApiError => e
1462
+ puts "Error when calling AutoOrderApi->update_auto_order_item_properties_with_http_info: #{e}"
1463
+ end
1464
+ ```
1465
+
1466
+ ### Parameters
1467
+
1468
+ | Name | Type | Description | Notes |
1469
+ | ---- | ---- | ----------- | ----- |
1470
+ | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1471
+ | **auto_order_item_oid** | **Integer** | The auto order item oid to update. | |
1472
+ | **auto_order_properties_update_request** | [**AutoOrderPropertiesUpdateRequest**](AutoOrderPropertiesUpdateRequest.md) | Auto order property update request | |
1473
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1474
+
1475
+ ### Return type
1476
+
1477
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1478
+
1479
+ ### Authorization
1480
+
1481
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1482
+
1483
+ ### HTTP request headers
1484
+
1485
+ - **Content-Type**: application/json; charset=UTF-8
1486
+ - **Accept**: application/json
1487
+
1488
+
1489
+ ## update_auto_order_payment
1490
+
1491
+ > <AutoOrderRebillResponse> update_auto_order_payment(auto_order_oid, auto_order_payment_update_request, opts)
1492
+
1493
+ Update the payment information on an auto order
1494
+
1495
+ Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1496
+
1497
+
1498
+ ### Examples
1499
+
1500
+
1501
+ (No example for this operation).
1502
+
1503
+
1504
+ #### Using the update_auto_order_payment_with_http_info variant
1505
+
1506
+ This returns an Array which contains the response data, status code and headers.
1507
+
1508
+ > <Array(<AutoOrderRebillResponse>, Integer, Hash)> update_auto_order_payment_with_http_info(auto_order_oid, auto_order_payment_update_request, opts)
1509
+
1510
+ ```ruby
1511
+ begin
1512
+ # Update the payment information on an auto order
1513
+ data, status_code, headers = api_instance.update_auto_order_payment_with_http_info(auto_order_oid, auto_order_payment_update_request, opts)
1514
+ p status_code # => 2xx
1515
+ p headers # => { ... }
1516
+ p data # => <AutoOrderRebillResponse>
1517
+ rescue UltracartClient::ApiError => e
1518
+ puts "Error when calling AutoOrderApi->update_auto_order_payment_with_http_info: #{e}"
1519
+ end
1520
+ ```
1521
+
1522
+ ### Parameters
1523
+
1524
+ | Name | Type | Description | Notes |
1525
+ | ---- | ---- | ----------- | ----- |
1526
+ | **auto_order_oid** | **Integer** | The auto order oid to update payment information on. | |
1527
+ | **auto_order_payment_update_request** | [**AutoOrderPaymentUpdateRequest**](AutoOrderPaymentUpdateRequest.md) | Payment information to place on the auto order | |
1528
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1529
+
1530
+ ### Return type
1531
+
1532
+ [**AutoOrderRebillResponse**](AutoOrderRebillResponse.md)
1533
+
1534
+ ### Authorization
1535
+
1536
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1537
+
1538
+ ### HTTP request headers
1539
+
1540
+ - **Content-Type**: application/json; charset=UTF-8
1541
+ - **Accept**: application/json
1542
+
1543
+
1544
+ ## update_auto_order_properties
1545
+
1546
+ > <AutoOrderResponse> update_auto_order_properties(auto_order_oid, auto_order_properties_update_request, opts)
1547
+
1548
+ Update an auto order properties
1549
+
1550
+ Update an auto order properties. Returns the auto order based upon expansion
1551
+
1552
+
1553
+ ### Examples
1554
+
1555
+
1556
+ (No example for this operation).
1557
+
1558
+
1559
+ #### Using the update_auto_order_properties_with_http_info variant
1560
+
1561
+ This returns an Array which contains the response data, status code and headers.
1562
+
1563
+ > <Array(<AutoOrderResponse>, Integer, Hash)> update_auto_order_properties_with_http_info(auto_order_oid, auto_order_properties_update_request, opts)
1564
+
1565
+ ```ruby
1566
+ begin
1567
+ # Update an auto order properties
1568
+ data, status_code, headers = api_instance.update_auto_order_properties_with_http_info(auto_order_oid, auto_order_properties_update_request, opts)
1569
+ p status_code # => 2xx
1570
+ p headers # => { ... }
1571
+ p data # => <AutoOrderResponse>
1572
+ rescue UltracartClient::ApiError => e
1573
+ puts "Error when calling AutoOrderApi->update_auto_order_properties_with_http_info: #{e}"
1574
+ end
1575
+ ```
1576
+
1577
+ ### Parameters
1578
+
1579
+ | Name | Type | Description | Notes |
1580
+ | ---- | ---- | ----------- | ----- |
1581
+ | **auto_order_oid** | **Integer** | The auto order oid to update. | |
1582
+ | **auto_order_properties_update_request** | [**AutoOrderPropertiesUpdateRequest**](AutoOrderPropertiesUpdateRequest.md) | Auto order property update request | |
1583
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1584
+
1585
+ ### Return type
1586
+
1587
+ [**AutoOrderResponse**](AutoOrderResponse.md)
1588
+
1589
+ ### Authorization
1590
+
1591
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1592
+
1593
+ ### HTTP request headers
1594
+
1595
+ - **Content-Type**: application/json; charset=UTF-8
1596
+ - **Accept**: application/json
1597
+
1598
+
1599
+ ## update_auto_orders_batch
1600
+
1601
+ > <AutoOrdersResponse> update_auto_orders_batch(auto_orders_request, opts)
1602
+
1603
+ Update multiple auto orders
1604
+
1605
+ Update multiple auto orders on the UltraCart account. To cancel an auto order, set enabled to false and supply either cancel_reason or canceled_by_user, which records the change as a cancellation and fires the auto order cancel notifications. Setting enabled to false without either field records a disable.
1606
+
1607
+
1608
+ ### Examples
1609
+
1610
+ ```ruby
1611
+ require 'ultracart_api'
1612
+ require_relative '../constants'
1613
+
1614
+ # This method allows for updating multiple auto orders.
1615
+ # Warning: Take great care editing auto orders. They are complex.
1616
+ # Sometimes you must change the original_order to affect the auto_order. If you have questions about what fields
1617
+ # to update to achieve your desired change, contact UltraCart support. Better to ask and get it right than to
1618
+ # make a bad assumption and corrupt a thousand auto orders. UltraCart support is ready to assist.
1619
+
1620
+ auto_order_api = UltracartClient::AutoOrderApi.new_using_api_key(Constants::API_KEY)
1621
+
1622
+ # The _async parameter is what it seems. True if async.
1623
+ # The max records allowed depends on the async flag. Synch max is 20, Asynch max is 100.
1624
+
1625
+ # if true, success returns back a 204 No Content. False returns back the updated orders.
1626
+ async = true
1627
+
1628
+ # since we're async, nothing is returned, so we don't care about expansions.
1629
+ # If you are doing a synchronous operation, then set your expand appropriately. set get_auto_orders
1630
+ # sample for expansion samples.
1631
+ expand = nil
1632
+
1633
+ # mostly used for UI, not needed for a pure scripting operation.
1634
+ placeholders = false
1635
+
1636
+ # TODO: This should be an array of auto orders that have been updated. See any get_auto_orders method for retrieval.
1637
+ auto_orders = []
1638
+
1639
+ auto_orders_request = UltracartClient::AutoOrdersRequest.new
1640
+ auto_orders_request.auto_orders = auto_orders
1641
+
1642
+ opts = {
1643
+ _expand: expand,
1644
+ _placeholders: placeholders,
1645
+ _async: async
1646
+ }
1647
+
1648
+ api_response = auto_order_api.update_auto_orders_batch(auto_orders_request, opts)
1649
+
1650
+ # something went wrong if we have a response.
1651
+ puts api_response.inspect unless api_response.nil?
1652
+ ```
1653
+
1654
+
1655
+ #### Using the update_auto_orders_batch_with_http_info variant
1656
+
1657
+ This returns an Array which contains the response data, status code and headers.
1658
+
1659
+ > <Array(<AutoOrdersResponse>, Integer, Hash)> update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1660
+
1661
+ ```ruby
1662
+ begin
1663
+ # Update multiple auto orders
1664
+ data, status_code, headers = api_instance.update_auto_orders_batch_with_http_info(auto_orders_request, opts)
1665
+ p status_code # => 2xx
1666
+ p headers # => { ... }
1667
+ p data # => <AutoOrdersResponse>
1668
+ rescue UltracartClient::ApiError => e
1669
+ puts "Error when calling AutoOrderApi->update_auto_orders_batch_with_http_info: #{e}"
1670
+ end
1671
+ ```
1672
+
1673
+ ### Parameters
1674
+
1675
+ | Name | Type | Description | Notes |
1676
+ | ---- | ---- | ----------- | ----- |
1677
+ | **auto_orders_request** | [**AutoOrdersRequest**](AutoOrdersRequest.md) | Auto orders to update (synchronous maximum 20 / asynchronous maximum 100) | |
1678
+ | **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
1679
+ | **_placeholders** | **Boolean** | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
1680
+ | **_async** | **Boolean** | True if the operation should be run async. No result returned | [optional] |
1681
+
1682
+ ### Return type
1683
+
1684
+ [**AutoOrdersResponse**](AutoOrdersResponse.md)
1685
+
1686
+ ### Authorization
1687
+
1688
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1689
+
1690
+ ### HTTP request headers
1691
+
1692
+ - **Content-Type**: application/json; charset=UTF-8
1693
+ - **Accept**: application/json
1694
+