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