@wix/auto_sdk_pricing-plans_orders 1.0.2 → 1.0.4

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 (73) hide show
  1. package/build/cjs/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  2. package/build/cjs/src/pricing-plans-v2-order-orders.context.js +46 -46
  3. package/build/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  4. package/build/cjs/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  5. package/build/cjs/src/pricing-plans-v2-order-orders.http.js +343 -343
  6. package/build/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  7. package/build/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  8. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js +89 -89
  9. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  10. package/build/cjs/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  11. package/build/cjs/src/pricing-plans-v2-order-orders.public.js +94 -94
  12. package/build/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  13. package/build/cjs/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  14. package/build/cjs/src/pricing-plans-v2-order-orders.types.js +9 -9
  15. package/build/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  16. package/build/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +1042 -729
  17. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js +387 -379
  18. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  19. package/build/es/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  20. package/build/es/src/pricing-plans-v2-order-orders.context.js +41 -41
  21. package/build/es/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  22. package/build/es/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  23. package/build/es/src/pricing-plans-v2-order-orders.http.js +335 -335
  24. package/build/es/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  25. package/build/es/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  26. package/build/es/src/pricing-plans-v2-order-orders.meta.js +73 -73
  27. package/build/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  28. package/build/es/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  29. package/build/es/src/pricing-plans-v2-order-orders.public.js +81 -81
  30. package/build/es/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  31. package/build/es/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  32. package/build/es/src/pricing-plans-v2-order-orders.types.js +8 -8
  33. package/build/es/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  34. package/build/es/src/pricing-plans-v2-order-orders.universal.d.ts +1042 -729
  35. package/build/es/src/pricing-plans-v2-order-orders.universal.js +371 -363
  36. package/build/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  37. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  38. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js +46 -46
  39. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  40. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  41. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js +343 -343
  42. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  43. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  44. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js +89 -89
  45. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  46. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  47. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js +94 -94
  48. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  49. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  50. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js +9 -9
  51. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  52. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +1044 -731
  53. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js +387 -379
  54. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  55. package/build/internal/es/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  56. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js +41 -41
  57. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  58. package/build/internal/es/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  59. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js +335 -335
  60. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  61. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  62. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js +73 -73
  63. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  64. package/build/internal/es/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  65. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js +81 -81
  66. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  67. package/build/internal/es/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  68. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js +8 -8
  69. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  70. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.d.ts +1044 -731
  71. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js +371 -363
  72. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  73. package/package.json +4 -4
@@ -8,11 +8,13 @@
8
8
  export interface Order {
9
9
  /**
10
10
  * Order ID.
11
+ * @format GUID
11
12
  * @readonly
12
13
  */
13
14
  _id?: string;
14
15
  /**
15
16
  * ID of the plan purchased with the order, from the Plans API.
17
+ * @format GUID
16
18
  * @readonly
17
19
  */
18
20
  planId?: string;
@@ -21,6 +23,7 @@ export interface Order {
21
23
  *
22
24
  * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in
23
25
  * a [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business).
26
+ * @format GUID
24
27
  * @readonly
25
28
  */
26
29
  subscriptionId?: string;
@@ -28,6 +31,7 @@ export interface Order {
28
31
  * Wix Pay order ID.
29
32
  *
30
33
  * Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
34
+ * @format GUID
31
35
  * @readonly
32
36
  */
33
37
  wixPayOrderId?: string | null;
@@ -111,6 +115,8 @@ export interface Order {
111
115
  *
112
116
  * Only available for recurring plans.
113
117
  * @readonly
118
+ * @min 1
119
+ * @max 999
114
120
  */
115
121
  freeTrialDays?: number | null;
116
122
  /**
@@ -139,6 +145,7 @@ export interface Order {
139
145
  planDescription?: string;
140
146
  /**
141
147
  * Plan price as it was at the moment of order creation.
148
+ * @format DECIMAL_VALUE
142
149
  * @readonly
143
150
  */
144
151
  planPrice?: string;
@@ -161,11 +168,13 @@ export interface Order {
161
168
  export interface Buyer {
162
169
  /**
163
170
  * Member ID for a Wix site member, from the Members API.
171
+ * @format GUID
164
172
  * @readonly
165
173
  */
166
174
  memberId?: string;
167
175
  /**
168
176
  * Contact ID for a Wix site contact, from the Contacts API.
177
+ * @format GUID
169
178
  * @readonly
170
179
  */
171
180
  contactId?: string;
@@ -177,9 +186,15 @@ export interface PriceDetails extends PriceDetailsPricingModelOneOf {
177
186
  singlePaymentForDuration?: Duration;
178
187
  /** One-time payment. Order is valid until it is canceled. */
179
188
  singlePaymentUnlimited?: boolean | null;
180
- /** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
189
+ /**
190
+ * Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`.
191
+ * @format DECIMAL_VALUE
192
+ */
181
193
  subtotal?: string;
182
- /** Total discount applied. */
194
+ /**
195
+ * Total discount applied.
196
+ * @format DECIMAL_VALUE
197
+ */
183
198
  discount?: string;
184
199
  /** Tax applied. */
185
200
  tax?: Tax;
@@ -187,13 +202,24 @@ export interface PriceDetails extends PriceDetailsPricingModelOneOf {
187
202
  * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
188
203
  *
189
204
  * If no tax is applied, the amount is the same as `subtotal`.
205
+ * @format DECIMAL_VALUE
190
206
  */
191
207
  total?: string;
192
- /** Plan price as it was at the moment of order creation. */
208
+ /**
209
+ * Plan price as it was at the moment of order creation.
210
+ * @format DECIMAL_VALUE
211
+ */
193
212
  planPrice?: string;
194
- /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
213
+ /**
214
+ * Currency code. Must be valid ISO 4217 currency code (e.g., USD).
215
+ * @format CURRENCY
216
+ */
195
217
  currency?: string;
196
- /** Free trial period for the order in days. Only available for recurring plans. */
218
+ /**
219
+ * Free trial period for the order in days. Only available for recurring plans.
220
+ * @min 1
221
+ * @max 999
222
+ */
197
223
  freeTrialDays?: number | null;
198
224
  /** Coupon applied to the order. Empty means no coupon was applied. */
199
225
  coupon?: Coupon;
@@ -212,9 +238,15 @@ export interface Tax {
212
238
  name?: string;
213
239
  /** Whether tax is included in the original price. When `false`, tax is added at checkout. */
214
240
  includedInPrice?: boolean;
215
- /** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
241
+ /**
242
+ * Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`.
243
+ * @format DECIMAL_VALUE
244
+ */
216
245
  rate?: string;
217
- /** Total tax, specified as a monetary amount. For example, `"3.99"`. */
246
+ /**
247
+ * Total tax, specified as a monetary amount. For example, `"3.99"`.
248
+ * @format DECIMAL_VALUE
249
+ */
218
250
  amount?: string;
219
251
  }
220
252
  /** An object specifying how often and for how long payments recur (may be forever). */
@@ -228,12 +260,16 @@ export interface Recurrence {
228
260
  * Length of a payment cycle. For example, 1 month to have monthly payments.
229
261
  * Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.
230
262
  * Currently, only a value of `1` is supported.
263
+ * @max 2000
231
264
  */
232
265
  cycleCount?: number | null;
233
266
  }
234
267
  /** A duration expressed in number of time units. */
235
268
  export interface Duration {
236
- /** Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
269
+ /**
270
+ * Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`.
271
+ * @min 1
272
+ */
237
273
  count?: number | null;
238
274
  /** Unit of time for the cycle duration. */
239
275
  unit?: PeriodUnit;
@@ -251,12 +287,20 @@ export declare enum PeriodUnit {
251
287
  YEAR = "YEAR"
252
288
  }
253
289
  export interface Coupon {
254
- /** Code of the applied coupon. */
290
+ /**
291
+ * Code of the applied coupon.
292
+ * @minLength 1
293
+ * @maxLength 20
294
+ */
255
295
  code?: string;
256
- /** Total discount of the coupon, as a monetary amount. */
296
+ /**
297
+ * Total discount of the coupon, as a monetary amount.
298
+ * @format DECIMAL_VALUE
299
+ */
257
300
  amount?: string;
258
301
  /**
259
302
  * Coupon ID.
303
+ * @format GUID
260
304
  * @readonly
261
305
  */
262
306
  _id?: string;
@@ -313,11 +357,17 @@ export interface PriceDuration {
313
357
  numberOfCycles?: number | null;
314
358
  }
315
359
  export interface Price {
316
- /** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
360
+ /**
361
+ * Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`.
362
+ * @format DECIMAL_VALUE
363
+ */
317
364
  subtotal?: string;
318
365
  /** Coupon applied to the order, from the Coupons API. */
319
366
  coupon?: Coupon;
320
- /** Total discount applied to the order. */
367
+ /**
368
+ * Total discount applied to the order.
369
+ * @format DECIMAL_VALUE
370
+ */
321
371
  discount?: string;
322
372
  /**
323
373
  * Tax applied to the order.
@@ -329,20 +379,32 @@ export interface Price {
329
379
  * Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
330
380
  *
331
381
  * If no tax is applied, the amount is the same as `subtotal`.
382
+ * @format DECIMAL_VALUE
332
383
  */
333
384
  total?: string;
334
385
  /**
335
386
  * Three-letter currency code in
336
387
  * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
388
+ * @format CURRENCY
337
389
  */
338
390
  currency?: string;
339
- /** Price change after billing date was change and price was adjusted. Could be positive and negative values. */
391
+ /**
392
+ * Price change after billing date was change and price was adjusted. Could be positive and negative values.
393
+ * @format DECIMAL_VALUE
394
+ */
340
395
  proration?: string;
341
396
  }
342
397
  export interface Fee {
343
- /** Fee name */
398
+ /**
399
+ * Fee name
400
+ * @minLength 1
401
+ * @maxLength 40
402
+ */
344
403
  name?: string;
345
- /** Amount of fee to be charged */
404
+ /**
405
+ * Amount of fee to be charged
406
+ * @decimalValue options { lt:1000000000000, gt:0.000, maxScale:3 }
407
+ */
346
408
  amount?: string;
347
409
  }
348
410
  export declare enum OrderType {
@@ -475,9 +537,15 @@ export interface OrderCycle {
475
537
  endedDate?: Date | null;
476
538
  }
477
539
  export interface FormData {
478
- /** ID of the order form ([REST](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/submissions/introduction)) associated with the plan at checkout. */
540
+ /**
541
+ * ID of the order form ([REST](https://dev.wix.com/docs/rest/api-reference/wix-forms/form-submissions/introduction)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/forms/submissions/introduction)) associated with the plan at checkout.
542
+ * @format GUID
543
+ */
479
544
  formId?: string | null;
480
- /** ID of a submission to the plan's order form at checkout. Every time a visitor completes the checkout process for a plan, a new submission is created. */
545
+ /**
546
+ * ID of a submission to the plan's order form at checkout. Every time a visitor completes the checkout process for a plan, a new submission is created.
547
+ * @format GUID
548
+ */
481
549
  submissionId?: string | null;
482
550
  /**
483
551
  * Data submitted to the plan's order form at checkout.
@@ -557,8 +625,39 @@ export interface ActionEvent {
557
625
  }
558
626
  export interface Empty {
559
627
  }
560
- export interface MemberGetOrderRequest {
561
- /** Order ID. */
628
+ export interface OrderPurchased {
629
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
630
+ order?: Order;
631
+ }
632
+ export interface OrderStarted {
633
+ /** Order that reached its `startDate`. */
634
+ order?: Order;
635
+ }
636
+ /**
637
+ * Triggered at the start of a new payment cycle for an existing order.
638
+ *
639
+ * This webhook does not trigger at the initial start of an offline order.
640
+ */
641
+ export interface OrderCycleStarted {
642
+ /** Order whose new cycle started. */
643
+ order?: Order;
644
+ /** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
645
+ cycleNumber?: number;
646
+ }
647
+ /** Emitted when a recurring order is canceled for the next payment cycle */
648
+ export interface OrderAutoRenewCanceled {
649
+ /** Order that is canceled, effective at the end of the current payment cycle. */
650
+ order?: Order;
651
+ }
652
+ export interface OrderEnded {
653
+ /** Order that ended. */
654
+ order?: Order;
655
+ }
656
+ export interface GetOrderRequest {
657
+ /**
658
+ * Order ID.
659
+ * @format GUID
660
+ */
562
661
  _id: string;
563
662
  /**
564
663
  * Predefined set of fields to return.
@@ -575,24 +674,44 @@ export declare enum Set {
575
674
  /** Returns all order form submission data. */
576
675
  FULL = "FULL"
577
676
  }
578
- export interface MemberGetOrderResponse {
579
- /** Requested order. */
677
+ export interface GetOrderResponse {
678
+ /** Order. */
580
679
  order?: Order;
581
680
  }
582
- export interface MemberListOrdersRequest {
583
- /** Filter by plan IDs. */
681
+ export interface ListOrdersRequest {
682
+ /**
683
+ * Filter by a buyer's member ID, from the Members API.
684
+ * @format GUID
685
+ */
686
+ buyerIds?: string[];
687
+ /**
688
+ * Filter by plan IDs, from the Plans API.
689
+ * @format GUID
690
+ */
584
691
  planIds?: string[];
585
- /** Filter for orders where auto renewal was canceled. */
692
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
586
693
  autoRenewCanceled?: boolean | null;
587
694
  /** Filter by order status. */
588
695
  orderStatuses?: OrderStatus[];
589
696
  /** Filter by payment status. */
590
697
  paymentStatuses?: PaymentStatus[];
591
- /** Limit the number of pricing plans returned. Default limit is 50. */
698
+ /**
699
+ * Number of orders to return. See Sorting and Paging for more information.
700
+ *
701
+ * Max: `50`
702
+ * @min 1
703
+ * @max 50
704
+ */
592
705
  limit?: number | null;
593
- /** Number of entries to offset. */
706
+ /** Number of orders to skip in the current sort order. */
594
707
  offset?: number | null;
595
- /** Sorting direction (defaults to ASC) and field to sort by. */
708
+ /**
709
+ * Sort order.
710
+ *
711
+ * Use `ASC` for ascending order or `DESC` for descending order.
712
+ *
713
+ * Default: `DESC`.
714
+ */
596
715
  sorting?: Sorting;
597
716
  /**
598
717
  * Predefined set of fields to return.
@@ -602,7 +721,10 @@ export interface MemberListOrdersRequest {
602
721
  fieldSet?: Set;
603
722
  }
604
723
  export interface Sorting {
605
- /** Name of the field to sort by. */
724
+ /**
725
+ * Name of the field to sort by.
726
+ * @maxLength 512
727
+ */
606
728
  fieldName?: string;
607
729
  /** Sort order. */
608
730
  order?: SortOrder;
@@ -611,8 +733,8 @@ export declare enum SortOrder {
611
733
  ASC = "ASC",
612
734
  DESC = "DESC"
613
735
  }
614
- export interface MemberListOrdersResponse {
615
- /** Requested orders. */
736
+ export interface ListOrdersResponse {
737
+ /** List of orders. */
616
738
  orders?: Order[];
617
739
  /** Object containing paging-related data (number of orders returned, offset). */
618
740
  pagingMetadata?: PagingMetadataV2;
@@ -630,16 +752,18 @@ export interface PagingMetadataV2 {
630
752
  cursors?: Cursors;
631
753
  }
632
754
  export interface Cursors {
633
- /** Cursor string pointing to the next page in the list of results. */
755
+ /**
756
+ * Cursor string pointing to the next page in the list of results.
757
+ * @maxLength 16000
758
+ */
634
759
  next?: string | null;
635
- /** Cursor pointing to the previous page in the list of results. */
760
+ /**
761
+ * Cursor pointing to the previous page in the list of results.
762
+ * @maxLength 16000
763
+ */
636
764
  prev?: string | null;
637
765
  }
638
- /**
639
- * TODO: Write orders filter and sort docs page
640
- * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
641
- */
642
- export interface QueryOrdersRequest {
766
+ export interface OrdersQueryOrdersRequest {
643
767
  /** Query filter. */
644
768
  query?: QueryV2;
645
769
  }
@@ -679,29 +803,96 @@ export interface Paging {
679
803
  offset?: number | null;
680
804
  }
681
805
  export interface CursorPaging {
682
- /** Maximum number of items to return in the results. */
806
+ /**
807
+ * Maximum number of items to return in the results.
808
+ * @max 100
809
+ */
683
810
  limit?: number | null;
684
811
  /**
685
812
  * Pointer to the next or previous page in the list of results.
686
813
  *
687
814
  * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
688
815
  * Not relevant for the first request.
816
+ * @maxLength 16000
689
817
  */
690
818
  cursor?: string | null;
691
819
  }
692
- export interface QueryOrdersResponse {
693
- /** Order data. */
820
+ export interface OrdersQueryOrdersResponse {
821
+ /** Retrieved orders. */
694
822
  plans?: Order[];
695
823
  /** Paging-related data (number of orders returned, offset). */
696
824
  pagingMetadata?: PagingMetadataV2;
697
825
  }
698
- export interface RequestCancellationRequest {
699
- /** Order ID. */
826
+ export interface GetOrdersStatsRequest {
827
+ }
828
+ export interface GetOrdersStatsResponse {
829
+ /** Total number of orders. */
830
+ totalOrderCount?: number;
831
+ /** Number of active orders. */
832
+ activeOrderCount?: number;
833
+ }
834
+ export interface GetAvailableOrderActionsRequest {
835
+ /**
836
+ * Order ID.
837
+ * @format GUID
838
+ */
839
+ _id?: string;
840
+ }
841
+ export interface GetAvailableOrderActionsResponse {
842
+ /** Whether the order can be suspended. */
843
+ suspendable?: boolean;
844
+ /** If the order cannot be suspended, a reason is returned here. */
845
+ notSuspendableReason?: ReasonNotSuspendable;
846
+ /** Whether the order can be canceled by the buyer. */
847
+ cancelableByBuyer?: boolean;
848
+ }
849
+ export declare enum ReasonNotSuspendable {
850
+ /** Undefined reason. */
851
+ UNDEFINED = "UNDEFINED",
852
+ /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
853
+ PENDING = "PENDING",
854
+ /** Trial orders can't be suspended. */
855
+ TRIAL = "TRIAL",
856
+ /** Canceled orders can't be suspended. */
857
+ CANCELED = "CANCELED",
858
+ /** Ended orders can't be suspended. */
859
+ ENDED = "ENDED",
860
+ /** Paid for orders with future start dates can't be suspended. */
861
+ NOT_STARTED = "NOT_STARTED",
862
+ /** Order is already suspended. */
863
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
864
+ /** Orders based on recurring payments using older stripe versions can't be suspended. */
865
+ OLD_STRIPE = "OLD_STRIPE"
866
+ }
867
+ export interface PostponeEndDateRequest {
868
+ /**
869
+ * Order ID.
870
+ * @format GUID
871
+ */
700
872
  _id: string;
701
- /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
873
+ /**
874
+ * New end date and time.
875
+ *
876
+ * Must be later than the current end date and time.
877
+ */
878
+ endDate: Date | null;
879
+ }
880
+ export interface PostponeEndDateResponse {
881
+ }
882
+ export interface OrderEndDatePostponed {
883
+ /** Order whose `endDate` was postponed. */
884
+ order?: Order;
885
+ }
886
+ export interface CancelOrderRequest {
887
+ /**
888
+ * Order ID.
889
+ * @format GUID
890
+ */
891
+ _id: string;
892
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
702
893
  effectiveAt: CancellationEffectiveAt;
703
894
  }
704
- export interface RequestCancellationResponse {
895
+ export interface CancelOrderResponse {
705
896
  }
706
897
  /**
707
898
  * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
@@ -712,94 +903,329 @@ export interface OrderCanceled {
712
903
  /** Canceled order. */
713
904
  order?: Order;
714
905
  }
715
- export interface MessageEnvelope {
716
- /** App instance ID. */
717
- instanceId?: string | null;
718
- /** Event type. */
719
- eventType?: string;
720
- /** The identification type and identity data. */
721
- identity?: IdentificationData;
722
- /** Stringify payload. */
723
- data?: string;
724
- }
725
- export interface IdentificationData extends IdentificationDataIdOneOf {
726
- /** ID of a site visitor that has not logged in to the site. */
727
- anonymousVisitorId?: string;
728
- /** ID of a site visitor that has logged in to the site. */
729
- memberId?: string;
730
- /** ID of a Wix user (site owner, contributor, etc.). */
731
- wixUserId?: string;
732
- /** ID of an app. */
733
- appId?: string;
734
- /** @readonly */
735
- identityType?: WebhookIdentityType;
906
+ export interface MarkAsPaidRequest {
907
+ /**
908
+ * Order ID.
909
+ * @format GUID
910
+ */
911
+ _id: string;
736
912
  }
737
- /** @oneof */
738
- export interface IdentificationDataIdOneOf {
739
- /** ID of a site visitor that has not logged in to the site. */
740
- anonymousVisitorId?: string;
741
- /** ID of a site visitor that has logged in to the site. */
742
- memberId?: string;
743
- /** ID of a Wix user (site owner, contributor, etc.). */
744
- wixUserId?: string;
745
- /** ID of an app. */
746
- appId?: string;
913
+ export interface MarkAsPaidResponse {
747
914
  }
748
- export declare enum WebhookIdentityType {
749
- UNKNOWN = "UNKNOWN",
750
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
751
- MEMBER = "MEMBER",
752
- WIX_USER = "WIX_USER",
753
- APP = "APP"
915
+ export interface OrderMarkedAsPaid {
916
+ /** Order that was marked as paid. */
917
+ order?: Order;
754
918
  }
755
- export interface CreateOnlineOrderRequest {
756
- /** Plan ID. */
757
- planId: string;
919
+ export interface PauseOrderRequest {
758
920
  /**
759
- * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
760
- *
761
- * Default: Current date and time.
921
+ * Order ID.
922
+ * @format GUID
762
923
  */
763
- startDate?: Date | null;
764
- /** Coupon code to apply. */
765
- couponCode?: string | null;
766
- /** Provided if checkout is initiated on buyer's behalf. */
767
- onBehalf?: OnBehalf;
768
- /** Submission ID of the form submitted with this order. */
769
- submissionId?: string | null;
924
+ _id: string;
770
925
  }
771
- export interface OnBehalf {
772
- /** Member ID. */
773
- memberId?: string;
774
- /** Method by which checkout is initiated. */
775
- orderMethod?: OrderMethod;
926
+ export interface PauseOrderResponse {
776
927
  }
777
- export interface CreateOnlineOrderResponse {
778
- /** Created online order. */
928
+ export interface OrderPaused {
929
+ /** Paused order. */
779
930
  order?: Order;
780
931
  }
781
- export interface CouponsError {
782
- /** Coupon code. */
783
- couponCode?: string;
784
- /** Plan ID. */
785
- planId?: string;
786
- }
787
- export interface CreateGuestOnlineOrderRequest {
788
- /** Plan ID. */
789
- planId?: string;
932
+ export interface BulkPauseOrderRequest {
790
933
  /**
791
- * Start date for the ordered plan.
792
- *
934
+ * List of Order IDs.
935
+ * @format GUID
936
+ * @minSize 1
937
+ * @maxSize 100
938
+ */
939
+ ids?: string[];
940
+ /** Set to true to return Order entity in response. */
941
+ returnFullEntity?: boolean;
942
+ }
943
+ export interface BulkPauseOrderResponse {
944
+ /** Orders that were paused. */
945
+ results?: BulkOrderResult[];
946
+ /** Bulk action metadata. */
947
+ bulkActionMetadata?: BulkActionMetadata;
948
+ }
949
+ export interface BulkOrderResult {
950
+ /** Item metadata */
951
+ itemMetadata?: ItemMetadata;
952
+ /** The order. */
953
+ order?: Order;
954
+ }
955
+ export interface ItemMetadata {
956
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
957
+ _id?: string | null;
958
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
959
+ originalIndex?: number;
960
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
961
+ success?: boolean;
962
+ /** Details about the error in case of failure. */
963
+ error?: ApplicationError;
964
+ }
965
+ export interface ApplicationError {
966
+ /** Error code. */
967
+ code?: string;
968
+ /** Description of the error. */
969
+ description?: string;
970
+ /** Data related to the error. */
971
+ data?: Record<string, any> | null;
972
+ }
973
+ export interface BulkActionMetadata {
974
+ /** Number of items that were successfully processed. */
975
+ totalSuccesses?: number;
976
+ /** Number of items that couldn't be processed. */
977
+ totalFailures?: number;
978
+ /** Number of failures without details because detailed failure threshold was exceeded. */
979
+ undetailedFailures?: number;
980
+ }
981
+ export interface ResumeOrderRequest {
982
+ /**
983
+ * Order ID.
984
+ * @format GUID
985
+ */
986
+ _id: string;
987
+ }
988
+ export interface ResumeOrderResponse {
989
+ }
990
+ export interface OrderResumed {
991
+ /** Resumed order. */
992
+ order?: Order;
993
+ }
994
+ export interface BulkResumeOrderRequest {
995
+ /**
996
+ * List of Order IDs.
997
+ * @format GUID
998
+ * @minSize 1
999
+ * @maxSize 100
1000
+ */
1001
+ ids?: string[];
1002
+ /** Set to true to return Order entity in response. */
1003
+ returnFullEntity?: boolean;
1004
+ }
1005
+ export interface BulkResumeOrderResponse {
1006
+ /** Orders that were resumed. */
1007
+ results?: BulkOrderResult[];
1008
+ /** Bulk action metadata. */
1009
+ bulkActionMetadata?: BulkActionMetadata;
1010
+ }
1011
+ export interface MessageEnvelope {
1012
+ /**
1013
+ * App instance ID.
1014
+ * @format GUID
1015
+ */
1016
+ instanceId?: string | null;
1017
+ /**
1018
+ * Event type.
1019
+ * @maxLength 150
1020
+ */
1021
+ eventType?: string;
1022
+ /** The identification type and identity data. */
1023
+ identity?: IdentificationData;
1024
+ /** Stringify payload. */
1025
+ data?: string;
1026
+ }
1027
+ export interface IdentificationData extends IdentificationDataIdOneOf {
1028
+ /**
1029
+ * ID of a site visitor that has not logged in to the site.
1030
+ * @format GUID
1031
+ */
1032
+ anonymousVisitorId?: string;
1033
+ /**
1034
+ * ID of a site visitor that has logged in to the site.
1035
+ * @format GUID
1036
+ */
1037
+ memberId?: string;
1038
+ /**
1039
+ * ID of a Wix user (site owner, contributor, etc.).
1040
+ * @format GUID
1041
+ */
1042
+ wixUserId?: string;
1043
+ /**
1044
+ * ID of an app.
1045
+ * @format GUID
1046
+ */
1047
+ appId?: string;
1048
+ /** @readonly */
1049
+ identityType?: WebhookIdentityType;
1050
+ }
1051
+ /** @oneof */
1052
+ export interface IdentificationDataIdOneOf {
1053
+ /**
1054
+ * ID of a site visitor that has not logged in to the site.
1055
+ * @format GUID
1056
+ */
1057
+ anonymousVisitorId?: string;
1058
+ /**
1059
+ * ID of a site visitor that has logged in to the site.
1060
+ * @format GUID
1061
+ */
1062
+ memberId?: string;
1063
+ /**
1064
+ * ID of a Wix user (site owner, contributor, etc.).
1065
+ * @format GUID
1066
+ */
1067
+ wixUserId?: string;
1068
+ /**
1069
+ * ID of an app.
1070
+ * @format GUID
1071
+ */
1072
+ appId?: string;
1073
+ }
1074
+ export declare enum WebhookIdentityType {
1075
+ UNKNOWN = "UNKNOWN",
1076
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1077
+ MEMBER = "MEMBER",
1078
+ WIX_USER = "WIX_USER",
1079
+ APP = "APP"
1080
+ }
1081
+ export interface MemberGetOrderRequest {
1082
+ /**
1083
+ * Order ID.
1084
+ * @format GUID
1085
+ */
1086
+ _id: string;
1087
+ /**
1088
+ * Predefined set of fields to return.
1089
+ *
1090
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1091
+ */
1092
+ fieldSet?: Set;
1093
+ }
1094
+ export interface MemberGetOrderResponse {
1095
+ /** Requested order. */
1096
+ order?: Order;
1097
+ }
1098
+ export interface MemberListOrdersRequest {
1099
+ /**
1100
+ * Filter by plan IDs.
1101
+ * @format GUID
1102
+ */
1103
+ planIds?: string[];
1104
+ /** Filter for orders where auto renewal was canceled. */
1105
+ autoRenewCanceled?: boolean | null;
1106
+ /** Filter by order status. */
1107
+ orderStatuses?: OrderStatus[];
1108
+ /** Filter by payment status. */
1109
+ paymentStatuses?: PaymentStatus[];
1110
+ /**
1111
+ * Limit the number of pricing plans returned. Default limit is 50.
1112
+ * @min 1
1113
+ * @max 50
1114
+ */
1115
+ limit?: number | null;
1116
+ /** Number of entries to offset. */
1117
+ offset?: number | null;
1118
+ /** Sorting direction (defaults to ASC) and field to sort by. */
1119
+ sorting?: Sorting;
1120
+ /**
1121
+ * Predefined set of fields to return.
1122
+ *
1123
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1124
+ */
1125
+ fieldSet?: Set;
1126
+ }
1127
+ export interface MemberListOrdersResponse {
1128
+ /** Requested orders. */
1129
+ orders?: Order[];
1130
+ /** Object containing paging-related data (number of orders returned, offset). */
1131
+ pagingMetadata?: PagingMetadataV2;
1132
+ }
1133
+ /**
1134
+ * TODO: Write orders filter and sort docs page
1135
+ * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
1136
+ */
1137
+ export interface QueryOrdersRequest {
1138
+ /** Query filter. */
1139
+ query?: QueryV2;
1140
+ }
1141
+ export interface QueryOrdersResponse {
1142
+ /** Order data. */
1143
+ plans?: Order[];
1144
+ /** Paging-related data (number of orders returned, offset). */
1145
+ pagingMetadata?: PagingMetadataV2;
1146
+ }
1147
+ export interface RequestCancellationRequest {
1148
+ /**
1149
+ * Order ID.
1150
+ * @format GUID
1151
+ */
1152
+ _id: string;
1153
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
1154
+ effectiveAt: CancellationEffectiveAt;
1155
+ }
1156
+ export interface RequestCancellationResponse {
1157
+ }
1158
+ export interface CreateOnlineOrderRequest {
1159
+ /**
1160
+ * Plan ID.
1161
+ * @format GUID
1162
+ */
1163
+ planId: string;
1164
+ /**
1165
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1166
+ *
1167
+ * Default: Current date and time.
1168
+ */
1169
+ startDate?: Date | null;
1170
+ /**
1171
+ * Coupon code to apply.
1172
+ * @minLength 1
1173
+ * @maxLength 20
1174
+ */
1175
+ couponCode?: string | null;
1176
+ /** Provided if checkout is initiated on buyer's behalf. */
1177
+ onBehalf?: OnBehalf;
1178
+ /**
1179
+ * Submission ID of the form submitted with this order.
1180
+ * @format GUID
1181
+ */
1182
+ submissionId?: string | null;
1183
+ }
1184
+ export interface OnBehalf {
1185
+ /**
1186
+ * Member ID.
1187
+ * @format GUID
1188
+ */
1189
+ memberId?: string;
1190
+ /** Method by which checkout is initiated. */
1191
+ orderMethod?: OrderMethod;
1192
+ }
1193
+ export interface CreateOnlineOrderResponse {
1194
+ /** Created online order. */
1195
+ order?: Order;
1196
+ }
1197
+ export interface CouponsError {
1198
+ /** Coupon code. */
1199
+ couponCode?: string;
1200
+ /** Plan ID. */
1201
+ planId?: string;
1202
+ }
1203
+ export interface CreateGuestOnlineOrderRequest {
1204
+ /**
1205
+ * Plan ID.
1206
+ * @format GUID
1207
+ */
1208
+ planId?: string;
1209
+ /**
1210
+ * Start date for the ordered plan.
1211
+ *
793
1212
  * Default: Current date
794
1213
  */
795
1214
  startDate?: Date | null;
796
- /** Coupon code to apply. */
1215
+ /**
1216
+ * Coupon code to apply.
1217
+ * @minLength 1
1218
+ * @maxLength 20
1219
+ */
797
1220
  couponCode?: string | null;
798
1221
  /** Captcha data to prove you are not a robot */
799
1222
  captcha?: Captcha;
800
1223
  /** Visitor info */
801
1224
  guest?: Guest;
802
- /** Form submission id that was submitted together with the order */
1225
+ /**
1226
+ * Form submission id that was submitted together with the order
1227
+ * @format GUID
1228
+ */
803
1229
  submissionId?: string | null;
804
1230
  }
805
1231
  export interface Captcha {
@@ -807,7 +1233,10 @@ export interface Captcha {
807
1233
  token?: string;
808
1234
  }
809
1235
  export interface Guest {
810
- /** Email for checkout */
1236
+ /**
1237
+ * Email for checkout
1238
+ * @format EMAIL
1239
+ */
811
1240
  email?: string;
812
1241
  }
813
1242
  export interface CreateGuestOnlineOrderResponse {
@@ -815,9 +1244,15 @@ export interface CreateGuestOnlineOrderResponse {
815
1244
  order?: Order;
816
1245
  }
817
1246
  export interface CreateOfflineOrderRequest {
818
- /** ID of the plan being ordered, from the Plans API. */
1247
+ /**
1248
+ * ID of the plan being ordered, from the Plans API.
1249
+ * @format GUID
1250
+ */
819
1251
  planId: string;
820
- /** ID of the member ordering the plan, from the Members API. */
1252
+ /**
1253
+ * ID of the member ordering the plan, from the Members API.
1254
+ * @format GUID
1255
+ */
821
1256
  memberId: string;
822
1257
  /**
823
1258
  * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -831,9 +1266,16 @@ export interface CreateOfflineOrderRequest {
831
1266
  * Default: `false`
832
1267
  */
833
1268
  paid?: boolean | null;
834
- /** Coupon code to apply, from the Coupons API. */
1269
+ /**
1270
+ * Coupon code to apply, from the Coupons API.
1271
+ * @minLength 1
1272
+ * @maxLength 20
1273
+ */
835
1274
  couponCode?: string | null;
836
- /** Form submission ID that was submitted with the order. */
1275
+ /**
1276
+ * Form submission ID that was submitted with the order.
1277
+ * @format GUID
1278
+ */
837
1279
  submissionId?: string | null;
838
1280
  }
839
1281
  export interface CreateOfflineOrderResponse {
@@ -841,9 +1283,15 @@ export interface CreateOfflineOrderResponse {
841
1283
  order?: Order;
842
1284
  }
843
1285
  export interface CreateExternalOrderRequest {
844
- /** Plan ID. */
1286
+ /**
1287
+ * Plan ID.
1288
+ * @format GUID
1289
+ */
845
1290
  planId?: string;
846
- /** Form submission id that was submitted together with the order */
1291
+ /**
1292
+ * Form submission id that was submitted together with the order
1293
+ * @format GUID
1294
+ */
847
1295
  submissionId?: string | null;
848
1296
  }
849
1297
  export interface CreateExternalOrderResponse {
@@ -851,7 +1299,10 @@ export interface CreateExternalOrderResponse {
851
1299
  order?: Order;
852
1300
  }
853
1301
  export interface GetOnlineOrderPreviewRequest {
854
- /** Plan ID. */
1302
+ /**
1303
+ * Plan ID.
1304
+ * @format GUID
1305
+ */
855
1306
  planId: string;
856
1307
  /**
857
1308
  * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
@@ -859,7 +1310,11 @@ export interface GetOnlineOrderPreviewRequest {
859
1310
  * Default: Current date and time.
860
1311
  */
861
1312
  startDate?: Date | null;
862
- /** Coupon code to apply. */
1313
+ /**
1314
+ * Coupon code to apply.
1315
+ * @minLength 1
1316
+ * @maxLength 20
1317
+ */
863
1318
  couponCode?: string | null;
864
1319
  }
865
1320
  export interface GetOnlineOrderPreviewResponse {
@@ -869,7 +1324,10 @@ export interface GetOnlineOrderPreviewResponse {
869
1324
  purchaseLimitExceeded?: boolean;
870
1325
  }
871
1326
  export interface GetGuestOnlineOrderPreviewRequest {
872
- /** Plan ID. */
1327
+ /**
1328
+ * Plan ID.
1329
+ * @format GUID
1330
+ */
873
1331
  planId?: string;
874
1332
  /**
875
1333
  * Start date for the ordered plan.
@@ -877,9 +1335,16 @@ export interface GetGuestOnlineOrderPreviewRequest {
877
1335
  * Default: Current date
878
1336
  */
879
1337
  startDate?: Date | null;
880
- /** Coupon code to apply. */
1338
+ /**
1339
+ * Coupon code to apply.
1340
+ * @minLength 1
1341
+ * @maxLength 20
1342
+ */
881
1343
  couponCode?: string | null;
882
- /** Email for checkout */
1344
+ /**
1345
+ * Email for checkout
1346
+ * @format EMAIL
1347
+ */
883
1348
  email?: string;
884
1349
  }
885
1350
  export interface GetGuestOnlineOrderPreviewResponse {
@@ -892,322 +1357,115 @@ export interface GetGuestOnlineOrderPreviewResponse {
892
1357
  purchaseLimitExceeded?: boolean;
893
1358
  }
894
1359
  export interface GetOfflineOrderPreviewRequest {
895
- /** ID of the plan of the previewed order, from the Plans API. */
896
- planId: string;
897
- /** Member ID of the buyer the previewed order is for, from the Members API. */
898
- memberId: string;
899
- /**
900
- * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
901
- *
902
- * Default: Current date and time.
903
- */
904
- startDate?: Date | null;
905
- /** Coupon code to apply, from the Coupons API. */
906
- couponCode?: string | null;
907
- }
908
- export interface GetOfflineOrderPreviewResponse {
909
- /** The previewed order, as if the plan had been ordered. */
910
- order?: Order;
911
1360
  /**
912
- * Whether this previewed order would exceed the permitted amount of purchases available
913
- * for this plan for this buyer.
914
- *
915
- * Always `false` for plans that do not have purchase limits.
1361
+ * ID of the plan of the previewed order, from the Plans API.
1362
+ * @format GUID
916
1363
  */
917
- purchaseLimitExceeded?: boolean;
918
- }
919
- export interface GetPricePreviewRequest {
920
- /** ID of plan to preview. */
921
1364
  planId: string;
922
- /** Coupon code to apply, from the Coupons API. */
923
- couponCode?: string | null;
924
- }
925
- export interface GetPricePreviewResponse {
926
- /**
927
- * @internal
928
- * @internal
929
- * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
930
- * @replacedBy prices
931
- * @targetRemovalDate 2022-10-01
932
- */
933
- price?: PriceDetails;
934
- /** Pricing details. */
935
- prices?: SpannedPrice[];
936
- }
937
- export interface ChangeStartDateRequest {
938
- /** Draft order ID. */
939
- orderId?: string;
940
- /** New valid from date (timestamp). */
941
- startDate?: Date | null;
942
- }
943
- export interface ChangeStartDateResponse {
944
- /** Updated draft order. */
945
- order?: Order;
946
- }
947
- export interface OrderStartDateChanged {
948
- /** Order whose `startDate` changed. */
949
- order?: Order;
950
- }
951
- export interface ApplyCouponRequest {
952
- /** Draft order ID. */
953
- orderId?: string;
954
- /** Coupon code to apply. */
955
- couponCode?: string;
956
- }
957
- export interface ApplyCouponResponse {
958
- /** Order with applied coupon and recalculated tax. */
959
- order?: Order;
960
- }
961
- export interface SetSubmissionRequest {
962
- /** Order ID. */
963
- orderId?: string;
964
- /** Submission ID. */
965
- submissionId?: string;
966
- }
967
- export interface SetSubmissionResponse {
968
- /** Order with submission id */
969
- order?: Order;
970
- }
971
- export interface OrderPurchased {
972
- /** Order that was paid for. If a free or an offline order, the order that was created. */
973
- order?: Order;
974
- }
975
- export interface OrderStarted {
976
- /** Order that reached its `startDate`. */
977
- order?: Order;
978
- }
979
- /**
980
- * Triggered at the start of a new payment cycle for an existing order.
981
- *
982
- * This webhook does not trigger at the initial start of an offline order.
983
- */
984
- export interface OrderCycleStarted {
985
- /** Order whose new cycle started. */
986
- order?: Order;
987
- /** Number of the payment cycle will be 0 when the order is in the free trial period. In other cases, the cycle number starts from 1. */
988
- cycleNumber?: number;
989
- }
990
- /** Emitted when a recurring order is canceled for the next payment cycle */
991
- export interface OrderAutoRenewCanceled {
992
- /** Order that is canceled, effective at the end of the current payment cycle. */
993
- order?: Order;
994
- }
995
- export interface OrderEnded {
996
- /** Order that ended. */
997
- order?: Order;
998
- }
999
- export interface GetOrderRequest {
1000
- /** Order ID. */
1001
- _id: string;
1002
1365
  /**
1003
- * Predefined set of fields to return.
1004
- *
1005
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
1366
+ * Member ID of the buyer the previewed order is for, from the Members API.
1367
+ * @format GUID
1006
1368
  */
1007
- fieldSet?: Set;
1008
- }
1009
- export interface GetOrderResponse {
1010
- /** Order. */
1011
- order?: Order;
1012
- }
1013
- export interface ListOrdersRequest {
1014
- /** Filter by a buyer's member ID, from the Members API. */
1015
- buyerIds?: string[];
1016
- /** Filter by plan IDs, from the Plans API. */
1017
- planIds?: string[];
1018
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1019
- autoRenewCanceled?: boolean | null;
1020
- /** Filter by order status. */
1021
- orderStatuses?: OrderStatus[];
1022
- /** Filter by payment status. */
1023
- paymentStatuses?: PaymentStatus[];
1024
- /**
1025
- * Number of orders to return. See Sorting and Paging for more information.
1026
- *
1027
- * Max: `50`
1028
- */
1029
- limit?: number | null;
1030
- /** Number of orders to skip in the current sort order. */
1031
- offset?: number | null;
1032
- /**
1033
- * Sort order.
1034
- *
1035
- * Use `ASC` for ascending order or `DESC` for descending order.
1036
- *
1037
- * Default: `DESC`.
1038
- */
1039
- sorting?: Sorting;
1040
- /**
1041
- * Predefined set of fields to return.
1042
- *
1043
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
1044
- */
1045
- fieldSet?: Set;
1046
- }
1047
- export interface ListOrdersResponse {
1048
- /** List of orders. */
1049
- orders?: Order[];
1050
- /** Object containing paging-related data (number of orders returned, offset). */
1051
- pagingMetadata?: PagingMetadataV2;
1052
- }
1053
- export interface OrdersQueryOrdersRequest {
1054
- /** Query filter. */
1055
- query?: QueryV2;
1056
- }
1057
- export interface OrdersQueryOrdersResponse {
1058
- /** Retrieved orders. */
1059
- plans?: Order[];
1060
- /** Paging-related data (number of orders returned, offset). */
1061
- pagingMetadata?: PagingMetadataV2;
1062
- }
1063
- export interface GetOrdersStatsRequest {
1064
- }
1065
- export interface GetOrdersStatsResponse {
1066
- /** Total number of orders. */
1067
- totalOrderCount?: number;
1068
- /** Number of active orders. */
1069
- activeOrderCount?: number;
1070
- }
1071
- export interface GetAvailableOrderActionsRequest {
1072
- /** Order ID. */
1073
- _id?: string;
1074
- }
1075
- export interface GetAvailableOrderActionsResponse {
1076
- /** Whether the order can be suspended. */
1077
- suspendable?: boolean;
1078
- /** If the order cannot be suspended, a reason is returned here. */
1079
- notSuspendableReason?: ReasonNotSuspendable;
1080
- /** Whether the order can be canceled by the buyer. */
1081
- cancelableByBuyer?: boolean;
1082
- }
1083
- export declare enum ReasonNotSuspendable {
1084
- /** Undefined reason. */
1085
- UNDEFINED = "UNDEFINED",
1086
- /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
1087
- PENDING = "PENDING",
1088
- /** Trial orders can't be suspended. */
1089
- TRIAL = "TRIAL",
1090
- /** Canceled orders can't be suspended. */
1091
- CANCELED = "CANCELED",
1092
- /** Ended orders can't be suspended. */
1093
- ENDED = "ENDED",
1094
- /** Paid for orders with future start dates can't be suspended. */
1095
- NOT_STARTED = "NOT_STARTED",
1096
- /** Order is already suspended. */
1097
- ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1098
- /** Orders based on recurring payments using older stripe versions can't be suspended. */
1099
- OLD_STRIPE = "OLD_STRIPE"
1100
- }
1101
- export interface PostponeEndDateRequest {
1102
- /** Order ID. */
1103
- _id: string;
1369
+ memberId: string;
1104
1370
  /**
1105
- * New end date and time.
1371
+ * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1106
1372
  *
1107
- * Must be later than the current end date and time.
1373
+ * Default: Current date and time.
1108
1374
  */
1109
- endDate: Date | null;
1110
- }
1111
- export interface PostponeEndDateResponse {
1375
+ startDate?: Date | null;
1376
+ /**
1377
+ * Coupon code to apply, from the Coupons API.
1378
+ * @minLength 1
1379
+ * @maxLength 20
1380
+ */
1381
+ couponCode?: string | null;
1112
1382
  }
1113
- export interface OrderEndDatePostponed {
1114
- /** Order whose `endDate` was postponed. */
1383
+ export interface GetOfflineOrderPreviewResponse {
1384
+ /** The previewed order, as if the plan had been ordered. */
1115
1385
  order?: Order;
1386
+ /**
1387
+ * Whether this previewed order would exceed the permitted amount of purchases available
1388
+ * for this plan for this buyer.
1389
+ *
1390
+ * Always `false` for plans that do not have purchase limits.
1391
+ */
1392
+ purchaseLimitExceeded?: boolean;
1116
1393
  }
1117
- export interface CancelOrderRequest {
1118
- /** Order ID. */
1119
- _id: string;
1120
- /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1121
- effectiveAt: CancellationEffectiveAt;
1122
- }
1123
- export interface CancelOrderResponse {
1394
+ export interface GetPricePreviewRequest {
1395
+ /**
1396
+ * ID of plan to preview.
1397
+ * @format GUID
1398
+ */
1399
+ planId: string;
1400
+ /**
1401
+ * Coupon code to apply, from the Coupons API.
1402
+ * @minLength 1
1403
+ * @maxLength 20
1404
+ */
1405
+ couponCode?: string | null;
1124
1406
  }
1125
- export interface MarkAsPaidRequest {
1126
- /** Order ID. */
1127
- _id: string;
1407
+ export interface GetPricePreviewResponse {
1408
+ /**
1409
+ * @internal
1410
+ * @internal
1411
+ * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
1412
+ * @replacedBy prices
1413
+ * @targetRemovalDate 2022-10-01
1414
+ */
1415
+ price?: PriceDetails;
1416
+ /** Pricing details. */
1417
+ prices?: SpannedPrice[];
1128
1418
  }
1129
- export interface MarkAsPaidResponse {
1419
+ export interface ChangeStartDateRequest {
1420
+ /**
1421
+ * Draft order ID.
1422
+ * @format GUID
1423
+ */
1424
+ orderId?: string;
1425
+ /** New valid from date (timestamp). */
1426
+ startDate?: Date | null;
1130
1427
  }
1131
- export interface OrderMarkedAsPaid {
1132
- /** Order that was marked as paid. */
1428
+ export interface ChangeStartDateResponse {
1429
+ /** Updated draft order. */
1133
1430
  order?: Order;
1134
1431
  }
1135
- export interface PauseOrderRequest {
1136
- /** Order ID. */
1137
- _id: string;
1138
- }
1139
- export interface PauseOrderResponse {
1140
- }
1141
- export interface OrderPaused {
1142
- /** Paused order. */
1432
+ export interface OrderStartDateChanged {
1433
+ /** Order whose `startDate` changed. */
1143
1434
  order?: Order;
1144
1435
  }
1145
- export interface BulkPauseOrderRequest {
1146
- /** List of Order IDs. */
1147
- ids?: string[];
1148
- /** Set to true to return Order entity in response. */
1149
- returnFullEntity?: boolean;
1150
- }
1151
- export interface BulkPauseOrderResponse {
1152
- /** Orders that were paused. */
1153
- results?: BulkOrderResult[];
1154
- /** Bulk action metadata. */
1155
- bulkActionMetadata?: BulkActionMetadata;
1436
+ export interface ApplyCouponRequest {
1437
+ /**
1438
+ * Draft order ID.
1439
+ * @format GUID
1440
+ */
1441
+ orderId?: string;
1442
+ /**
1443
+ * Coupon code to apply.
1444
+ * @minLength 1
1445
+ * @maxLength 20
1446
+ */
1447
+ couponCode?: string;
1156
1448
  }
1157
- export interface BulkOrderResult {
1158
- /** Item metadata */
1159
- itemMetadata?: ItemMetadata;
1160
- /** The order. */
1449
+ export interface ApplyCouponResponse {
1450
+ /** Order with applied coupon and recalculated tax. */
1161
1451
  order?: Order;
1162
1452
  }
1163
- export interface ItemMetadata {
1164
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1165
- _id?: string | null;
1166
- /** Index of the item within the request array. Allows for correlation between request and response items. */
1167
- originalIndex?: number;
1168
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1169
- success?: boolean;
1170
- /** Details about the error in case of failure. */
1171
- error?: ApplicationError;
1172
- }
1173
- export interface ApplicationError {
1174
- /** Error code. */
1175
- code?: string;
1176
- /** Description of the error. */
1177
- description?: string;
1178
- /** Data related to the error. */
1179
- data?: Record<string, any> | null;
1180
- }
1181
- export interface BulkActionMetadata {
1182
- /** Number of items that were successfully processed. */
1183
- totalSuccesses?: number;
1184
- /** Number of items that couldn't be processed. */
1185
- totalFailures?: number;
1186
- /** Number of failures without details because detailed failure threshold was exceeded. */
1187
- undetailedFailures?: number;
1188
- }
1189
- export interface ResumeOrderRequest {
1190
- /** Order ID. */
1191
- _id: string;
1192
- }
1193
- export interface ResumeOrderResponse {
1453
+ export interface SetSubmissionRequest {
1454
+ /**
1455
+ * Order ID.
1456
+ * @format GUID
1457
+ */
1458
+ orderId?: string;
1459
+ /**
1460
+ * Submission ID.
1461
+ * @format GUID
1462
+ */
1463
+ submissionId?: string;
1194
1464
  }
1195
- export interface OrderResumed {
1196
- /** Resumed order. */
1465
+ export interface SetSubmissionResponse {
1466
+ /** Order with submission id */
1197
1467
  order?: Order;
1198
1468
  }
1199
- export interface BulkResumeOrderRequest {
1200
- /** List of Order IDs. */
1201
- ids?: string[];
1202
- /** Set to true to return Order entity in response. */
1203
- returnFullEntity?: boolean;
1204
- }
1205
- export interface BulkResumeOrderResponse {
1206
- /** Orders that were resumed. */
1207
- results?: BulkOrderResult[];
1208
- /** Bulk action metadata. */
1209
- bulkActionMetadata?: BulkActionMetadata;
1210
- }
1211
1469
  interface BuyerNonNullableFields {
1212
1470
  memberId: string;
1213
1471
  contactId: string;
@@ -1301,6 +1559,12 @@ export interface OrderNonNullableFields {
1301
1559
  statusNew: OrderStatus;
1302
1560
  onEcom: boolean;
1303
1561
  }
1562
+ export interface GetOrderResponseNonNullableFields {
1563
+ order?: OrderNonNullableFields;
1564
+ }
1565
+ export interface ListOrdersResponseNonNullableFields {
1566
+ orders: OrderNonNullableFields[];
1567
+ }
1304
1568
  export interface MemberGetOrderResponseNonNullableFields {
1305
1569
  order?: OrderNonNullableFields;
1306
1570
  }
@@ -1325,16 +1589,16 @@ export interface GetPricePreviewResponseNonNullableFields {
1325
1589
  price?: PriceDetailsNonNullableFields;
1326
1590
  prices: SpannedPriceNonNullableFields[];
1327
1591
  }
1328
- export interface GetOrderResponseNonNullableFields {
1329
- order?: OrderNonNullableFields;
1330
- }
1331
- export interface ListOrdersResponseNonNullableFields {
1332
- orders: OrderNonNullableFields[];
1333
- }
1334
1592
  export interface BaseEventMetadata {
1335
- /** App instance ID. */
1593
+ /**
1594
+ * App instance ID.
1595
+ * @format GUID
1596
+ */
1336
1597
  instanceId?: string | null;
1337
- /** Event type. */
1598
+ /**
1599
+ * Event type.
1600
+ * @maxLength 150
1601
+ */
1338
1602
  eventType?: string;
1339
1603
  /** The identification type and identity data. */
1340
1604
  identity?: IdentificationData;
@@ -1377,81 +1641,16 @@ export interface EventMetadata extends BaseEventMetadata {
1377
1641
  */
1378
1642
  entityEventSequence?: string | null;
1379
1643
  }
1380
- export interface OrderCanceledEnvelope {
1381
- data: OrderCanceled;
1382
- metadata: EventMetadata;
1383
- }
1384
- /**
1385
- * Triggered when an order is canceled.
1386
- *
1387
- * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1388
- * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1389
- * + If the order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`, the webhook is triggered at the end of the current payment cycle. In this case, the Order Auto Renew Canceled Webhook is triggered immediately.
1390
- * @permissionScope Manage Orders
1391
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1392
- * @permissionScope Read Orders
1393
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1394
- * @permissionScope Manage Events
1395
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1396
- * @permissionId PRICING_PLANS.READ_ORDERS
1397
- * @webhook
1398
- * @eventType wix.pricing_plans.v2.order_canceled
1399
- * @serviceIdentifier com.wixpress.membership.v2.orders.member.MemberOrdersService
1400
- * @slug canceled
1401
- */
1402
- export declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1403
- export interface OrderCreatedEnvelope {
1404
- entity: Order;
1405
- metadata: EventMetadata;
1406
- }
1407
- /**
1408
- * Triggered when an order is created.
1409
- * @permissionScope Manage Orders
1410
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1411
- * @permissionScope Read Orders
1412
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1413
- * @permissionScope Manage Events
1414
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1415
- * @permissionId PRICING_PLANS.READ_ORDERS
1416
- * @webhook
1417
- * @eventType wix.pricing_plans.v2.order_created
1418
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1419
- * @slug created
1420
- */
1421
- export declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1422
- export interface OrderStartDateChangedEnvelope {
1423
- data: OrderStartDateChanged;
1424
- metadata: EventMetadata;
1425
- }
1426
- /**
1427
- * Triggered when an order's `startDate` is changed.
1428
- * @permissionScope Manage Orders
1429
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1430
- * @permissionScope Read Orders
1431
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1432
- * @permissionScope Manage Events
1433
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1434
- * @permissionId PRICING_PLANS.READ_ORDERS
1435
- * @webhook
1436
- * @eventType wix.pricing_plans.v2.order_start_date_changed
1437
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1438
- * @slug start_date_changed
1439
- */
1440
- export declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
1441
- export interface OrderUpdatedEnvelope {
1442
- entity: Order;
1644
+ export interface OrderAutoRenewCanceledEnvelope {
1645
+ data: OrderAutoRenewCanceled;
1443
1646
  metadata: EventMetadata;
1444
1647
  }
1445
1648
  /**
1446
- * Triggered for any of the following update events:
1649
+ * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1447
1650
  *
1448
- * + Order is paid for. Order Purchased is also triggered.
1449
- * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
1450
- * + New payment cycle of an order starts. Order Cycle Started is also triggered.
1451
- * + Offline order is marked as paid. Order Marked As Paid is also triggered.
1452
- * + End date of the order is postponed. Order End Date Postponed is also triggered
1453
- * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
1454
- * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
1651
+ * This webhook is *not* triggered in the following scenarios:
1652
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1653
+ * + When an order expires at the end of the current payment cycle because it was canceled and `effectiveAt` was set to `NEXT_PAYMENT_DATE`. Instead, at the time of expiration, Order Canceled and Order Ended are triggered.
1455
1654
  * @permissionScope Manage Orders
1456
1655
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1457
1656
  * @permissionScope Read Orders
@@ -1460,21 +1659,21 @@ export interface OrderUpdatedEnvelope {
1460
1659
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1461
1660
  * @permissionId PRICING_PLANS.READ_ORDERS
1462
1661
  * @webhook
1463
- * @eventType wix.pricing_plans.v2.order_updated
1464
- * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1465
- * @slug updated
1662
+ * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1663
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1664
+ * @slug auto_renew_canceled
1466
1665
  */
1467
- export declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1468
- export interface OrderAutoRenewCanceledEnvelope {
1469
- data: OrderAutoRenewCanceled;
1666
+ export declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1667
+ export interface OrderCanceledEnvelope {
1668
+ data: OrderCanceled;
1470
1669
  metadata: EventMetadata;
1471
1670
  }
1472
1671
  /**
1473
- * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1672
+ * Triggered when an order is canceled.
1474
1673
  *
1475
- * This webhook is *not* triggered in the following scenarios:
1476
- * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1477
- * + When an order expires at the end of the current payment cycle because it was canceled and `effectiveAt` was set to `NEXT_PAYMENT_DATE`. Instead, at the time of expiration, Order Canceled and Order Ended are triggered.
1674
+ * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1675
+ * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1676
+ * + If the order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`, the webhook is triggered at the end of the current payment cycle. In this case, the Order Auto Renew Canceled Webhook is triggered immediately.
1478
1677
  * @permissionScope Manage Orders
1479
1678
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1480
1679
  * @permissionScope Read Orders
@@ -1483,11 +1682,11 @@ export interface OrderAutoRenewCanceledEnvelope {
1483
1682
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1484
1683
  * @permissionId PRICING_PLANS.READ_ORDERS
1485
1684
  * @webhook
1486
- * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1685
+ * @eventType wix.pricing_plans.v2.order_canceled
1487
1686
  * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1488
- * @slug auto_renew_canceled
1687
+ * @slug canceled
1489
1688
  */
1490
- export declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1689
+ export declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1491
1690
  export interface OrderCycleStartedEnvelope {
1492
1691
  data: OrderCycleStarted;
1493
1692
  metadata: EventMetadata;
@@ -1620,36 +1819,297 @@ export interface OrderResumedEnvelope {
1620
1819
  * Triggered when a paused order is resumed.
1621
1820
  * @permissionScope Manage Orders
1622
1821
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1623
- * @permissionScope Read Orders
1624
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1625
- * @permissionScope Manage Events
1626
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1627
- * @permissionId PRICING_PLANS.READ_ORDERS
1628
- * @webhook
1629
- * @eventType wix.pricing_plans.v2.order_resumed
1630
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1631
- * @slug resumed
1822
+ * @permissionScope Read Orders
1823
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1824
+ * @permissionScope Manage Events
1825
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1826
+ * @permissionId PRICING_PLANS.READ_ORDERS
1827
+ * @webhook
1828
+ * @eventType wix.pricing_plans.v2.order_resumed
1829
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1830
+ * @slug resumed
1831
+ */
1832
+ export declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
1833
+ export interface OrderStartedEnvelope {
1834
+ data: OrderStarted;
1835
+ metadata: EventMetadata;
1836
+ }
1837
+ /**
1838
+ * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
1839
+ * @permissionScope Manage Orders
1840
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1841
+ * @permissionScope Read Orders
1842
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1843
+ * @permissionScope Manage Events
1844
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1845
+ * @permissionId PRICING_PLANS.READ_ORDERS
1846
+ * @webhook
1847
+ * @eventType wix.pricing_plans.v2.order_started
1848
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1849
+ * @slug started
1850
+ */
1851
+ export declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
1852
+ export interface OrderUpdatedEnvelope {
1853
+ entity: Order;
1854
+ metadata: EventMetadata;
1855
+ }
1856
+ /**
1857
+ * Triggered for any of the following update events:
1858
+ *
1859
+ * + Order is paid for. Order Purchased is also triggered.
1860
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
1861
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
1862
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
1863
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
1864
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
1865
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
1866
+ * @permissionScope Manage Orders
1867
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1868
+ * @permissionScope Read Orders
1869
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1870
+ * @permissionScope Manage Events
1871
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1872
+ * @permissionId PRICING_PLANS.READ_ORDERS
1873
+ * @webhook
1874
+ * @eventType wix.pricing_plans.v2.order_updated
1875
+ * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1876
+ * @slug updated
1877
+ */
1878
+ export declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1879
+ export interface OrderCreatedEnvelope {
1880
+ entity: Order;
1881
+ metadata: EventMetadata;
1882
+ }
1883
+ /**
1884
+ * Triggered when an order is created.
1885
+ * @permissionScope Manage Orders
1886
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1887
+ * @permissionScope Read Orders
1888
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1889
+ * @permissionScope Manage Events
1890
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1891
+ * @permissionId PRICING_PLANS.READ_ORDERS
1892
+ * @webhook
1893
+ * @eventType wix.pricing_plans.v2.order_created
1894
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1895
+ * @slug created
1896
+ */
1897
+ export declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1898
+ export interface OrderStartDateChangedEnvelope {
1899
+ data: OrderStartDateChanged;
1900
+ metadata: EventMetadata;
1901
+ }
1902
+ /**
1903
+ * Triggered when an order's `startDate` is changed.
1904
+ * @permissionScope Manage Orders
1905
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1906
+ * @permissionScope Read Orders
1907
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1908
+ * @permissionScope Manage Events
1909
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1910
+ * @permissionId PRICING_PLANS.READ_ORDERS
1911
+ * @webhook
1912
+ * @eventType wix.pricing_plans.v2.order_start_date_changed
1913
+ * @serviceIdentifier com.wixpress.membership.v2.orders.CheckoutService
1914
+ * @slug start_date_changed
1915
+ */
1916
+ export declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
1917
+ /**
1918
+ * Retrieves an order by ID.
1919
+ * @param _id - Order ID.
1920
+ * @public
1921
+ * @requiredField _id
1922
+ * @param options - Options to use when getting an order.
1923
+ * @permissionId PRICING_PLANS.READ_ORDERS
1924
+ * @permissionScope Manage Orders
1925
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1926
+ * @permissionScope Read Orders
1927
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1928
+ * @permissionScope Manage Events
1929
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1930
+ * @applicableIdentity APP
1931
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
1932
+ */
1933
+ export declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
1934
+ export interface ManagementGetOrderOptions {
1935
+ /**
1936
+ * Predefined set of fields to return.
1937
+ *
1938
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1939
+ */
1940
+ fieldSet?: Set;
1941
+ }
1942
+ /**
1943
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
1944
+ *
1945
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
1946
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
1947
+ * @public
1948
+ * @param options - Filtering, sorting, and pagination options.
1949
+ * @permissionId PRICING_PLANS.READ_ORDERS
1950
+ * @permissionScope Manage Orders
1951
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1952
+ * @permissionScope Read Orders
1953
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1954
+ * @permissionScope Manage Events
1955
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1956
+ * @applicableIdentity APP
1957
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
1958
+ */
1959
+ export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
1960
+ export interface ManagementListOrdersOptions {
1961
+ /**
1962
+ * Filter by a buyer's member ID, from the Members API.
1963
+ * @format GUID
1964
+ */
1965
+ buyerIds?: string[];
1966
+ /**
1967
+ * Filter by plan IDs, from the Plans API.
1968
+ * @format GUID
1969
+ */
1970
+ planIds?: string[];
1971
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1972
+ autoRenewCanceled?: boolean | null;
1973
+ /** Filter by order status. */
1974
+ orderStatuses?: OrderStatus[];
1975
+ /** Filter by payment status. */
1976
+ paymentStatuses?: PaymentStatus[];
1977
+ /**
1978
+ * Number of orders to return. See Sorting and Paging for more information.
1979
+ *
1980
+ * Max: `50`
1981
+ * @min 1
1982
+ * @max 50
1983
+ */
1984
+ limit?: number | null;
1985
+ /** Number of orders to skip in the current sort order. */
1986
+ offset?: number | null;
1987
+ /**
1988
+ * Sort order.
1989
+ *
1990
+ * Use `ASC` for ascending order or `DESC` for descending order.
1991
+ *
1992
+ * Default: `DESC`.
1993
+ */
1994
+ sorting?: Sorting;
1995
+ /**
1996
+ * Predefined set of fields to return.
1997
+ *
1998
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1999
+ */
2000
+ fieldSet?: Set;
2001
+ }
2002
+ /**
2003
+ * Extends the duration of a pricing plan order by postponing the order's `endDate`. Postponing the end date of an order does not impact payments.
2004
+ *
2005
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
2006
+ * Can't postpone an order with `status`: `PAUSED`.
2007
+ * @param _id - Order ID.
2008
+ * @param endDate - New end date and time.
2009
+ *
2010
+ * Must be later than the current end date and time.
2011
+ * @public
2012
+ * @requiredField _id
2013
+ * @requiredField endDate
2014
+ * @param options - Options for postponing the end date of an order.
2015
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2016
+ * @permissionScope Manage Orders
2017
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2018
+ * @applicableIdentity APP
2019
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2020
+ */
2021
+ export declare function postponeEndDate(_id: string, endDate: Date | null): Promise<void>;
2022
+ /**
2023
+ * Cancels an existing order.
2024
+ *
2025
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2026
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2027
+ *
2028
+ * #### Canceling during the free trial period.
2029
+ *
2030
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2031
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2032
+ * of the free trial period.
2033
+ *
2034
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2035
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2036
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2037
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2038
+ * Then, the subscription ends and the buyer is not billed.
2039
+ * @param _id - Order ID.
2040
+ * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2041
+ * @public
2042
+ * @requiredField _id
2043
+ * @requiredField effectiveAt
2044
+ * @param options - Options for canceling orders.
2045
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2046
+ * @permissionScope Manage Orders
2047
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2048
+ * @applicableIdentity APP
2049
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2050
+ */
2051
+ export declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
2052
+ /**
2053
+ * Marks an offline order as paid.
2054
+ * > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
2055
+ *
2056
+ * Marking an offline order as paid causes the following changes:
2057
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
2058
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2059
+ *
2060
+ * An error occurs if you attempt to:
2061
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2062
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2063
+ * @param _id - Order ID.
2064
+ * @public
2065
+ * @requiredField _id
2066
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2067
+ * @permissionScope Manage Orders
2068
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2069
+ * @applicableIdentity APP
2070
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2071
+ */
2072
+ export declare function markAsPaid(_id: string): Promise<void>;
2073
+ /**
2074
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2075
+ *
2076
+ * Only orders with `status`: `ACTIVE` can be paused.
2077
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2078
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2079
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2080
+ *
2081
+ * To resume a paused order, call Resume Order.
2082
+ * @param _id - Order ID.
2083
+ * @public
2084
+ * @requiredField _id
2085
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2086
+ * @permissionScope Manage Orders
2087
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2088
+ * @applicableIdentity APP
2089
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
1632
2090
  */
1633
- export declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
1634
- export interface OrderStartedEnvelope {
1635
- data: OrderStarted;
1636
- metadata: EventMetadata;
1637
- }
2091
+ export declare function pauseOrder(_id: string): Promise<void>;
1638
2092
  /**
1639
- * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
2093
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2094
+ *
2095
+ * Resuming an order causes the following changes:
2096
+ * - The order status changes to `"ACTIVE"`.
2097
+ * - The `pausePeriods` array is updated.
2098
+ * - The `endDate` for the order is adjusted to include the pause period.
2099
+ * - For orders with recurring payments, the payment schedule is restarted.
2100
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2101
+ *
2102
+ * To pause an order, call Pause Order.
2103
+ * @param _id - Order ID.
2104
+ * @public
2105
+ * @requiredField _id
2106
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1640
2107
  * @permissionScope Manage Orders
1641
2108
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1642
- * @permissionScope Read Orders
1643
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1644
- * @permissionScope Manage Events
1645
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1646
- * @permissionId PRICING_PLANS.READ_ORDERS
1647
- * @webhook
1648
- * @eventType wix.pricing_plans.v2.order_started
1649
- * @serviceIdentifier com.wixpress.membership.v2.orders.OrderManagementService
1650
- * @slug started
2109
+ * @applicableIdentity APP
2110
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
1651
2111
  */
1652
- export declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
2112
+ export declare function resumeOrder(_id: string): Promise<void>;
1653
2113
  /**
1654
2114
  * Retrieves an order for the currently logged-in member by ID.
1655
2115
  * @param _id - Order ID.
@@ -1680,7 +2140,10 @@ export interface MemberGetOrderOptions {
1680
2140
  */
1681
2141
  export declare function memberListOrders(options?: MemberListOrdersOptions): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
1682
2142
  export interface MemberListOrdersOptions {
1683
- /** Filter by plan IDs. */
2143
+ /**
2144
+ * Filter by plan IDs.
2145
+ * @format GUID
2146
+ */
1684
2147
  planIds?: string[];
1685
2148
  /** Filter for orders where auto renewal was canceled. */
1686
2149
  autoRenewCanceled?: boolean | null;
@@ -1688,7 +2151,11 @@ export interface MemberListOrdersOptions {
1688
2151
  orderStatuses?: OrderStatus[];
1689
2152
  /** Filter by payment status. */
1690
2153
  paymentStatuses?: PaymentStatus[];
1691
- /** Limit the number of pricing plans returned. Default limit is 50. */
2154
+ /**
2155
+ * Limit the number of pricing plans returned. Default limit is 50.
2156
+ * @min 1
2157
+ * @max 50
2158
+ */
1692
2159
  limit?: number | null;
1693
2160
  /** Number of entries to offset. */
1694
2161
  offset?: number | null;
@@ -1741,11 +2208,18 @@ export interface CreateOnlineOrderOptions {
1741
2208
  * Default: Current date and time.
1742
2209
  */
1743
2210
  startDate?: Date | null;
1744
- /** Coupon code to apply. */
2211
+ /**
2212
+ * Coupon code to apply.
2213
+ * @minLength 1
2214
+ * @maxLength 20
2215
+ */
1745
2216
  couponCode?: string | null;
1746
2217
  /** Provided if checkout is initiated on buyer's behalf. */
1747
2218
  onBehalf?: OnBehalf;
1748
- /** Submission ID of the form submitted with this order. */
2219
+ /**
2220
+ * Submission ID of the form submitted with this order.
2221
+ * @format GUID
2222
+ */
1749
2223
  submissionId?: string | null;
1750
2224
  }
1751
2225
  /**
@@ -1792,9 +2266,16 @@ export interface CreateOfflineOrderOptions {
1792
2266
  * Default: `false`
1793
2267
  */
1794
2268
  paid?: boolean | null;
1795
- /** Coupon code to apply, from the Coupons API. */
2269
+ /**
2270
+ * Coupon code to apply, from the Coupons API.
2271
+ * @minLength 1
2272
+ * @maxLength 20
2273
+ */
1796
2274
  couponCode?: string | null;
1797
- /** Form submission ID that was submitted with the order. */
2275
+ /**
2276
+ * Form submission ID that was submitted with the order.
2277
+ * @format GUID
2278
+ */
1798
2279
  submissionId?: string | null;
1799
2280
  }
1800
2281
  /**
@@ -1811,12 +2292,16 @@ export interface CreateOfflineOrderOptions {
1811
2292
  * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1812
2293
  * @permissionScope Manage Events
1813
2294
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2295
+ * @permissionScope Manage Challenges
2296
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1814
2297
  * @permissionScope Manage Portfolio
1815
2298
  * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
1816
2299
  * @permissionScope Access Verticals by Automations
1817
2300
  * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
1818
2301
  * @permissionScope Manage Restaurants - all permissions
1819
2302
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2303
+ * @permissionScope Set Up Automations
2304
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1820
2305
  * @applicableIdentity APP
1821
2306
  * @applicableIdentity MEMBER
1822
2307
  * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetOnlineOrderPreview
@@ -1829,7 +2314,11 @@ export interface GetOnlineOrderPreviewOptions {
1829
2314
  * Default: Current date and time.
1830
2315
  */
1831
2316
  startDate?: Date | null;
1832
- /** Coupon code to apply. */
2317
+ /**
2318
+ * Coupon code to apply.
2319
+ * @minLength 1
2320
+ * @maxLength 20
2321
+ */
1833
2322
  couponCode?: string | null;
1834
2323
  }
1835
2324
  /**
@@ -1864,7 +2353,11 @@ export interface GetOfflineOrderPreviewOptions {
1864
2353
  * Default: Current date and time.
1865
2354
  */
1866
2355
  startDate?: Date | null;
1867
- /** Coupon code to apply, from the Coupons API. */
2356
+ /**
2357
+ * Coupon code to apply, from the Coupons API.
2358
+ * @minLength 1
2359
+ * @maxLength 20
2360
+ */
1868
2361
  couponCode?: string | null;
1869
2362
  }
1870
2363
  /**
@@ -1891,6 +2384,8 @@ export interface GetOfflineOrderPreviewOptions {
1891
2384
  * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1892
2385
  * @permissionScope Manage Events
1893
2386
  * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
2387
+ * @permissionScope Manage Challenges
2388
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
1894
2389
  * @permissionScope Manage Portfolio
1895
2390
  * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
1896
2391
  * @permissionScope Access Verticals by Automations
@@ -1899,201 +2394,19 @@ export interface GetOfflineOrderPreviewOptions {
1899
2394
  * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1900
2395
  * @permissionScope Manage Restaurants - all permissions
1901
2396
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
2397
+ * @permissionScope Set Up Automations
2398
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
1902
2399
  * @applicableIdentity APP
1903
2400
  * @applicableIdentity VISITOR
1904
2401
  * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetPricePreview
1905
2402
  */
1906
2403
  export declare function getPricePreview(planId: string, options?: GetPricePreviewOptions): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
1907
2404
  export interface GetPricePreviewOptions {
1908
- /** Coupon code to apply, from the Coupons API. */
1909
- couponCode?: string | null;
1910
- }
1911
- /**
1912
- * Retrieves an order by ID.
1913
- * @param _id - Order ID.
1914
- * @public
1915
- * @requiredField _id
1916
- * @param options - Options to use when getting an order.
1917
- * @permissionId PRICING_PLANS.READ_ORDERS
1918
- * @permissionScope Manage Orders
1919
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1920
- * @permissionScope Read Orders
1921
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1922
- * @permissionScope Manage Events
1923
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1924
- * @applicableIdentity APP
1925
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
1926
- */
1927
- export declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
1928
- export interface ManagementGetOrderOptions {
1929
- /**
1930
- * Predefined set of fields to return.
1931
- *
1932
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
1933
- */
1934
- fieldSet?: Set;
1935
- }
1936
- /**
1937
- * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
1938
- *
1939
- * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
1940
- * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
1941
- * @public
1942
- * @param options - Filtering, sorting, and pagination options.
1943
- * @permissionId PRICING_PLANS.READ_ORDERS
1944
- * @permissionScope Manage Orders
1945
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1946
- * @permissionScope Read Orders
1947
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1948
- * @permissionScope Manage Events
1949
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
1950
- * @applicableIdentity APP
1951
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
1952
- */
1953
- export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
1954
- export interface ManagementListOrdersOptions {
1955
- /** Filter by a buyer's member ID, from the Members API. */
1956
- buyerIds?: string[];
1957
- /** Filter by plan IDs, from the Plans API. */
1958
- planIds?: string[];
1959
- /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1960
- autoRenewCanceled?: boolean | null;
1961
- /** Filter by order status. */
1962
- orderStatuses?: OrderStatus[];
1963
- /** Filter by payment status. */
1964
- paymentStatuses?: PaymentStatus[];
1965
- /**
1966
- * Number of orders to return. See Sorting and Paging for more information.
1967
- *
1968
- * Max: `50`
1969
- */
1970
- limit?: number | null;
1971
- /** Number of orders to skip in the current sort order. */
1972
- offset?: number | null;
1973
- /**
1974
- * Sort order.
1975
- *
1976
- * Use `ASC` for ascending order or `DESC` for descending order.
1977
- *
1978
- * Default: `DESC`.
1979
- */
1980
- sorting?: Sorting;
1981
2405
  /**
1982
- * Predefined set of fields to return.
1983
- *
1984
- * Default: If `fieldSet` is omitted, no order form submission data is returned.
2406
+ * Coupon code to apply, from the Coupons API.
2407
+ * @minLength 1
2408
+ * @maxLength 20
1985
2409
  */
1986
- fieldSet?: Set;
2410
+ couponCode?: string | null;
1987
2411
  }
1988
- /**
1989
- * Extends the duration of a pricing plan order by postponing the order's `endDate`. Postponing the end date of an order does not impact payments.
1990
- *
1991
- * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
1992
- * Can't postpone an order with `status`: `PAUSED`.
1993
- * @param _id - Order ID.
1994
- * @param endDate - New end date and time.
1995
- *
1996
- * Must be later than the current end date and time.
1997
- * @public
1998
- * @requiredField _id
1999
- * @requiredField endDate
2000
- * @param options - Options for postponing the end date of an order.
2001
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2002
- * @permissionScope Manage Orders
2003
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2004
- * @applicableIdentity APP
2005
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
2006
- */
2007
- export declare function postponeEndDate(_id: string, endDate: Date | null): Promise<void>;
2008
- /**
2009
- * Cancels an existing order.
2010
- *
2011
- * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
2012
- * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
2013
- *
2014
- * #### Canceling during the free trial period.
2015
- *
2016
- * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
2017
- * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
2018
- * of the free trial period.
2019
- *
2020
- * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
2021
- * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
2022
- * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
2023
- * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
2024
- * Then, the subscription ends and the buyer is not billed.
2025
- * @param _id - Order ID.
2026
- * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
2027
- * @public
2028
- * @requiredField _id
2029
- * @requiredField effectiveAt
2030
- * @param options - Options for canceling orders.
2031
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2032
- * @permissionScope Manage Orders
2033
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2034
- * @applicableIdentity APP
2035
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
2036
- */
2037
- export declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
2038
- /**
2039
- * Marks an offline order as paid.
2040
- * > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
2041
- *
2042
- * Marking an offline order as paid causes the following changes:
2043
- * - The order's `lastPaymentStatus` changes to `"PAID"`.
2044
- * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
2045
- *
2046
- * An error occurs if you attempt to:
2047
- * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
2048
- * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
2049
- * @param _id - Order ID.
2050
- * @public
2051
- * @requiredField _id
2052
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2053
- * @permissionScope Manage Orders
2054
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2055
- * @applicableIdentity APP
2056
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
2057
- */
2058
- export declare function markAsPaid(_id: string): Promise<void>;
2059
- /**
2060
- * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
2061
- *
2062
- * Only orders with `status`: `ACTIVE` can be paused.
2063
- * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
2064
- * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
2065
- * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
2066
- *
2067
- * To resume a paused order, call Resume Order.
2068
- * @param _id - Order ID.
2069
- * @public
2070
- * @requiredField _id
2071
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2072
- * @permissionScope Manage Orders
2073
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2074
- * @applicableIdentity APP
2075
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
2076
- */
2077
- export declare function pauseOrder(_id: string): Promise<void>;
2078
- /**
2079
- * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
2080
- *
2081
- * Resuming an order causes the following changes:
2082
- * - The order status changes to `"ACTIVE"`.
2083
- * - The `pausePeriods` array is updated.
2084
- * - The `endDate` for the order is adjusted to include the pause period.
2085
- * - For orders with recurring payments, the payment schedule is restarted.
2086
- * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2087
- *
2088
- * To pause an order, call Pause Order.
2089
- * @param _id - Order ID.
2090
- * @public
2091
- * @requiredField _id
2092
- * @permissionId PRICING_PLANS.MANAGE_ORDERS
2093
- * @permissionScope Manage Orders
2094
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2095
- * @applicableIdentity APP
2096
- * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2097
- */
2098
- export declare function resumeOrder(_id: string): Promise<void>;
2099
2412
  export {};