@teemill/orders 1.6.0 → 1.6.2

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 (103) hide show
  1. package/.openapi-generator/FILES +7 -25
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +3 -3
  4. package/api.ts +1539 -0
  5. package/base.ts +86 -0
  6. package/common.ts +150 -0
  7. package/configuration.ts +110 -0
  8. package/dist/api.d.ts +1116 -0
  9. package/dist/api.js +632 -0
  10. package/dist/base.d.ts +66 -0
  11. package/dist/base.js +65 -0
  12. package/dist/common.d.ts +65 -0
  13. package/dist/common.js +161 -0
  14. package/dist/configuration.d.ts +91 -0
  15. package/dist/configuration.js +43 -0
  16. package/dist/esm/api.d.ts +1116 -0
  17. package/dist/esm/api.js +625 -0
  18. package/dist/esm/base.d.ts +66 -0
  19. package/dist/esm/base.js +60 -0
  20. package/dist/esm/common.d.ts +65 -0
  21. package/dist/esm/common.js +149 -0
  22. package/dist/esm/configuration.d.ts +91 -0
  23. package/dist/esm/configuration.js +39 -0
  24. package/dist/{models/Status.d.ts → esm/index.d.ts} +3 -16
  25. package/dist/esm/index.js +15 -0
  26. package/dist/index.d.ts +13 -3
  27. package/dist/index.js +15 -5
  28. package/git_push.sh +57 -0
  29. package/{src/models/Status.ts → index.ts} +3 -26
  30. package/package.json +18 -4
  31. package/tsconfig.esm.json +7 -0
  32. package/tsconfig.json +4 -6
  33. package/dist/apis/OrdersApi.d.ts +0 -115
  34. package/dist/apis/OrdersApi.js +0 -531
  35. package/dist/apis/index.d.ts +0 -1
  36. package/dist/apis/index.js +0 -19
  37. package/dist/models/Address.d.ts +0 -73
  38. package/dist/models/Address.js +0 -67
  39. package/dist/models/ApiError.d.ts +0 -37
  40. package/dist/models/ApiError.js +0 -49
  41. package/dist/models/ConfirmOrderFulfillment.d.ts +0 -37
  42. package/dist/models/ConfirmOrderFulfillment.js +0 -51
  43. package/dist/models/ConfirmOrderRequest.d.ts +0 -32
  44. package/dist/models/ConfirmOrderRequest.js +0 -48
  45. package/dist/models/ConfirmOrderValidationError.d.ts +0 -47
  46. package/dist/models/ConfirmOrderValidationError.js +0 -60
  47. package/dist/models/ContactInformation.d.ts +0 -37
  48. package/dist/models/ContactInformation.js +0 -49
  49. package/dist/models/DeliveryEstimates.d.ts +0 -37
  50. package/dist/models/DeliveryEstimates.js +0 -47
  51. package/dist/models/ExportOrders202Response.d.ts +0 -31
  52. package/dist/models/ExportOrders202Response.js +0 -45
  53. package/dist/models/Fulfillment.d.ts +0 -71
  54. package/dist/models/Fulfillment.js +0 -61
  55. package/dist/models/FulfillmentItem.d.ts +0 -43
  56. package/dist/models/FulfillmentItem.js +0 -49
  57. package/dist/models/Order.d.ts +0 -135
  58. package/dist/models/Order.js +0 -90
  59. package/dist/models/OrderItem.d.ts +0 -75
  60. package/dist/models/OrderItem.js +0 -61
  61. package/dist/models/OrderItemTaxPrice.d.ts +0 -37
  62. package/dist/models/OrderItemTaxPrice.js +0 -47
  63. package/dist/models/OrderTracking.d.ts +0 -43
  64. package/dist/models/OrderTracking.js +0 -49
  65. package/dist/models/OrdersResponse.d.ts +0 -38
  66. package/dist/models/OrdersResponse.js +0 -48
  67. package/dist/models/Origin.d.ts +0 -37
  68. package/dist/models/Origin.js +0 -47
  69. package/dist/models/Price.d.ts +0 -37
  70. package/dist/models/Price.js +0 -47
  71. package/dist/models/ShippingMethod.d.ts +0 -75
  72. package/dist/models/ShippingMethod.js +0 -61
  73. package/dist/models/Status.js +0 -39
  74. package/dist/models/StatusHistoryItem.d.ts +0 -38
  75. package/dist/models/StatusHistoryItem.js +0 -48
  76. package/dist/models/index.d.ts +0 -20
  77. package/dist/models/index.js +0 -38
  78. package/dist/runtime.d.ts +0 -187
  79. package/dist/runtime.js +0 -565
  80. package/src/apis/OrdersApi.ts +0 -511
  81. package/src/apis/index.ts +0 -3
  82. package/src/index.ts +0 -5
  83. package/src/models/Address.ts +0 -120
  84. package/src/models/ApiError.ts +0 -69
  85. package/src/models/ConfirmOrderFulfillment.ts +0 -70
  86. package/src/models/ConfirmOrderRequest.ts +0 -68
  87. package/src/models/ConfirmOrderValidationError.ts +0 -83
  88. package/src/models/ContactInformation.ts +0 -69
  89. package/src/models/DeliveryEstimates.ts +0 -68
  90. package/src/models/ExportOrders202Response.ts +0 -60
  91. package/src/models/Fulfillment.ts +0 -133
  92. package/src/models/FulfillmentItem.ts +0 -76
  93. package/src/models/Order.ts +0 -239
  94. package/src/models/OrderItem.ts +0 -127
  95. package/src/models/OrderItemTaxPrice.ts +0 -68
  96. package/src/models/OrderTracking.ts +0 -76
  97. package/src/models/OrdersResponse.ts +0 -75
  98. package/src/models/Origin.ts +0 -68
  99. package/src/models/Price.ts +0 -68
  100. package/src/models/ShippingMethod.ts +0 -129
  101. package/src/models/StatusHistoryItem.ts +0 -75
  102. package/src/models/index.ts +0 -22
  103. package/src/runtime.ts +0 -441
package/api.ts ADDED
@@ -0,0 +1,1539 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Orders API
5
+ * Use this API to create and retrieve updates for print-on-demand orders. Use it to request fulfillment for variants of products attached to the given project. You can fetch details and references to these products and variants from the Product Catalog API. For full documentation on functionality and account auth settings go to [teemill.com](https://teemill.com/api-docs/orders)
6
+ *
7
+ * The version of the OpenAPI document: 1.6.2
8
+ * Contact: hello@teemill.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25
+
26
+ /**
27
+ * A person\'s address.
28
+ * @export
29
+ * @interface Address
30
+ */
31
+ export interface Address {
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof Address
36
+ */
37
+ 'contactName': string;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof Address
42
+ */
43
+ 'company'?: string;
44
+ /**
45
+ * First line of the address.
46
+ * @type {string}
47
+ * @memberof Address
48
+ */
49
+ 'line1': string;
50
+ /**
51
+ * Second line of the address.
52
+ * @type {string}
53
+ * @memberof Address
54
+ */
55
+ 'line2'?: string;
56
+ /**
57
+ * City of the address.
58
+ * @type {string}
59
+ * @memberof Address
60
+ */
61
+ 'city': string;
62
+ /**
63
+ * Postal code of the address.
64
+ * @type {string}
65
+ * @memberof Address
66
+ */
67
+ 'postalCode'?: string;
68
+ /**
69
+ * Country of the address (ISO 3166-1 alpha-2).
70
+ * @type {string}
71
+ * @memberof Address
72
+ */
73
+ 'country': string;
74
+ /**
75
+ * State of the address.
76
+ * @type {string}
77
+ * @memberof Address
78
+ */
79
+ 'state'?: string;
80
+ }
81
+ /**
82
+ *
83
+ * @export
84
+ * @interface ApiError
85
+ */
86
+ export interface ApiError {
87
+ /**
88
+ *
89
+ * @type {string}
90
+ * @memberof ApiError
91
+ */
92
+ 'code'?: string;
93
+ /**
94
+ *
95
+ * @type {string}
96
+ * @memberof ApiError
97
+ */
98
+ 'message': string;
99
+ }
100
+ /**
101
+ *
102
+ * @export
103
+ * @interface ConfirmOrderFulfillment
104
+ */
105
+ export interface ConfirmOrderFulfillment {
106
+ /**
107
+ * Unique object identifier
108
+ * @type {string}
109
+ * @memberof ConfirmOrderFulfillment
110
+ */
111
+ 'fulfillmentId': string;
112
+ /**
113
+ * Unique object identifier
114
+ * @type {string}
115
+ * @memberof ConfirmOrderFulfillment
116
+ */
117
+ 'shippingMethodId': string;
118
+ }
119
+ /**
120
+ *
121
+ * @export
122
+ * @interface ConfirmOrderRequest
123
+ */
124
+ export interface ConfirmOrderRequest {
125
+ /**
126
+ *
127
+ * @type {Array<ConfirmOrderFulfillment>}
128
+ * @memberof ConfirmOrderRequest
129
+ */
130
+ 'fulfillments': Array<ConfirmOrderFulfillment>;
131
+ }
132
+ /**
133
+ *
134
+ * @export
135
+ * @interface ConfirmOrderValidationError
136
+ */
137
+ export interface ConfirmOrderValidationError {
138
+ /**
139
+ *
140
+ * @type {string}
141
+ * @memberof ConfirmOrderValidationError
142
+ */
143
+ 'code': ConfirmOrderValidationErrorCodeEnum;
144
+ /**
145
+ *
146
+ * @type {string}
147
+ * @memberof ConfirmOrderValidationError
148
+ */
149
+ 'message': string;
150
+ }
151
+
152
+ export const ConfirmOrderValidationErrorCodeEnum = {
153
+ BadRequest: 'BAD_REQUEST',
154
+ PaymentFailed: 'PAYMENT_FAILED',
155
+ Conflict: 'CONFLICT',
156
+ ActionRequired: 'ACTION_REQUIRED'
157
+ } as const;
158
+
159
+ export type ConfirmOrderValidationErrorCodeEnum = typeof ConfirmOrderValidationErrorCodeEnum[keyof typeof ConfirmOrderValidationErrorCodeEnum];
160
+
161
+ /**
162
+ * Order recipient contact information, used only for courier tracking/updates.
163
+ * @export
164
+ * @interface ContactInformation
165
+ */
166
+ export interface ContactInformation {
167
+ /**
168
+ *
169
+ * @type {string}
170
+ * @memberof ContactInformation
171
+ */
172
+ 'email': string;
173
+ /**
174
+ *
175
+ * @type {string}
176
+ * @memberof ContactInformation
177
+ */
178
+ 'phone'?: string | null;
179
+ }
180
+ /**
181
+ *
182
+ * @export
183
+ * @interface DeliveryEstimates
184
+ */
185
+ export interface DeliveryEstimates {
186
+ /**
187
+ * ISO 8601 Timestamp
188
+ * @type {string}
189
+ * @memberof DeliveryEstimates
190
+ */
191
+ 'min'?: string;
192
+ /**
193
+ * ISO 8601 Timestamp
194
+ * @type {string}
195
+ * @memberof DeliveryEstimates
196
+ */
197
+ 'max'?: string;
198
+ }
199
+ /**
200
+ *
201
+ * @export
202
+ * @interface ExportOrders202Response
203
+ */
204
+ export interface ExportOrders202Response {
205
+ /**
206
+ * A message describing the export status
207
+ * @type {string}
208
+ * @memberof ExportOrders202Response
209
+ */
210
+ 'message'?: string;
211
+ }
212
+ /**
213
+ *
214
+ * @export
215
+ * @interface Fulfillment
216
+ */
217
+ export interface Fulfillment {
218
+ /**
219
+ * Unique fulfillment id
220
+ * @type {string}
221
+ * @memberof Fulfillment
222
+ */
223
+ 'id'?: string;
224
+ /**
225
+ *
226
+ * @type {Status}
227
+ * @memberof Fulfillment
228
+ */
229
+ 'status'?: Status;
230
+ /**
231
+ *
232
+ * @type {FulfillmentFulfiller}
233
+ * @memberof Fulfillment
234
+ */
235
+ 'fulfiller'?: FulfillmentFulfiller;
236
+ /**
237
+ *
238
+ * @type {Array<FulfillmentItem>}
239
+ * @memberof Fulfillment
240
+ */
241
+ 'items'?: Array<FulfillmentItem>;
242
+ /**
243
+ *
244
+ * @type {OrderTracking}
245
+ * @memberof Fulfillment
246
+ */
247
+ 'tracking'?: OrderTracking | null;
248
+ /**
249
+ * Shipping method currently set
250
+ * @type {ShippingMethod}
251
+ * @memberof Fulfillment
252
+ */
253
+ 'shippingMethod'?: ShippingMethod;
254
+ /**
255
+ * Shipping methods available for this fulfillment. One of these should be used to confirm the fulfillment.
256
+ * @type {Array<ShippingMethod>}
257
+ * @memberof Fulfillment
258
+ */
259
+ 'availableShippingMethods'?: Array<ShippingMethod>;
260
+ /**
261
+ * Weight of the package being shipped in grams
262
+ * @type {number}
263
+ * @memberof Fulfillment
264
+ */
265
+ 'packageWeight'?: number;
266
+ }
267
+
268
+
269
+ /**
270
+ * The fulfiller that will be processing this order.
271
+ * @export
272
+ * @interface FulfillmentFulfiller
273
+ */
274
+ export interface FulfillmentFulfiller {
275
+ /**
276
+ *
277
+ * @type {FulfillmentFulfillerLocation}
278
+ * @memberof FulfillmentFulfiller
279
+ */
280
+ 'location'?: FulfillmentFulfillerLocation;
281
+ }
282
+ /**
283
+ *
284
+ * @export
285
+ * @interface FulfillmentFulfillerLocation
286
+ */
287
+ export interface FulfillmentFulfillerLocation {
288
+ /**
289
+ *
290
+ * @type {string}
291
+ * @memberof FulfillmentFulfillerLocation
292
+ */
293
+ 'city'?: string | null;
294
+ /**
295
+ *
296
+ * @type {string}
297
+ * @memberof FulfillmentFulfillerLocation
298
+ */
299
+ 'country'?: string | null;
300
+ }
301
+ /**
302
+ *
303
+ * @export
304
+ * @interface FulfillmentItem
305
+ */
306
+ export interface FulfillmentItem {
307
+ /**
308
+ * Unique fulfillment item id
309
+ * @type {string}
310
+ * @memberof FulfillmentItem
311
+ */
312
+ 'id'?: string;
313
+ /**
314
+ * Id of the order item being fulfilled
315
+ * @type {string}
316
+ * @memberof FulfillmentItem
317
+ */
318
+ 'itemId'?: string;
319
+ /**
320
+ * Number of this item being fulfilled
321
+ * @type {number}
322
+ * @memberof FulfillmentItem
323
+ */
324
+ 'quantity'?: number;
325
+ }
326
+ /**
327
+ *
328
+ * @export
329
+ * @interface Order
330
+ */
331
+ export interface Order {
332
+ /**
333
+ * Unique object identifier
334
+ * @type {string}
335
+ * @memberof Order
336
+ */
337
+ 'id'?: string;
338
+ /**
339
+ * A reference to the resource location
340
+ * @type {string}
341
+ * @memberof Order
342
+ */
343
+ 'ref'?: string;
344
+ /**
345
+ *
346
+ * @type {Status}
347
+ * @memberof Order
348
+ */
349
+ 'status'?: Status;
350
+ /**
351
+ *
352
+ * @type {ContactInformation}
353
+ * @memberof Order
354
+ */
355
+ 'contactInformation': ContactInformation;
356
+ /**
357
+ *
358
+ * @type {Address}
359
+ * @memberof Order
360
+ */
361
+ 'shippingAddress': Address;
362
+ /**
363
+ * ISO 8601 Timestamp
364
+ * @type {string}
365
+ * @memberof Order
366
+ */
367
+ 'createdAt'?: string;
368
+ /**
369
+ * ISO 8601 Timestamp
370
+ * @type {string}
371
+ * @memberof Order
372
+ */
373
+ 'updatedAt'?: string;
374
+ /**
375
+ * A custom reference to the merchant\'s order that will be displayed on the shipping label.
376
+ * @type {string}
377
+ * @memberof Order
378
+ */
379
+ 'merchantReference'?: string | null;
380
+ /**
381
+ *
382
+ * @type {Array<Fulfillment>}
383
+ * @memberof Order
384
+ */
385
+ 'fulfillments'?: Array<Fulfillment>;
386
+ /**
387
+ *
388
+ * @type {Array<OrderItem>}
389
+ * @memberof Order
390
+ */
391
+ 'items': Array<OrderItem>;
392
+ /**
393
+ *
394
+ * @type {Price}
395
+ * @memberof Order
396
+ */
397
+ 'totalPrice'?: Price;
398
+ /**
399
+ *
400
+ * @type {Price}
401
+ * @memberof Order
402
+ */
403
+ 'taxPrice'?: Price;
404
+ /**
405
+ *
406
+ * @type {Price}
407
+ * @memberof Order
408
+ */
409
+ 'subtotalPrice'?: Price;
410
+ /**
411
+ *
412
+ * @type {Price}
413
+ * @memberof Order
414
+ */
415
+ 'discountPrice'?: Price;
416
+ /**
417
+ *
418
+ * @type {Price}
419
+ * @memberof Order
420
+ */
421
+ 'shippingPrice'?: Price;
422
+ /**
423
+ *
424
+ * @type {Origin}
425
+ * @memberof Order
426
+ */
427
+ 'origin'?: Origin;
428
+ /**
429
+ *
430
+ * @type {Array<StatusHistoryItem>}
431
+ * @memberof Order
432
+ */
433
+ 'statusHistory'?: Array<StatusHistoryItem>;
434
+ }
435
+
436
+
437
+ /**
438
+ *
439
+ * @export
440
+ * @interface OrderItem
441
+ */
442
+ export interface OrderItem {
443
+ /**
444
+ * Unique object identifier
445
+ * @type {string}
446
+ * @memberof OrderItem
447
+ */
448
+ 'id'?: string;
449
+ /**
450
+ * Reference URL to the order item variant
451
+ * @type {string}
452
+ * @memberof OrderItem
453
+ */
454
+ 'variantRef': string;
455
+ /**
456
+ *
457
+ * @type {number}
458
+ * @memberof OrderItem
459
+ */
460
+ 'quantity': number;
461
+ /**
462
+ *
463
+ * @type {Price}
464
+ * @memberof OrderItem
465
+ */
466
+ 'totalPrice'?: Price;
467
+ /**
468
+ *
469
+ * @type {OrderItemTaxPrice}
470
+ * @memberof OrderItem
471
+ */
472
+ 'taxPrice'?: OrderItemTaxPrice;
473
+ /**
474
+ *
475
+ * @type {Price}
476
+ * @memberof OrderItem
477
+ */
478
+ 'subtotalPrice'?: Price;
479
+ /**
480
+ *
481
+ * @type {Price}
482
+ * @memberof OrderItem
483
+ */
484
+ 'discountPrice'?: Price;
485
+ /**
486
+ * The price you charged the recipient for each item. It\'s highly recommended if you have international orders as it aids customs issues.
487
+ * @type {Price}
488
+ * @memberof OrderItem
489
+ */
490
+ 'recipientCost'?: Price;
491
+ }
492
+ /**
493
+ * This is an estimate until the order has been confirmed
494
+ * @export
495
+ * @interface OrderItemTaxPrice
496
+ */
497
+ export interface OrderItemTaxPrice {
498
+ /**
499
+ * Price including tax in the specified currency.
500
+ * @type {string}
501
+ * @memberof OrderItemTaxPrice
502
+ */
503
+ 'amount'?: string;
504
+ /**
505
+ * Currency code for the currency the price is valued in.
506
+ * @type {string}
507
+ * @memberof OrderItemTaxPrice
508
+ */
509
+ 'currencyCode'?: string;
510
+ }
511
+ /**
512
+ *
513
+ * @export
514
+ * @interface OrderTracking
515
+ */
516
+ export interface OrderTracking {
517
+ /**
518
+ *
519
+ * @type {string}
520
+ * @memberof OrderTracking
521
+ */
522
+ 'courier'?: string;
523
+ /**
524
+ *
525
+ * @type {string}
526
+ * @memberof OrderTracking
527
+ */
528
+ 'code'?: string;
529
+ /**
530
+ *
531
+ * @type {string}
532
+ * @memberof OrderTracking
533
+ */
534
+ 'url'?: string;
535
+ }
536
+ /**
537
+ *
538
+ * @export
539
+ * @interface OrdersResponse
540
+ */
541
+ export interface OrdersResponse {
542
+ /**
543
+ *
544
+ * @type {Array<Order>}
545
+ * @memberof OrdersResponse
546
+ */
547
+ 'orders'?: Array<Order>;
548
+ /**
549
+ *
550
+ * @type {number}
551
+ * @memberof OrdersResponse
552
+ */
553
+ 'nextPageToken'?: number;
554
+ }
555
+ /**
556
+ *
557
+ * @export
558
+ * @interface Origin
559
+ */
560
+ export interface Origin {
561
+ /**
562
+ *
563
+ * @type {string}
564
+ * @memberof Origin
565
+ */
566
+ 'code'?: string;
567
+ /**
568
+ *
569
+ * @type {boolean}
570
+ * @memberof Origin
571
+ */
572
+ 'isPaid'?: boolean;
573
+ }
574
+ /**
575
+ * Standard price definition that defines the amount and currency.
576
+ * @export
577
+ * @interface Price
578
+ */
579
+ export interface Price {
580
+ /**
581
+ * Price including tax in the specified currency.
582
+ * @type {string}
583
+ * @memberof Price
584
+ */
585
+ 'amount'?: string;
586
+ /**
587
+ * Currency code for the currency the price is valued in.
588
+ * @type {string}
589
+ * @memberof Price
590
+ */
591
+ 'currencyCode'?: string;
592
+ }
593
+ /**
594
+ *
595
+ * @export
596
+ * @interface ShippingMethod
597
+ */
598
+ export interface ShippingMethod {
599
+ /**
600
+ * Unique object identifier
601
+ * @type {string}
602
+ * @memberof ShippingMethod
603
+ */
604
+ 'id'?: string;
605
+ /**
606
+ *
607
+ * @type {string}
608
+ * @memberof ShippingMethod
609
+ */
610
+ 'name'?: string;
611
+ /**
612
+ *
613
+ * @type {string}
614
+ * @memberof ShippingMethod
615
+ */
616
+ 'description'?: string;
617
+ /**
618
+ *
619
+ * @type {DeliveryEstimates}
620
+ * @memberof ShippingMethod
621
+ */
622
+ 'deliveryEstimates'?: DeliveryEstimates;
623
+ /**
624
+ *
625
+ * @type {Price}
626
+ * @memberof ShippingMethod
627
+ */
628
+ 'totalPrice'?: Price;
629
+ /**
630
+ *
631
+ * @type {Price}
632
+ * @memberof ShippingMethod
633
+ */
634
+ 'taxPrice'?: Price;
635
+ /**
636
+ *
637
+ * @type {Price}
638
+ * @memberof ShippingMethod
639
+ */
640
+ 'subtotalPrice'?: Price;
641
+ /**
642
+ *
643
+ * @type {Price}
644
+ * @memberof ShippingMethod
645
+ */
646
+ 'discountPrice'?: Price;
647
+ }
648
+ /**
649
+ *
650
+ * @export
651
+ * @enum {string}
652
+ */
653
+
654
+ export const Status = {
655
+ New: 'new',
656
+ Paid: 'paid',
657
+ Processing: 'processing',
658
+ Complete: 'complete',
659
+ Refunded: 'refunded'
660
+ } as const;
661
+
662
+ export type Status = typeof Status[keyof typeof Status];
663
+
664
+
665
+ /**
666
+ *
667
+ * @export
668
+ * @interface StatusHistoryItem
669
+ */
670
+ export interface StatusHistoryItem {
671
+ /**
672
+ *
673
+ * @type {Status}
674
+ * @memberof StatusHistoryItem
675
+ */
676
+ 'status'?: Status;
677
+ /**
678
+ * ISO 8601 Timestamp
679
+ * @type {string}
680
+ * @memberof StatusHistoryItem
681
+ */
682
+ 'createdAt'?: string;
683
+ }
684
+
685
+
686
+
687
+ /**
688
+ * OrdersApi - axios parameter creator
689
+ * @export
690
+ */
691
+ export const OrdersApiAxiosParamCreator = function (configuration?: Configuration) {
692
+ return {
693
+ /**
694
+ * Cancels an order if it has not yet started processing.
695
+ * @summary Cancel order
696
+ * @param {string} project What project it is
697
+ * @param {string} orderId Unique identifier of an order
698
+ * @param {string} [fields] Specifies which fields to return, separated by commas
699
+ * @param {*} [options] Override http request option.
700
+ * @throws {RequiredError}
701
+ */
702
+ cancelOrder: async (project: string, orderId: string, fields?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
703
+ // verify required parameter 'project' is not null or undefined
704
+ assertParamExists('cancelOrder', 'project', project)
705
+ // verify required parameter 'orderId' is not null or undefined
706
+ assertParamExists('cancelOrder', 'orderId', orderId)
707
+ const localVarPath = `/v1/orders/{orderId}`
708
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
709
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
710
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
711
+ let baseOptions;
712
+ if (configuration) {
713
+ baseOptions = configuration.baseOptions;
714
+ }
715
+
716
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
717
+ const localVarHeaderParameter = {} as any;
718
+ const localVarQueryParameter = {} as any;
719
+
720
+ // authentication session-oauth required
721
+ // oauth required
722
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
723
+
724
+ // authentication api-key required
725
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
726
+
727
+ if (project !== undefined) {
728
+ localVarQueryParameter['project'] = project;
729
+ }
730
+
731
+ if (fields !== undefined) {
732
+ localVarQueryParameter['fields'] = fields;
733
+ }
734
+
735
+
736
+
737
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
738
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
739
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
740
+
741
+ return {
742
+ url: toPathString(localVarUrlObj),
743
+ options: localVarRequestOptions,
744
+ };
745
+ },
746
+ /**
747
+ * Confirms an order, and submits it as ready to take payment and begin processing.
748
+ * @summary Confirm order
749
+ * @param {string} project What project it is
750
+ * @param {string} orderId Unique identifier of an order
751
+ * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
752
+ * @param {string} [fields] Specifies which fields to return, separated by commas
753
+ * @param {*} [options] Override http request option.
754
+ * @throws {RequiredError}
755
+ */
756
+ confirmOrder: async (project: string, orderId: string, confirmOrderRequest: ConfirmOrderRequest, fields?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
757
+ // verify required parameter 'project' is not null or undefined
758
+ assertParamExists('confirmOrder', 'project', project)
759
+ // verify required parameter 'orderId' is not null or undefined
760
+ assertParamExists('confirmOrder', 'orderId', orderId)
761
+ // verify required parameter 'confirmOrderRequest' is not null or undefined
762
+ assertParamExists('confirmOrder', 'confirmOrderRequest', confirmOrderRequest)
763
+ const localVarPath = `/v1/orders/{orderId}/confirm`
764
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
765
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
766
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
767
+ let baseOptions;
768
+ if (configuration) {
769
+ baseOptions = configuration.baseOptions;
770
+ }
771
+
772
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
773
+ const localVarHeaderParameter = {} as any;
774
+ const localVarQueryParameter = {} as any;
775
+
776
+ // authentication session-oauth required
777
+ // oauth required
778
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
779
+
780
+ // authentication api-key required
781
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
782
+
783
+ if (project !== undefined) {
784
+ localVarQueryParameter['project'] = project;
785
+ }
786
+
787
+ if (fields !== undefined) {
788
+ localVarQueryParameter['fields'] = fields;
789
+ }
790
+
791
+
792
+
793
+ localVarHeaderParameter['Content-Type'] = 'application/json';
794
+
795
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
796
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
797
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
798
+ localVarRequestOptions.data = serializeDataIfNeeded(confirmOrderRequest, localVarRequestOptions, configuration)
799
+
800
+ return {
801
+ url: toPathString(localVarUrlObj),
802
+ options: localVarRequestOptions,
803
+ };
804
+ },
805
+ /**
806
+ * Creates a new order for the provided variants. You can fetch details and references to the given project\'s variants from the Product Catalog API.
807
+ * @summary Create order
808
+ * @param {string} project What project it is
809
+ * @param {Order} order Order schema
810
+ * @param {string} [fields] Specifies which fields to return, separated by commas
811
+ * @param {*} [options] Override http request option.
812
+ * @throws {RequiredError}
813
+ */
814
+ createOrder: async (project: string, order: Order, fields?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
815
+ // verify required parameter 'project' is not null or undefined
816
+ assertParamExists('createOrder', 'project', project)
817
+ // verify required parameter 'order' is not null or undefined
818
+ assertParamExists('createOrder', 'order', order)
819
+ const localVarPath = `/v1/orders`;
820
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
821
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
822
+ let baseOptions;
823
+ if (configuration) {
824
+ baseOptions = configuration.baseOptions;
825
+ }
826
+
827
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
828
+ const localVarHeaderParameter = {} as any;
829
+ const localVarQueryParameter = {} as any;
830
+
831
+ // authentication session-oauth required
832
+ // oauth required
833
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
834
+
835
+ // authentication api-key required
836
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
837
+
838
+ if (project !== undefined) {
839
+ localVarQueryParameter['project'] = project;
840
+ }
841
+
842
+ if (fields !== undefined) {
843
+ localVarQueryParameter['fields'] = fields;
844
+ }
845
+
846
+
847
+
848
+ localVarHeaderParameter['Content-Type'] = 'application/json';
849
+
850
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
851
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
852
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
853
+ localVarRequestOptions.data = serializeDataIfNeeded(order, localVarRequestOptions, configuration)
854
+
855
+ return {
856
+ url: toPathString(localVarUrlObj),
857
+ options: localVarRequestOptions,
858
+ };
859
+ },
860
+ /**
861
+ * Export orders as a CSV file
862
+ * @summary Export orders
863
+ * @param {string} project What project it is
864
+ * @param {string} start Start of date range to filter by when orders were placed
865
+ * @param {string} [end] End of date range to filter by when orders were placed
866
+ * @param {*} [options] Override http request option.
867
+ * @throws {RequiredError}
868
+ */
869
+ exportOrders: async (project: string, start: string, end?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
870
+ // verify required parameter 'project' is not null or undefined
871
+ assertParamExists('exportOrders', 'project', project)
872
+ // verify required parameter 'start' is not null or undefined
873
+ assertParamExists('exportOrders', 'start', start)
874
+ const localVarPath = `/v1/orders/export`;
875
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
876
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
877
+ let baseOptions;
878
+ if (configuration) {
879
+ baseOptions = configuration.baseOptions;
880
+ }
881
+
882
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
883
+ const localVarHeaderParameter = {} as any;
884
+ const localVarQueryParameter = {} as any;
885
+
886
+ // authentication session-oauth required
887
+ // oauth required
888
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
889
+
890
+ // authentication api-key required
891
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
892
+
893
+ if (project !== undefined) {
894
+ localVarQueryParameter['project'] = project;
895
+ }
896
+
897
+ if (start !== undefined) {
898
+ localVarQueryParameter['start'] = (start as any instanceof Date) ?
899
+ (start as any).toISOString() :
900
+ start;
901
+ }
902
+
903
+ if (end !== undefined) {
904
+ localVarQueryParameter['end'] = (end as any instanceof Date) ?
905
+ (end as any).toISOString() :
906
+ end;
907
+ }
908
+
909
+
910
+
911
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
912
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
913
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
914
+
915
+ return {
916
+ url: toPathString(localVarUrlObj),
917
+ options: localVarRequestOptions,
918
+ };
919
+ },
920
+ /**
921
+ * Get an order by a given ID.
922
+ * @summary Get order
923
+ * @param {string} project What project it is
924
+ * @param {string} orderId Unique identifier of an order
925
+ * @param {string} [fields] Specifies which fields to return, separated by commas
926
+ * @param {*} [options] Override http request option.
927
+ * @throws {RequiredError}
928
+ */
929
+ getOrder: async (project: string, orderId: string, fields?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
930
+ // verify required parameter 'project' is not null or undefined
931
+ assertParamExists('getOrder', 'project', project)
932
+ // verify required parameter 'orderId' is not null or undefined
933
+ assertParamExists('getOrder', 'orderId', orderId)
934
+ const localVarPath = `/v1/orders/{orderId}`
935
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
936
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
937
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
938
+ let baseOptions;
939
+ if (configuration) {
940
+ baseOptions = configuration.baseOptions;
941
+ }
942
+
943
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
944
+ const localVarHeaderParameter = {} as any;
945
+ const localVarQueryParameter = {} as any;
946
+
947
+ // authentication session-oauth required
948
+ // oauth required
949
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
950
+
951
+ // authentication api-key required
952
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
953
+
954
+ if (project !== undefined) {
955
+ localVarQueryParameter['project'] = project;
956
+ }
957
+
958
+ if (fields !== undefined) {
959
+ localVarQueryParameter['fields'] = fields;
960
+ }
961
+
962
+
963
+
964
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
965
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
966
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
967
+
968
+ return {
969
+ url: toPathString(localVarUrlObj),
970
+ options: localVarRequestOptions,
971
+ };
972
+ },
973
+ /**
974
+ * Lists all orders placed on this project, paginated into configurable chunks.
975
+ * @summary List orders
976
+ * @param {string} project What project it is
977
+ * @param {string} [fields] Specifies which fields to return, separated by commas
978
+ * @param {number} [pageToken] Page reference token
979
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
980
+ * @param {string} [search] Search term to filter based on order reference, customer name and email
981
+ * @param {Array<string>} [ids] Specify fulfillment IDs to list
982
+ * @param {Array<Status>} [statuses] Filter by fulfillment status
983
+ * @param {string} [start] Start of date range to filter by when orders were placed
984
+ * @param {string} [end] End of date range to filter by when orders were placed
985
+ * @param {*} [options] Override http request option.
986
+ * @throws {RequiredError}
987
+ */
988
+ getOrders: async (project: string, fields?: string, pageToken?: number, pageSize?: number, search?: string, ids?: Array<string>, statuses?: Array<Status>, start?: string, end?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
989
+ // verify required parameter 'project' is not null or undefined
990
+ assertParamExists('getOrders', 'project', project)
991
+ const localVarPath = `/v1/orders`;
992
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
993
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
994
+ let baseOptions;
995
+ if (configuration) {
996
+ baseOptions = configuration.baseOptions;
997
+ }
998
+
999
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
1000
+ const localVarHeaderParameter = {} as any;
1001
+ const localVarQueryParameter = {} as any;
1002
+
1003
+ // authentication session-oauth required
1004
+ // oauth required
1005
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
1006
+
1007
+ // authentication api-key required
1008
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
1009
+
1010
+ if (project !== undefined) {
1011
+ localVarQueryParameter['project'] = project;
1012
+ }
1013
+
1014
+ if (fields !== undefined) {
1015
+ localVarQueryParameter['fields'] = fields;
1016
+ }
1017
+
1018
+ if (pageToken !== undefined) {
1019
+ localVarQueryParameter['pageToken'] = pageToken;
1020
+ }
1021
+
1022
+ if (pageSize !== undefined) {
1023
+ localVarQueryParameter['pageSize'] = pageSize;
1024
+ }
1025
+
1026
+ if (search !== undefined) {
1027
+ localVarQueryParameter['search'] = search;
1028
+ }
1029
+
1030
+ if (ids) {
1031
+ localVarQueryParameter['ids'] = ids;
1032
+ }
1033
+
1034
+ if (statuses) {
1035
+ localVarQueryParameter['statuses'] = statuses;
1036
+ }
1037
+
1038
+ if (start !== undefined) {
1039
+ localVarQueryParameter['start'] = (start as any instanceof Date) ?
1040
+ (start as any).toISOString() :
1041
+ start;
1042
+ }
1043
+
1044
+ if (end !== undefined) {
1045
+ localVarQueryParameter['end'] = (end as any instanceof Date) ?
1046
+ (end as any).toISOString() :
1047
+ end;
1048
+ }
1049
+
1050
+
1051
+
1052
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1053
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1054
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1055
+
1056
+ return {
1057
+ url: toPathString(localVarUrlObj),
1058
+ options: localVarRequestOptions,
1059
+ };
1060
+ },
1061
+ }
1062
+ };
1063
+
1064
+ /**
1065
+ * OrdersApi - functional programming interface
1066
+ * @export
1067
+ */
1068
+ export const OrdersApiFp = function(configuration?: Configuration) {
1069
+ const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration)
1070
+ return {
1071
+ /**
1072
+ * Cancels an order if it has not yet started processing.
1073
+ * @summary Cancel order
1074
+ * @param {string} project What project it is
1075
+ * @param {string} orderId Unique identifier of an order
1076
+ * @param {string} [fields] Specifies which fields to return, separated by commas
1077
+ * @param {*} [options] Override http request option.
1078
+ * @throws {RequiredError}
1079
+ */
1080
+ async cancelOrder(project: string, orderId: string, fields?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
1081
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelOrder(project, orderId, fields, options);
1082
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1083
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.cancelOrder']?.[localVarOperationServerIndex]?.url;
1084
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1085
+ },
1086
+ /**
1087
+ * Confirms an order, and submits it as ready to take payment and begin processing.
1088
+ * @summary Confirm order
1089
+ * @param {string} project What project it is
1090
+ * @param {string} orderId Unique identifier of an order
1091
+ * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
1092
+ * @param {string} [fields] Specifies which fields to return, separated by commas
1093
+ * @param {*} [options] Override http request option.
1094
+ * @throws {RequiredError}
1095
+ */
1096
+ async confirmOrder(project: string, orderId: string, confirmOrderRequest: ConfirmOrderRequest, fields?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Order>> {
1097
+ const localVarAxiosArgs = await localVarAxiosParamCreator.confirmOrder(project, orderId, confirmOrderRequest, fields, options);
1098
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1099
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.confirmOrder']?.[localVarOperationServerIndex]?.url;
1100
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1101
+ },
1102
+ /**
1103
+ * Creates a new order for the provided variants. You can fetch details and references to the given project\'s variants from the Product Catalog API.
1104
+ * @summary Create order
1105
+ * @param {string} project What project it is
1106
+ * @param {Order} order Order schema
1107
+ * @param {string} [fields] Specifies which fields to return, separated by commas
1108
+ * @param {*} [options] Override http request option.
1109
+ * @throws {RequiredError}
1110
+ */
1111
+ async createOrder(project: string, order: Order, fields?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Order>> {
1112
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createOrder(project, order, fields, options);
1113
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1114
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.createOrder']?.[localVarOperationServerIndex]?.url;
1115
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1116
+ },
1117
+ /**
1118
+ * Export orders as a CSV file
1119
+ * @summary Export orders
1120
+ * @param {string} project What project it is
1121
+ * @param {string} start Start of date range to filter by when orders were placed
1122
+ * @param {string} [end] End of date range to filter by when orders were placed
1123
+ * @param {*} [options] Override http request option.
1124
+ * @throws {RequiredError}
1125
+ */
1126
+ async exportOrders(project: string, start: string, end?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
1127
+ const localVarAxiosArgs = await localVarAxiosParamCreator.exportOrders(project, start, end, options);
1128
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1129
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.exportOrders']?.[localVarOperationServerIndex]?.url;
1130
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1131
+ },
1132
+ /**
1133
+ * Get an order by a given ID.
1134
+ * @summary Get order
1135
+ * @param {string} project What project it is
1136
+ * @param {string} orderId Unique identifier of an order
1137
+ * @param {string} [fields] Specifies which fields to return, separated by commas
1138
+ * @param {*} [options] Override http request option.
1139
+ * @throws {RequiredError}
1140
+ */
1141
+ async getOrder(project: string, orderId: string, fields?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Order>> {
1142
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getOrder(project, orderId, fields, options);
1143
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1144
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.getOrder']?.[localVarOperationServerIndex]?.url;
1145
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1146
+ },
1147
+ /**
1148
+ * Lists all orders placed on this project, paginated into configurable chunks.
1149
+ * @summary List orders
1150
+ * @param {string} project What project it is
1151
+ * @param {string} [fields] Specifies which fields to return, separated by commas
1152
+ * @param {number} [pageToken] Page reference token
1153
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
1154
+ * @param {string} [search] Search term to filter based on order reference, customer name and email
1155
+ * @param {Array<string>} [ids] Specify fulfillment IDs to list
1156
+ * @param {Array<Status>} [statuses] Filter by fulfillment status
1157
+ * @param {string} [start] Start of date range to filter by when orders were placed
1158
+ * @param {string} [end] End of date range to filter by when orders were placed
1159
+ * @param {*} [options] Override http request option.
1160
+ * @throws {RequiredError}
1161
+ */
1162
+ async getOrders(project: string, fields?: string, pageToken?: number, pageSize?: number, search?: string, ids?: Array<string>, statuses?: Array<Status>, start?: string, end?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OrdersResponse>> {
1163
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getOrders(project, fields, pageToken, pageSize, search, ids, statuses, start, end, options);
1164
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1165
+ const localVarOperationServerBasePath = operationServerMap['OrdersApi.getOrders']?.[localVarOperationServerIndex]?.url;
1166
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1167
+ },
1168
+ }
1169
+ };
1170
+
1171
+ /**
1172
+ * OrdersApi - factory interface
1173
+ * @export
1174
+ */
1175
+ export const OrdersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1176
+ const localVarFp = OrdersApiFp(configuration)
1177
+ return {
1178
+ /**
1179
+ * Cancels an order if it has not yet started processing.
1180
+ * @summary Cancel order
1181
+ * @param {OrdersApiCancelOrderRequest} requestParameters Request parameters.
1182
+ * @param {*} [options] Override http request option.
1183
+ * @throws {RequiredError}
1184
+ */
1185
+ cancelOrder(requestParameters: OrdersApiCancelOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
1186
+ return localVarFp.cancelOrder(requestParameters.project, requestParameters.orderId, requestParameters.fields, options).then((request) => request(axios, basePath));
1187
+ },
1188
+ /**
1189
+ * Confirms an order, and submits it as ready to take payment and begin processing.
1190
+ * @summary Confirm order
1191
+ * @param {OrdersApiConfirmOrderRequest} requestParameters Request parameters.
1192
+ * @param {*} [options] Override http request option.
1193
+ * @throws {RequiredError}
1194
+ */
1195
+ confirmOrder(requestParameters: OrdersApiConfirmOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise<Order> {
1196
+ return localVarFp.confirmOrder(requestParameters.project, requestParameters.orderId, requestParameters.confirmOrderRequest, requestParameters.fields, options).then((request) => request(axios, basePath));
1197
+ },
1198
+ /**
1199
+ * Creates a new order for the provided variants. You can fetch details and references to the given project\'s variants from the Product Catalog API.
1200
+ * @summary Create order
1201
+ * @param {OrdersApiCreateOrderRequest} requestParameters Request parameters.
1202
+ * @param {*} [options] Override http request option.
1203
+ * @throws {RequiredError}
1204
+ */
1205
+ createOrder(requestParameters: OrdersApiCreateOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise<Order> {
1206
+ return localVarFp.createOrder(requestParameters.project, requestParameters.order, requestParameters.fields, options).then((request) => request(axios, basePath));
1207
+ },
1208
+ /**
1209
+ * Export orders as a CSV file
1210
+ * @summary Export orders
1211
+ * @param {OrdersApiExportOrdersRequest} requestParameters Request parameters.
1212
+ * @param {*} [options] Override http request option.
1213
+ * @throws {RequiredError}
1214
+ */
1215
+ exportOrders(requestParameters: OrdersApiExportOrdersRequest, options?: RawAxiosRequestConfig): AxiosPromise<File> {
1216
+ return localVarFp.exportOrders(requestParameters.project, requestParameters.start, requestParameters.end, options).then((request) => request(axios, basePath));
1217
+ },
1218
+ /**
1219
+ * Get an order by a given ID.
1220
+ * @summary Get order
1221
+ * @param {OrdersApiGetOrderRequest} requestParameters Request parameters.
1222
+ * @param {*} [options] Override http request option.
1223
+ * @throws {RequiredError}
1224
+ */
1225
+ getOrder(requestParameters: OrdersApiGetOrderRequest, options?: RawAxiosRequestConfig): AxiosPromise<Order> {
1226
+ return localVarFp.getOrder(requestParameters.project, requestParameters.orderId, requestParameters.fields, options).then((request) => request(axios, basePath));
1227
+ },
1228
+ /**
1229
+ * Lists all orders placed on this project, paginated into configurable chunks.
1230
+ * @summary List orders
1231
+ * @param {OrdersApiGetOrdersRequest} requestParameters Request parameters.
1232
+ * @param {*} [options] Override http request option.
1233
+ * @throws {RequiredError}
1234
+ */
1235
+ getOrders(requestParameters: OrdersApiGetOrdersRequest, options?: RawAxiosRequestConfig): AxiosPromise<OrdersResponse> {
1236
+ return localVarFp.getOrders(requestParameters.project, requestParameters.fields, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, requestParameters.ids, requestParameters.statuses, requestParameters.start, requestParameters.end, options).then((request) => request(axios, basePath));
1237
+ },
1238
+ };
1239
+ };
1240
+
1241
+ /**
1242
+ * Request parameters for cancelOrder operation in OrdersApi.
1243
+ * @export
1244
+ * @interface OrdersApiCancelOrderRequest
1245
+ */
1246
+ export interface OrdersApiCancelOrderRequest {
1247
+ /**
1248
+ * What project it is
1249
+ * @type {string}
1250
+ * @memberof OrdersApiCancelOrder
1251
+ */
1252
+ readonly project: string
1253
+
1254
+ /**
1255
+ * Unique identifier of an order
1256
+ * @type {string}
1257
+ * @memberof OrdersApiCancelOrder
1258
+ */
1259
+ readonly orderId: string
1260
+
1261
+ /**
1262
+ * Specifies which fields to return, separated by commas
1263
+ * @type {string}
1264
+ * @memberof OrdersApiCancelOrder
1265
+ */
1266
+ readonly fields?: string
1267
+ }
1268
+
1269
+ /**
1270
+ * Request parameters for confirmOrder operation in OrdersApi.
1271
+ * @export
1272
+ * @interface OrdersApiConfirmOrderRequest
1273
+ */
1274
+ export interface OrdersApiConfirmOrderRequest {
1275
+ /**
1276
+ * What project it is
1277
+ * @type {string}
1278
+ * @memberof OrdersApiConfirmOrder
1279
+ */
1280
+ readonly project: string
1281
+
1282
+ /**
1283
+ * Unique identifier of an order
1284
+ * @type {string}
1285
+ * @memberof OrdersApiConfirmOrder
1286
+ */
1287
+ readonly orderId: string
1288
+
1289
+ /**
1290
+ * ConfirmFulfillment schema
1291
+ * @type {ConfirmOrderRequest}
1292
+ * @memberof OrdersApiConfirmOrder
1293
+ */
1294
+ readonly confirmOrderRequest: ConfirmOrderRequest
1295
+
1296
+ /**
1297
+ * Specifies which fields to return, separated by commas
1298
+ * @type {string}
1299
+ * @memberof OrdersApiConfirmOrder
1300
+ */
1301
+ readonly fields?: string
1302
+ }
1303
+
1304
+ /**
1305
+ * Request parameters for createOrder operation in OrdersApi.
1306
+ * @export
1307
+ * @interface OrdersApiCreateOrderRequest
1308
+ */
1309
+ export interface OrdersApiCreateOrderRequest {
1310
+ /**
1311
+ * What project it is
1312
+ * @type {string}
1313
+ * @memberof OrdersApiCreateOrder
1314
+ */
1315
+ readonly project: string
1316
+
1317
+ /**
1318
+ * Order schema
1319
+ * @type {Order}
1320
+ * @memberof OrdersApiCreateOrder
1321
+ */
1322
+ readonly order: Order
1323
+
1324
+ /**
1325
+ * Specifies which fields to return, separated by commas
1326
+ * @type {string}
1327
+ * @memberof OrdersApiCreateOrder
1328
+ */
1329
+ readonly fields?: string
1330
+ }
1331
+
1332
+ /**
1333
+ * Request parameters for exportOrders operation in OrdersApi.
1334
+ * @export
1335
+ * @interface OrdersApiExportOrdersRequest
1336
+ */
1337
+ export interface OrdersApiExportOrdersRequest {
1338
+ /**
1339
+ * What project it is
1340
+ * @type {string}
1341
+ * @memberof OrdersApiExportOrders
1342
+ */
1343
+ readonly project: string
1344
+
1345
+ /**
1346
+ * Start of date range to filter by when orders were placed
1347
+ * @type {string}
1348
+ * @memberof OrdersApiExportOrders
1349
+ */
1350
+ readonly start: string
1351
+
1352
+ /**
1353
+ * End of date range to filter by when orders were placed
1354
+ * @type {string}
1355
+ * @memberof OrdersApiExportOrders
1356
+ */
1357
+ readonly end?: string
1358
+ }
1359
+
1360
+ /**
1361
+ * Request parameters for getOrder operation in OrdersApi.
1362
+ * @export
1363
+ * @interface OrdersApiGetOrderRequest
1364
+ */
1365
+ export interface OrdersApiGetOrderRequest {
1366
+ /**
1367
+ * What project it is
1368
+ * @type {string}
1369
+ * @memberof OrdersApiGetOrder
1370
+ */
1371
+ readonly project: string
1372
+
1373
+ /**
1374
+ * Unique identifier of an order
1375
+ * @type {string}
1376
+ * @memberof OrdersApiGetOrder
1377
+ */
1378
+ readonly orderId: string
1379
+
1380
+ /**
1381
+ * Specifies which fields to return, separated by commas
1382
+ * @type {string}
1383
+ * @memberof OrdersApiGetOrder
1384
+ */
1385
+ readonly fields?: string
1386
+ }
1387
+
1388
+ /**
1389
+ * Request parameters for getOrders operation in OrdersApi.
1390
+ * @export
1391
+ * @interface OrdersApiGetOrdersRequest
1392
+ */
1393
+ export interface OrdersApiGetOrdersRequest {
1394
+ /**
1395
+ * What project it is
1396
+ * @type {string}
1397
+ * @memberof OrdersApiGetOrders
1398
+ */
1399
+ readonly project: string
1400
+
1401
+ /**
1402
+ * Specifies which fields to return, separated by commas
1403
+ * @type {string}
1404
+ * @memberof OrdersApiGetOrders
1405
+ */
1406
+ readonly fields?: string
1407
+
1408
+ /**
1409
+ * Page reference token
1410
+ * @type {number}
1411
+ * @memberof OrdersApiGetOrders
1412
+ */
1413
+ readonly pageToken?: number
1414
+
1415
+ /**
1416
+ * Max page size. This is the maximum page size that will be returned, but it might be smaller.
1417
+ * @type {number}
1418
+ * @memberof OrdersApiGetOrders
1419
+ */
1420
+ readonly pageSize?: number
1421
+
1422
+ /**
1423
+ * Search term to filter based on order reference, customer name and email
1424
+ * @type {string}
1425
+ * @memberof OrdersApiGetOrders
1426
+ */
1427
+ readonly search?: string
1428
+
1429
+ /**
1430
+ * Specify fulfillment IDs to list
1431
+ * @type {Array<string>}
1432
+ * @memberof OrdersApiGetOrders
1433
+ */
1434
+ readonly ids?: Array<string>
1435
+
1436
+ /**
1437
+ * Filter by fulfillment status
1438
+ * @type {Array<Status>}
1439
+ * @memberof OrdersApiGetOrders
1440
+ */
1441
+ readonly statuses?: Array<Status>
1442
+
1443
+ /**
1444
+ * Start of date range to filter by when orders were placed
1445
+ * @type {string}
1446
+ * @memberof OrdersApiGetOrders
1447
+ */
1448
+ readonly start?: string
1449
+
1450
+ /**
1451
+ * End of date range to filter by when orders were placed
1452
+ * @type {string}
1453
+ * @memberof OrdersApiGetOrders
1454
+ */
1455
+ readonly end?: string
1456
+ }
1457
+
1458
+ /**
1459
+ * OrdersApi - object-oriented interface
1460
+ * @export
1461
+ * @class OrdersApi
1462
+ * @extends {BaseAPI}
1463
+ */
1464
+ export class OrdersApi extends BaseAPI {
1465
+ /**
1466
+ * Cancels an order if it has not yet started processing.
1467
+ * @summary Cancel order
1468
+ * @param {OrdersApiCancelOrderRequest} requestParameters Request parameters.
1469
+ * @param {*} [options] Override http request option.
1470
+ * @throws {RequiredError}
1471
+ * @memberof OrdersApi
1472
+ */
1473
+ public cancelOrder(requestParameters: OrdersApiCancelOrderRequest, options?: RawAxiosRequestConfig) {
1474
+ return OrdersApiFp(this.configuration).cancelOrder(requestParameters.project, requestParameters.orderId, requestParameters.fields, options).then((request) => request(this.axios, this.basePath));
1475
+ }
1476
+
1477
+ /**
1478
+ * Confirms an order, and submits it as ready to take payment and begin processing.
1479
+ * @summary Confirm order
1480
+ * @param {OrdersApiConfirmOrderRequest} requestParameters Request parameters.
1481
+ * @param {*} [options] Override http request option.
1482
+ * @throws {RequiredError}
1483
+ * @memberof OrdersApi
1484
+ */
1485
+ public confirmOrder(requestParameters: OrdersApiConfirmOrderRequest, options?: RawAxiosRequestConfig) {
1486
+ return OrdersApiFp(this.configuration).confirmOrder(requestParameters.project, requestParameters.orderId, requestParameters.confirmOrderRequest, requestParameters.fields, options).then((request) => request(this.axios, this.basePath));
1487
+ }
1488
+
1489
+ /**
1490
+ * Creates a new order for the provided variants. You can fetch details and references to the given project\'s variants from the Product Catalog API.
1491
+ * @summary Create order
1492
+ * @param {OrdersApiCreateOrderRequest} requestParameters Request parameters.
1493
+ * @param {*} [options] Override http request option.
1494
+ * @throws {RequiredError}
1495
+ * @memberof OrdersApi
1496
+ */
1497
+ public createOrder(requestParameters: OrdersApiCreateOrderRequest, options?: RawAxiosRequestConfig) {
1498
+ return OrdersApiFp(this.configuration).createOrder(requestParameters.project, requestParameters.order, requestParameters.fields, options).then((request) => request(this.axios, this.basePath));
1499
+ }
1500
+
1501
+ /**
1502
+ * Export orders as a CSV file
1503
+ * @summary Export orders
1504
+ * @param {OrdersApiExportOrdersRequest} requestParameters Request parameters.
1505
+ * @param {*} [options] Override http request option.
1506
+ * @throws {RequiredError}
1507
+ * @memberof OrdersApi
1508
+ */
1509
+ public exportOrders(requestParameters: OrdersApiExportOrdersRequest, options?: RawAxiosRequestConfig) {
1510
+ return OrdersApiFp(this.configuration).exportOrders(requestParameters.project, requestParameters.start, requestParameters.end, options).then((request) => request(this.axios, this.basePath));
1511
+ }
1512
+
1513
+ /**
1514
+ * Get an order by a given ID.
1515
+ * @summary Get order
1516
+ * @param {OrdersApiGetOrderRequest} requestParameters Request parameters.
1517
+ * @param {*} [options] Override http request option.
1518
+ * @throws {RequiredError}
1519
+ * @memberof OrdersApi
1520
+ */
1521
+ public getOrder(requestParameters: OrdersApiGetOrderRequest, options?: RawAxiosRequestConfig) {
1522
+ return OrdersApiFp(this.configuration).getOrder(requestParameters.project, requestParameters.orderId, requestParameters.fields, options).then((request) => request(this.axios, this.basePath));
1523
+ }
1524
+
1525
+ /**
1526
+ * Lists all orders placed on this project, paginated into configurable chunks.
1527
+ * @summary List orders
1528
+ * @param {OrdersApiGetOrdersRequest} requestParameters Request parameters.
1529
+ * @param {*} [options] Override http request option.
1530
+ * @throws {RequiredError}
1531
+ * @memberof OrdersApi
1532
+ */
1533
+ public getOrders(requestParameters: OrdersApiGetOrdersRequest, options?: RawAxiosRequestConfig) {
1534
+ return OrdersApiFp(this.configuration).getOrders(requestParameters.project, requestParameters.fields, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, requestParameters.ids, requestParameters.statuses, requestParameters.start, requestParameters.end, options).then((request) => request(this.axios, this.basePath));
1535
+ }
1536
+ }
1537
+
1538
+
1539
+