@wix/auto_sdk_pricing-plans_orders 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  11. package/build/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
  12. package/build/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  13. package/build/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  14. package/build/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
  15. package/build/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  16. package/build/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  17. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
  18. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  19. package/build/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  20. package/build/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
  21. package/build/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  22. package/build/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
  23. package/build/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
  24. package/build/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  25. package/build/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
  26. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
  27. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  39. package/build/es/src/pricing-plans-v2-order-orders.context.js +111 -0
  40. package/build/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  41. package/build/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  42. package/build/es/src/pricing-plans-v2-order-orders.http.js +859 -0
  43. package/build/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  44. package/build/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  45. package/build/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
  46. package/build/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  47. package/build/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  48. package/build/es/src/pricing-plans-v2-order-orders.public.js +343 -0
  49. package/build/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  50. package/build/es/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
  51. package/build/es/src/pricing-plans-v2-order-orders.types.js +142 -0
  52. package/build/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  53. package/build/es/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
  54. package/build/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
  55. package/build/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  66. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
  67. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  68. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  69. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
  70. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  71. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  72. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
  73. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  74. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  75. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
  76. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  77. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
  78. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
  79. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  80. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
  81. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
  82. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
  93. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js +111 -0
  94. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
  95. package/build/internal/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
  96. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js +859 -0
  97. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
  98. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
  99. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
  100. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
  101. package/build/internal/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
  102. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js +343 -0
  103. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
  104. package/build/internal/es/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
  105. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js +142 -0
  106. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
  107. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
  108. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
  109. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,2015 @@
1
+ /**
2
+ * An order object includes all of the details related to the purchase of a Pricing Plan.
3
+ * You can manage existing orders, create offline orders, and preview orders not yet purchased.
4
+ *
5
+ * Orders are based on pricing models based on the payment and duration cycles for each plan.
6
+ * Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
7
+ */
8
+ export interface Order {
9
+ /**
10
+ * Order ID.
11
+ * @readonly
12
+ */
13
+ _id?: string;
14
+ /**
15
+ * ID of the plan purchased with the order, from the Plans API.
16
+ * @readonly
17
+ */
18
+ planId?: string;
19
+ /**
20
+ * ID of the related Wix subscription.
21
+ *
22
+ * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. Learn more in
23
+ * a [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business).
24
+ * @readonly
25
+ */
26
+ subscriptionId?: string;
27
+ /**
28
+ * Wix Pay order ID.
29
+ *
30
+ * Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
31
+ * @readonly
32
+ */
33
+ wixPayOrderId?: string | null;
34
+ /**
35
+ * The buyer's IDs. Includes `memberId` and `contactId`.
36
+ *
37
+ * Currently, Pricing Plan purchases are limited to members only. `contactId` is returned,
38
+ * but a buyer will not be able to purchase a plan without a `memberId`.
39
+ * @readonly
40
+ */
41
+ buyer?: Buyer;
42
+ /**
43
+ * Order pricing model, price, and payment schedule.
44
+ *
45
+ * Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
46
+ * @readonly
47
+ */
48
+ pricing?: PricingDetails;
49
+ /**
50
+ * How the order was processed.
51
+ * @readonly
52
+ */
53
+ type?: OrderType;
54
+ /**
55
+ * Status of the order.
56
+ * @readonly
57
+ */
58
+ status?: OrderStatus;
59
+ /**
60
+ * Whether the order will be canceled at the next payment date.
61
+ *
62
+ * If `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders.
63
+ * @readonly
64
+ */
65
+ autoRenewCanceled?: boolean | null;
66
+ /**
67
+ * Details about the cancellation of an order.
68
+ *
69
+ * Only present if the status is `CANCELED`.
70
+ * @readonly
71
+ */
72
+ cancellation?: Cancellation;
73
+ /**
74
+ * Status of the last payment for the order.
75
+ * Updated automatically for online orders. Updated manually by the Wix user for offline orders.
76
+ * @readonly
77
+ */
78
+ lastPaymentStatus?: PaymentStatus;
79
+ /**
80
+ * Start date and time for the ordered plan.
81
+ * @readonly
82
+ */
83
+ startDate?: Date | null;
84
+ /**
85
+ * Current end date and time for the ordered plan.
86
+ *
87
+ * `endDate` may be updated over the course of an order.
88
+ * If the order is paused, it will have a later `endDate` once it is resumed.
89
+ * `endDate` may also be postponed.
90
+ *
91
+ * Omitted if the order is valid until canceled and still `ACTIVE`.
92
+ * @readonly
93
+ */
94
+ endDate?: Date | null;
95
+ /**
96
+ * List of periods during which the order is paused.
97
+ * @readonly
98
+ */
99
+ pausePeriods?: PausePeriod[];
100
+ /**
101
+ * Free trial period for the order, in days.
102
+ *
103
+ * Only available for recurring plans.
104
+ * @readonly
105
+ */
106
+ freeTrialDays?: number | null;
107
+ /**
108
+ * Earliest end date and time that the plan for the order can expire.
109
+ *
110
+ * Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
111
+ * @readonly
112
+ */
113
+ earliestEndDate?: Date | null;
114
+ /**
115
+ * Current payment cycle for the order.
116
+ *
117
+ * `currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet.
118
+ * @readonly
119
+ */
120
+ currentCycle?: CurrentCycle;
121
+ /**
122
+ * Plan name at the time of purchase.
123
+ * @readonly
124
+ */
125
+ planName?: string;
126
+ /**
127
+ * Plan description at the time of purchase
128
+ * @readonly
129
+ */
130
+ planDescription?: string;
131
+ /**
132
+ * Plan price as it was at the moment of order creation.
133
+ * @readonly
134
+ */
135
+ planPrice?: string;
136
+ /**
137
+ * Date and time the order was created.
138
+ * @readonly
139
+ */
140
+ _createdDate?: Date | null;
141
+ /**
142
+ * Date and time the order was updated.
143
+ * @readonly
144
+ */
145
+ _updatedDate?: Date | null;
146
+ /**
147
+ * Information about the form submitted during the plan's checkout.
148
+ * @readonly
149
+ */
150
+ formData?: FormData;
151
+ }
152
+ export interface Buyer {
153
+ /**
154
+ * Member ID for a Wix site member, from the Members API.
155
+ * @readonly
156
+ */
157
+ memberId?: string;
158
+ /**
159
+ * Contact ID for a Wix site contact, from the Contacts API.
160
+ * @readonly
161
+ */
162
+ contactId?: string;
163
+ }
164
+ export interface PriceDetails extends PriceDetailsPricingModelOneOf {
165
+ /** Order has recurring payments. */
166
+ subscription?: Recurrence;
167
+ /** One-time payment. Order is valid for a specified duration. */
168
+ singlePaymentForDuration?: Duration;
169
+ /** One-time payment. Order is valid until it is canceled. */
170
+ singlePaymentUnlimited?: boolean | null;
171
+ /** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
172
+ subtotal?: string;
173
+ /** Total discount applied. */
174
+ discount?: string;
175
+ /** Tax applied. */
176
+ tax?: Tax;
177
+ /**
178
+ * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
179
+ *
180
+ * If no tax is applied, the amount is the same as `subtotal`.
181
+ */
182
+ total?: string;
183
+ /** Plan price as it was at the moment of order creation. */
184
+ planPrice?: string;
185
+ /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
186
+ currency?: string;
187
+ /** Free trial period for the order in days. Only available for recurring plans. */
188
+ freeTrialDays?: number | null;
189
+ /** Coupon applied to the order. Empty means no coupon was applied. */
190
+ coupon?: Coupon;
191
+ }
192
+ /** @oneof */
193
+ export interface PriceDetailsPricingModelOneOf {
194
+ /** Order has recurring payments. */
195
+ subscription?: Recurrence;
196
+ /** One-time payment. Order is valid for a specified duration. */
197
+ singlePaymentForDuration?: Duration;
198
+ /** One-time payment. Order is valid until it is canceled. */
199
+ singlePaymentUnlimited?: boolean | null;
200
+ }
201
+ export interface Tax {
202
+ /** Name of the tax. For example, VAT. */
203
+ name?: string;
204
+ /** Whether tax is included in the original price. When `false`, tax is added at checkout. */
205
+ includedInPrice?: boolean;
206
+ /** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
207
+ rate?: string;
208
+ /** Total tax, specified as a monetary amount. For example, `"3.99"`. */
209
+ amount?: string;
210
+ }
211
+ /** An object specifying how often and for how long payments recur (may be forever). */
212
+ export interface Recurrence {
213
+ /**
214
+ * Number of payment cycles the subscription is valid for.
215
+ * `0` for unlimited plans or for plans that are valid until canceled.
216
+ */
217
+ cycleDuration?: Duration;
218
+ /**
219
+ * Length of a payment cycle. For example, 1 month to have monthly payments.
220
+ * Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration.
221
+ * Currently, only a value of `1` is supported.
222
+ */
223
+ cycleCount?: number | null;
224
+ }
225
+ /** A duration expressed in number of time units. */
226
+ export interface Duration {
227
+ /** Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
228
+ count?: number | null;
229
+ /** Unit of time for the cycle duration. */
230
+ unit?: PeriodUnit;
231
+ }
232
+ export declare enum PeriodUnit {
233
+ /** Not defined. */
234
+ UNDEFINED = "UNDEFINED",
235
+ /** Time unit is a day. */
236
+ DAY = "DAY",
237
+ /** Time unit is a week. */
238
+ WEEK = "WEEK",
239
+ /** Time unit is a month. */
240
+ MONTH = "MONTH",
241
+ /** Time unit is a year. */
242
+ YEAR = "YEAR"
243
+ }
244
+ export interface Coupon {
245
+ /** Code of the applied coupon. */
246
+ code?: string;
247
+ /** Total discount of the coupon, as a monetary amount. */
248
+ amount?: string;
249
+ /**
250
+ * Coupon ID.
251
+ * @readonly
252
+ */
253
+ _id?: string;
254
+ }
255
+ export interface PricingDetails extends PricingDetailsPricingModelOneOf {
256
+ /** Pricing model for an order with recurring payment cycles. */
257
+ subscription?: Recurrence;
258
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
259
+ singlePaymentForDuration?: Duration;
260
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
261
+ singlePaymentUnlimited?: boolean | null;
262
+ /**
263
+ * Pricing details for all pricing models.
264
+ * @readonly
265
+ */
266
+ prices?: SpannedPrice[];
267
+ }
268
+ /** @oneof */
269
+ export interface PricingDetailsPricingModelOneOf {
270
+ /** Pricing model for an order with recurring payment cycles. */
271
+ subscription?: Recurrence;
272
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
273
+ singlePaymentForDuration?: Duration;
274
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
275
+ singlePaymentUnlimited?: boolean | null;
276
+ }
277
+ export interface SpannedPrice {
278
+ /**
279
+ * Cycle duration to apply `price` for.
280
+ *
281
+ * Use with all pricing models.
282
+ * Can apply the same price to multiple payment cycles.
283
+ */
284
+ duration?: PriceDuration;
285
+ /** Order price. */
286
+ price?: Price;
287
+ }
288
+ export interface PriceDuration {
289
+ /**
290
+ * Price starts to apply with this cycle.
291
+ *
292
+ * `1` is the first payment cycle for all pricing models.
293
+ */
294
+ cycleFrom?: number;
295
+ /**
296
+ * Amount of cycles to apply price for.
297
+ *
298
+ * For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.
299
+ *
300
+ * For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.
301
+ *
302
+ * For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`.
303
+ */
304
+ numberOfCycles?: number | null;
305
+ }
306
+ export interface Price {
307
+ /** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
308
+ subtotal?: string;
309
+ /** Coupon applied to the order, from the Coupons API. */
310
+ coupon?: Coupon;
311
+ /** Total discount applied to the order. */
312
+ discount?: string;
313
+ /**
314
+ * Tax applied to the order.
315
+ *
316
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
317
+ */
318
+ tax?: Tax;
319
+ /**
320
+ * Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
321
+ *
322
+ * If no tax is applied, the amount is the same as `subtotal`.
323
+ */
324
+ total?: string;
325
+ /**
326
+ * Three-letter currency code in
327
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
328
+ */
329
+ currency?: string;
330
+ /** Price change after billing date was change and price was adjusted. Could be positive and negative values. */
331
+ proration?: string;
332
+ }
333
+ export interface Fee {
334
+ /** Fee name */
335
+ name?: string;
336
+ /** Amount of fee to be charged */
337
+ amount?: string;
338
+ }
339
+ export declare enum OrderType {
340
+ /** Undefined order type. */
341
+ UNDEFINED = "UNDEFINED",
342
+ /** The buyer purchased the plan using the site. */
343
+ ONLINE = "ONLINE",
344
+ /** The buyer made a manual, offline purchase without using the site. */
345
+ OFFLINE = "OFFLINE",
346
+ /** The buyer made a purchase through an external payment provider. */
347
+ EXTERNAL = "EXTERNAL"
348
+ }
349
+ export declare enum OrderMethod {
350
+ /** Unknown order method. */
351
+ UNKNOWN = "UNKNOWN",
352
+ /** Mail Order / Telephone Order transaction. */
353
+ MOTO = "MOTO",
354
+ /** Point of Sale transaction. */
355
+ POS = "POS"
356
+ }
357
+ export declare enum OrderStatus {
358
+ /** Undefined order status. */
359
+ UNDEFINED = "UNDEFINED",
360
+ /** Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer. */
361
+ DRAFT = "DRAFT",
362
+ /** Order has been purchased and its start date is set in the future. */
363
+ PENDING = "PENDING",
364
+ /** Order has been processed. The plan is available for use. */
365
+ ACTIVE = "ACTIVE",
366
+ /** Order, and use of the plan, is paused. The order, and use of the plan, can be resumed. */
367
+ PAUSED = "PAUSED",
368
+ /** Order has completed its duration and is no longer available for use. */
369
+ ENDED = "ENDED",
370
+ /** Order has been canceled. */
371
+ CANCELED = "CANCELED"
372
+ }
373
+ export interface Cancellation {
374
+ /** Date and time the cancellation was requested. */
375
+ requestedDate?: Date | null;
376
+ /** Reason for the cancellation. */
377
+ cause?: CancellationCause;
378
+ /** When the cancellation takes effect. Set when cancelling the order. */
379
+ effectiveAt?: CancellationEffectiveAt;
380
+ }
381
+ export declare enum CancellationCause {
382
+ /** Undefined cancellation cause. */
383
+ UNDEFINED = "UNDEFINED",
384
+ /** Wix user canceled the order. */
385
+ OWNER_ACTION = "OWNER_ACTION",
386
+ /** Buyer initiated the cancellation. */
387
+ MEMBER_ACTION = "MEMBER_ACTION",
388
+ /** Payment transaction failed. */
389
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
390
+ /** Buyer's payment details weren't set up correctly. */
391
+ PAYMENT_SETUP_FAILURE = "PAYMENT_SETUP_FAILURE",
392
+ /** Reason for the cancellation is unknown. */
393
+ UNKNOWN = "UNKNOWN"
394
+ }
395
+ export declare enum CancellationEffectiveAt {
396
+ /** Undefined cancellation time. */
397
+ UNDEFINED = "UNDEFINED",
398
+ /** Cancellation occurs immediately and the buyer can no longer use the plan. */
399
+ IMMEDIATELY = "IMMEDIATELY",
400
+ /** Cancellation occurs at the next payment date and time. Buyer can continue to use the plan until that date and time. */
401
+ NEXT_PAYMENT_DATE = "NEXT_PAYMENT_DATE"
402
+ }
403
+ export declare enum PaymentStatus {
404
+ /** Undefined payment status. */
405
+ UNDEFINED = "UNDEFINED",
406
+ /** Payment has been paid. */
407
+ PAID = "PAID",
408
+ /** Payment has been refunded. */
409
+ REFUNDED = "REFUNDED",
410
+ /** Payment transaction didn't complete. */
411
+ FAILED = "FAILED",
412
+ /** Payment has not been paid. */
413
+ UNPAID = "UNPAID",
414
+ /** Billing has been initialized, but actual charge is yet to be made. This can happen for free trials and payments made with PayPal. */
415
+ PENDING = "PENDING",
416
+ /** No payment was necessary. For example, for free plans or free trials. */
417
+ NOT_APPLICABLE = "NOT_APPLICABLE"
418
+ }
419
+ export interface PausePeriod {
420
+ /** Status of the pause period. */
421
+ status?: Status;
422
+ /** Start date and time of the pause period. */
423
+ pauseDate?: Date | null;
424
+ /**
425
+ * End date and time of the pause period.
426
+ *
427
+ * Omitted while the pause period remains `ACTIVE`.
428
+ */
429
+ resumeDate?: Date | null;
430
+ }
431
+ export declare enum Status {
432
+ /** Undefined status. */
433
+ UNDEFINED = "UNDEFINED",
434
+ /** Status while the order is paused. */
435
+ ACTIVE = "ACTIVE",
436
+ /** Status when the order is resumed. */
437
+ ENDED = "ENDED"
438
+ }
439
+ /**
440
+ * Current cycle will be empty when order is cancelled, expired or order start date is in the future
441
+ * Current cycle start and end dates take into account free trial days and suspensions
442
+ */
443
+ export interface CurrentCycle {
444
+ /**
445
+ * Index of the current payment cycle in the order.
446
+ *
447
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
448
+ */
449
+ index?: number;
450
+ /** Start date and time for the current payment cycle. */
451
+ startedDate?: Date | null;
452
+ /** End date and time for the current payment cycle. */
453
+ endedDate?: Date | null;
454
+ }
455
+ /** Order cycle start and end dates take into account free trial days and suspensions */
456
+ export interface OrderCycle {
457
+ /**
458
+ * Index of this cycle in the order.
459
+ *
460
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
461
+ */
462
+ index?: number;
463
+ /** Start date and time for this order cycle. */
464
+ startedDate?: Date | null;
465
+ /** End date and time for this order cycle. */
466
+ endedDate?: Date | null;
467
+ }
468
+ export interface FormData {
469
+ /** 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. */
470
+ formId?: string | null;
471
+ /** 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. */
472
+ submissionId?: string | null;
473
+ /**
474
+ * Data submitted to the plan's order form at checkout.
475
+ * @readonly
476
+ */
477
+ submissionData?: Record<string, any>;
478
+ }
479
+ export interface DomainEvent extends DomainEventBodyOneOf {
480
+ createdEvent?: EntityCreatedEvent;
481
+ updatedEvent?: EntityUpdatedEvent;
482
+ deletedEvent?: EntityDeletedEvent;
483
+ actionEvent?: ActionEvent;
484
+ /**
485
+ * Unique event ID.
486
+ * Allows clients to ignore duplicate webhooks.
487
+ */
488
+ _id?: string;
489
+ /**
490
+ * Assumes actions are also always typed to an entity_type
491
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
492
+ */
493
+ entityFqdn?: string;
494
+ /**
495
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
496
+ * This is although the created/updated/deleted notion is duplication of the oneof types
497
+ * Example: created/updated/deleted/started/completed/email_opened
498
+ */
499
+ slug?: string;
500
+ /** ID of the entity associated with the event. */
501
+ entityId?: string;
502
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
503
+ eventTime?: Date | null;
504
+ /**
505
+ * Whether the event was triggered as a result of a privacy regulation application
506
+ * (for example, GDPR).
507
+ */
508
+ triggeredByAnonymizeRequest?: boolean | null;
509
+ /** If present, indicates the action that triggered the event. */
510
+ originatedFrom?: string | null;
511
+ /**
512
+ * A sequence number defining the order of updates to the underlying entity.
513
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
514
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
515
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
516
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
517
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
518
+ */
519
+ entityEventSequence?: string | null;
520
+ }
521
+ /** @oneof */
522
+ export interface DomainEventBodyOneOf {
523
+ createdEvent?: EntityCreatedEvent;
524
+ updatedEvent?: EntityUpdatedEvent;
525
+ deletedEvent?: EntityDeletedEvent;
526
+ actionEvent?: ActionEvent;
527
+ }
528
+ export interface EntityCreatedEvent {
529
+ entity?: string;
530
+ }
531
+ export interface RestoreInfo {
532
+ deletedDate?: Date | null;
533
+ }
534
+ export interface EntityUpdatedEvent {
535
+ /**
536
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
537
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
538
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
539
+ */
540
+ currentEntity?: string;
541
+ }
542
+ export interface EntityDeletedEvent {
543
+ /** Entity that was deleted */
544
+ deletedEntity?: string | null;
545
+ }
546
+ export interface ActionEvent {
547
+ body?: string;
548
+ }
549
+ export interface Empty {
550
+ }
551
+ export interface MemberGetOrderRequest {
552
+ /** Order ID. */
553
+ _id: string;
554
+ /**
555
+ * Predefined set of fields to return.
556
+ *
557
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
558
+ */
559
+ fieldSet?: Set;
560
+ }
561
+ export declare enum Set {
562
+ /** Same behavior as `BASIC`.` */
563
+ UNKNOWN_SET = "UNKNOWN_SET",
564
+ /** Doesn't return any order form submission data. */
565
+ BASIC = "BASIC",
566
+ /** Returns all order form submission data. */
567
+ FULL = "FULL"
568
+ }
569
+ export interface MemberGetOrderResponse {
570
+ /** Requested order. */
571
+ order?: Order;
572
+ }
573
+ export interface MemberListOrdersRequest {
574
+ /** Filter by plan IDs. */
575
+ planIds?: string[];
576
+ /** Filter for orders where auto renewal was canceled. */
577
+ autoRenewCanceled?: boolean | null;
578
+ /** Filter by order status. */
579
+ orderStatuses?: OrderStatus[];
580
+ /** Filter by payment status. */
581
+ paymentStatuses?: PaymentStatus[];
582
+ /** Limit the number of pricing plans returned. Default limit is 50. */
583
+ limit?: number | null;
584
+ /** Number of entries to offset. */
585
+ offset?: number | null;
586
+ /** Sorting direction (defaults to ASC) and field to sort by. */
587
+ sorting?: Sorting;
588
+ /**
589
+ * Predefined set of fields to return.
590
+ *
591
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
592
+ */
593
+ fieldSet?: Set;
594
+ }
595
+ export interface Sorting {
596
+ /** Name of the field to sort by. */
597
+ fieldName?: string;
598
+ /** Sort order. */
599
+ order?: SortOrder;
600
+ }
601
+ export declare enum SortOrder {
602
+ ASC = "ASC",
603
+ DESC = "DESC"
604
+ }
605
+ export interface MemberListOrdersResponse {
606
+ /** Requested orders. */
607
+ orders?: Order[];
608
+ /** Object containing paging-related data (number of orders returned, offset). */
609
+ pagingMetadata?: PagingMetadataV2;
610
+ }
611
+ export interface PagingMetadataV2 {
612
+ /** Number of items returned in the response. */
613
+ count?: number | null;
614
+ /** Offset that was requested. */
615
+ offset?: number | null;
616
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
617
+ total?: number | null;
618
+ /** Flag that indicates the server failed to calculate the `total` field. */
619
+ tooManyToCount?: boolean | null;
620
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
621
+ cursors?: Cursors;
622
+ }
623
+ export interface Cursors {
624
+ /** Cursor string pointing to the next page in the list of results. */
625
+ next?: string | null;
626
+ /** Cursor pointing to the previous page in the list of results. */
627
+ prev?: string | null;
628
+ }
629
+ /**
630
+ * TODO: Write orders filter and sort docs page
631
+ * Retrieves a list of up to 1,000 orders, based on the provided paging, sorting, and filtering.
632
+ */
633
+ export interface QueryOrdersRequest {
634
+ /** Query filter. */
635
+ query?: QueryV2;
636
+ }
637
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
638
+ /** Paging options to limit and skip the number of items. */
639
+ paging?: Paging;
640
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
641
+ cursorPaging?: CursorPaging;
642
+ /**
643
+ * Filter object.
644
+ *
645
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
646
+ */
647
+ filter?: Record<string, any> | null;
648
+ /**
649
+ * Sort object.
650
+ *
651
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
652
+ */
653
+ sort?: Sorting[];
654
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
655
+ fields?: string[];
656
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
657
+ fieldsets?: string[];
658
+ }
659
+ /** @oneof */
660
+ export interface QueryV2PagingMethodOneOf {
661
+ /** Paging options to limit and skip the number of items. */
662
+ paging?: Paging;
663
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
664
+ cursorPaging?: CursorPaging;
665
+ }
666
+ export interface Paging {
667
+ /** Number of items to load. */
668
+ limit?: number | null;
669
+ /** Number of items to skip in the current sort order. */
670
+ offset?: number | null;
671
+ }
672
+ export interface CursorPaging {
673
+ /** Maximum number of items to return in the results. */
674
+ limit?: number | null;
675
+ /**
676
+ * Pointer to the next or previous page in the list of results.
677
+ *
678
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
679
+ * Not relevant for the first request.
680
+ */
681
+ cursor?: string | null;
682
+ }
683
+ export interface QueryOrdersResponse {
684
+ /** Order data. */
685
+ plans?: Order[];
686
+ /** Paging-related data (number of orders returned, offset). */
687
+ pagingMetadata?: PagingMetadataV2;
688
+ }
689
+ export interface RequestCancellationRequest {
690
+ /** Order ID. */
691
+ _id: string;
692
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
693
+ effectiveAt: CancellationEffectiveAt;
694
+ }
695
+ export interface RequestCancellationResponse {
696
+ }
697
+ /**
698
+ * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
699
+ *
700
+ * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
701
+ */
702
+ export interface OrderCanceled {
703
+ /** Canceled order. */
704
+ order?: Order;
705
+ }
706
+ export interface MessageEnvelope {
707
+ /** App instance ID. */
708
+ instanceId?: string | null;
709
+ /** Event type. */
710
+ eventType?: string;
711
+ /** The identification type and identity data. */
712
+ identity?: IdentificationData;
713
+ /** Stringify payload. */
714
+ data?: string;
715
+ }
716
+ export interface IdentificationData extends IdentificationDataIdOneOf {
717
+ /** ID of a site visitor that has not logged in to the site. */
718
+ anonymousVisitorId?: string;
719
+ /** ID of a site visitor that has logged in to the site. */
720
+ memberId?: string;
721
+ /** ID of a Wix user (site owner, contributor, etc.). */
722
+ wixUserId?: string;
723
+ /** ID of an app. */
724
+ appId?: string;
725
+ /** @readonly */
726
+ identityType?: WebhookIdentityType;
727
+ }
728
+ /** @oneof */
729
+ export interface IdentificationDataIdOneOf {
730
+ /** ID of a site visitor that has not logged in to the site. */
731
+ anonymousVisitorId?: string;
732
+ /** ID of a site visitor that has logged in to the site. */
733
+ memberId?: string;
734
+ /** ID of a Wix user (site owner, contributor, etc.). */
735
+ wixUserId?: string;
736
+ /** ID of an app. */
737
+ appId?: string;
738
+ }
739
+ export declare enum WebhookIdentityType {
740
+ UNKNOWN = "UNKNOWN",
741
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
742
+ MEMBER = "MEMBER",
743
+ WIX_USER = "WIX_USER",
744
+ APP = "APP"
745
+ }
746
+ export interface CreateOnlineOrderRequest {
747
+ /** Plan ID. */
748
+ planId: string;
749
+ /**
750
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
751
+ *
752
+ * Default: Current date and time.
753
+ */
754
+ startDate?: Date | null;
755
+ /** Coupon code to apply. */
756
+ couponCode?: string | null;
757
+ /** Provided if checkout is initiated on buyer's behalf. */
758
+ onBehalf?: OnBehalf;
759
+ /** Submission ID of the form submitted with this order. */
760
+ submissionId?: string | null;
761
+ }
762
+ export interface OnBehalf {
763
+ /** Member ID. */
764
+ memberId?: string;
765
+ /** Method by which checkout is initiated. */
766
+ orderMethod?: OrderMethod;
767
+ }
768
+ export interface CreateOnlineOrderResponse {
769
+ /** Created online order. */
770
+ order?: Order;
771
+ }
772
+ export interface CouponsError {
773
+ /** Coupon code. */
774
+ couponCode?: string;
775
+ /** Plan ID. */
776
+ planId?: string;
777
+ }
778
+ export interface CreateGuestOnlineOrderRequest {
779
+ /** Plan ID. */
780
+ planId?: string;
781
+ /**
782
+ * Start date for the ordered plan.
783
+ *
784
+ * Default: Current date
785
+ */
786
+ startDate?: Date | null;
787
+ /** Coupon code to apply. */
788
+ couponCode?: string | null;
789
+ /** Captcha data to prove you are not a robot */
790
+ captcha?: Captcha;
791
+ /** Visitor info */
792
+ guest?: Guest;
793
+ /** Form submission id that was submitted together with the order */
794
+ submissionId?: string | null;
795
+ }
796
+ export interface Captcha {
797
+ /** Token from captcha */
798
+ token?: string;
799
+ }
800
+ export interface Guest {
801
+ /** Email for checkout */
802
+ email?: string;
803
+ }
804
+ export interface CreateGuestOnlineOrderResponse {
805
+ /** Order. */
806
+ order?: Order;
807
+ }
808
+ export interface CreateOfflineOrderRequest {
809
+ /** ID of the plan being ordered, from the Plans API. */
810
+ planId: string;
811
+ /** ID of the member ordering the plan, from the Members API. */
812
+ memberId: string;
813
+ /**
814
+ * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
815
+ *
816
+ * Default: Current date and time.
817
+ */
818
+ startDate?: Date | null;
819
+ /**
820
+ * Whether the order is paid.
821
+ *
822
+ * Default: `false`
823
+ */
824
+ paid?: boolean | null;
825
+ /** Coupon code to apply, from the Coupons API. */
826
+ couponCode?: string | null;
827
+ /** Form submission ID that was submitted with the order. */
828
+ submissionId?: string | null;
829
+ }
830
+ export interface CreateOfflineOrderResponse {
831
+ /** Order. */
832
+ order?: Order;
833
+ }
834
+ export interface CreateExternalOrderRequest {
835
+ /** Plan ID. */
836
+ planId?: string;
837
+ /** Form submission id that was submitted together with the order */
838
+ submissionId?: string | null;
839
+ }
840
+ export interface CreateExternalOrderResponse {
841
+ /** Created order */
842
+ order?: Order;
843
+ }
844
+ export interface GetOnlineOrderPreviewRequest {
845
+ /** Plan ID. */
846
+ planId: string;
847
+ /**
848
+ * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
849
+ *
850
+ * Default: Current date and time.
851
+ */
852
+ startDate?: Date | null;
853
+ /** Coupon code to apply. */
854
+ couponCode?: string | null;
855
+ }
856
+ export interface GetOnlineOrderPreviewResponse {
857
+ /** Order preview. This field is undefined if the member has already reached the purchase limit for the order's plan. */
858
+ order?: Order;
859
+ /** Whether the member has already reached purchase limit for the order's plan. */
860
+ purchaseLimitExceeded?: boolean;
861
+ }
862
+ export interface GetGuestOnlineOrderPreviewRequest {
863
+ /** Plan ID. */
864
+ planId?: string;
865
+ /**
866
+ * Start date for the ordered plan.
867
+ *
868
+ * Default: Current date
869
+ */
870
+ startDate?: Date | null;
871
+ /** Coupon code to apply. */
872
+ couponCode?: string | null;
873
+ /** Email for checkout */
874
+ email?: string;
875
+ }
876
+ export interface GetGuestOnlineOrderPreviewResponse {
877
+ /** Will be missing if limit is exceeded */
878
+ order?: Order;
879
+ /**
880
+ * Whether the purchase limit has already been reached for this plan by this email.
881
+ * Always false for plans without purchase limits.
882
+ */
883
+ purchaseLimitExceeded?: boolean;
884
+ }
885
+ export interface GetOfflineOrderPreviewRequest {
886
+ /** ID of the plan of the previewed order, from the Plans API. */
887
+ planId: string;
888
+ /** Member ID of the buyer the previewed order is for, from the Members API. */
889
+ memberId: string;
890
+ /**
891
+ * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
892
+ *
893
+ * Default: Current date and time.
894
+ */
895
+ startDate?: Date | null;
896
+ /** Coupon code to apply, from the Coupons API. */
897
+ couponCode?: string | null;
898
+ }
899
+ export interface GetOfflineOrderPreviewResponse {
900
+ /** The previewed order, as if the plan had been ordered. */
901
+ order?: Order;
902
+ /**
903
+ * Whether this previewed order would exceed the permitted amount of purchases available
904
+ * for this plan for this buyer.
905
+ *
906
+ * Always `false` for plans that do not have purchase limits.
907
+ */
908
+ purchaseLimitExceeded?: boolean;
909
+ }
910
+ export interface GetPricePreviewRequest {
911
+ /** ID of plan to preview. */
912
+ planId: string;
913
+ /** Coupon code to apply, from the Coupons API. */
914
+ couponCode?: string | null;
915
+ }
916
+ export interface GetPricePreviewResponse {
917
+ /** Pricing details. */
918
+ prices?: SpannedPrice[];
919
+ }
920
+ export interface ChangeStartDateRequest {
921
+ /** Draft order ID. */
922
+ orderId?: string;
923
+ /** New valid from date (timestamp). */
924
+ startDate?: Date | null;
925
+ }
926
+ export interface ChangeStartDateResponse {
927
+ /** Updated draft order. */
928
+ order?: Order;
929
+ }
930
+ export interface OrderStartDateChanged {
931
+ /** Order whose `startDate` changed. */
932
+ order?: Order;
933
+ }
934
+ export interface ApplyCouponRequest {
935
+ /** Draft order ID. */
936
+ orderId?: string;
937
+ /** Coupon code to apply. */
938
+ couponCode?: string;
939
+ }
940
+ export interface ApplyCouponResponse {
941
+ /** Order with applied coupon and recalculated tax. */
942
+ order?: Order;
943
+ }
944
+ export interface SetSubmissionRequest {
945
+ /** Order ID. */
946
+ orderId?: string;
947
+ /** Submission ID. */
948
+ submissionId?: string;
949
+ }
950
+ export interface SetSubmissionResponse {
951
+ /** Order with submission id */
952
+ order?: Order;
953
+ }
954
+ export interface OrderPurchased {
955
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
956
+ order?: Order;
957
+ }
958
+ export interface OrderStarted {
959
+ /** Order that reached its `startDate`. */
960
+ order?: Order;
961
+ }
962
+ /**
963
+ * Triggered at the start of a new payment cycle for an existing order.
964
+ *
965
+ * This webhook does not trigger at the initial start of an offline order.
966
+ */
967
+ export interface OrderCycleStarted {
968
+ /** Order whose new cycle started. */
969
+ order?: Order;
970
+ /** 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. */
971
+ cycleNumber?: number;
972
+ }
973
+ /** Emitted when a recurring order is canceled for the next payment cycle */
974
+ export interface OrderAutoRenewCanceled {
975
+ /** Order that is canceled, effective at the end of the current payment cycle. */
976
+ order?: Order;
977
+ }
978
+ export interface OrderEnded {
979
+ /** Order that ended. */
980
+ order?: Order;
981
+ }
982
+ export interface GetOrderRequest {
983
+ /** Order ID. */
984
+ _id: string;
985
+ /**
986
+ * Predefined set of fields to return.
987
+ *
988
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
989
+ */
990
+ fieldSet?: Set;
991
+ }
992
+ export interface GetOrderResponse {
993
+ /** Order. */
994
+ order?: Order;
995
+ }
996
+ export interface ListOrdersRequest {
997
+ /** Filter by a buyer's member ID, from the Members API. */
998
+ buyerIds?: string[];
999
+ /** Filter by plan IDs, from the Plans API. */
1000
+ planIds?: string[];
1001
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1002
+ autoRenewCanceled?: boolean | null;
1003
+ /** Filter by order status. */
1004
+ orderStatuses?: OrderStatus[];
1005
+ /** Filter by payment status. */
1006
+ paymentStatuses?: PaymentStatus[];
1007
+ /**
1008
+ * Number of orders to return. See Sorting and Paging for more information.
1009
+ *
1010
+ * Max: `50`
1011
+ */
1012
+ limit?: number | null;
1013
+ /** Number of orders to skip in the current sort order. */
1014
+ offset?: number | null;
1015
+ /**
1016
+ * Sort order.
1017
+ *
1018
+ * Use `ASC` for ascending order or `DESC` for descending order.
1019
+ *
1020
+ * Default: `DESC`.
1021
+ */
1022
+ sorting?: Sorting;
1023
+ /**
1024
+ * Predefined set of fields to return.
1025
+ *
1026
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1027
+ */
1028
+ fieldSet?: Set;
1029
+ }
1030
+ export interface ListOrdersResponse {
1031
+ /** List of orders. */
1032
+ orders?: Order[];
1033
+ /** Object containing paging-related data (number of orders returned, offset). */
1034
+ pagingMetadata?: PagingMetadataV2;
1035
+ }
1036
+ export interface OrdersQueryOrdersRequest {
1037
+ /** Query filter. */
1038
+ query?: QueryV2;
1039
+ }
1040
+ export interface OrdersQueryOrdersResponse {
1041
+ /** Retrieved orders. */
1042
+ plans?: Order[];
1043
+ /** Paging-related data (number of orders returned, offset). */
1044
+ pagingMetadata?: PagingMetadataV2;
1045
+ }
1046
+ export interface GetOrdersStatsRequest {
1047
+ }
1048
+ export interface GetOrdersStatsResponse {
1049
+ /** Total number of orders. */
1050
+ totalOrderCount?: number;
1051
+ /** Number of active orders. */
1052
+ activeOrderCount?: number;
1053
+ }
1054
+ export interface GetAvailableOrderActionsRequest {
1055
+ /** Order ID. */
1056
+ _id?: string;
1057
+ }
1058
+ export interface GetAvailableOrderActionsResponse {
1059
+ /** Whether the order can be suspended. */
1060
+ suspendable?: boolean;
1061
+ /** If the order cannot be suspended, a reason is returned here. */
1062
+ notSuspendableReason?: ReasonNotSuspendable;
1063
+ /** Whether the order can be canceled by the buyer. */
1064
+ cancelableByBuyer?: boolean;
1065
+ }
1066
+ export declare enum ReasonNotSuspendable {
1067
+ /** Undefined reason. */
1068
+ UNDEFINED = "UNDEFINED",
1069
+ /** Saved in the database but is awaiting payment. Non-active orders can't be suspended. */
1070
+ PENDING = "PENDING",
1071
+ /** Trial orders can't be suspended. */
1072
+ TRIAL = "TRIAL",
1073
+ /** Canceled orders can't be suspended. */
1074
+ CANCELED = "CANCELED",
1075
+ /** Ended orders can't be suspended. */
1076
+ ENDED = "ENDED",
1077
+ /** Paid for orders with future start dates can't be suspended. */
1078
+ NOT_STARTED = "NOT_STARTED",
1079
+ /** Order is already suspended. */
1080
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1081
+ /** Orders based on recurring payments using older stripe versions can't be suspended. */
1082
+ OLD_STRIPE = "OLD_STRIPE"
1083
+ }
1084
+ export interface PostponeEndDateRequest {
1085
+ /** Order ID. */
1086
+ _id: string;
1087
+ /**
1088
+ * New end date and time.
1089
+ *
1090
+ * Must be later than the current end date and time.
1091
+ */
1092
+ endDate: Date | null;
1093
+ }
1094
+ export interface PostponeEndDateResponse {
1095
+ }
1096
+ export interface OrderEndDatePostponed {
1097
+ /** Order whose `endDate` was postponed. */
1098
+ order?: Order;
1099
+ }
1100
+ export interface CancelOrderRequest {
1101
+ /** Order ID. */
1102
+ _id: string;
1103
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1104
+ effectiveAt: CancellationEffectiveAt;
1105
+ }
1106
+ export interface CancelOrderResponse {
1107
+ }
1108
+ export interface MarkAsPaidRequest {
1109
+ /** Order ID. */
1110
+ _id: string;
1111
+ }
1112
+ export interface MarkAsPaidResponse {
1113
+ }
1114
+ export interface OrderMarkedAsPaid {
1115
+ /** Order that was marked as paid. */
1116
+ order?: Order;
1117
+ }
1118
+ export interface PauseOrderRequest {
1119
+ /** Order ID. */
1120
+ _id: string;
1121
+ }
1122
+ export interface PauseOrderResponse {
1123
+ }
1124
+ export interface OrderPaused {
1125
+ /** Paused order. */
1126
+ order?: Order;
1127
+ }
1128
+ export interface BulkPauseOrderRequest {
1129
+ /** List of Order IDs. */
1130
+ ids?: string[];
1131
+ /** Set to true to return Order entity in response. */
1132
+ returnFullEntity?: boolean;
1133
+ }
1134
+ export interface BulkPauseOrderResponse {
1135
+ /** Orders that were paused. */
1136
+ results?: BulkOrderResult[];
1137
+ /** Bulk action metadata. */
1138
+ bulkActionMetadata?: BulkActionMetadata;
1139
+ }
1140
+ export interface BulkOrderResult {
1141
+ /** Item metadata */
1142
+ itemMetadata?: ItemMetadata;
1143
+ /** The order. */
1144
+ order?: Order;
1145
+ }
1146
+ export interface ItemMetadata {
1147
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1148
+ _id?: string | null;
1149
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1150
+ originalIndex?: number;
1151
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1152
+ success?: boolean;
1153
+ /** Details about the error in case of failure. */
1154
+ error?: ApplicationError;
1155
+ }
1156
+ export interface ApplicationError {
1157
+ /** Error code. */
1158
+ code?: string;
1159
+ /** Description of the error. */
1160
+ description?: string;
1161
+ /** Data related to the error. */
1162
+ data?: Record<string, any> | null;
1163
+ }
1164
+ export interface BulkActionMetadata {
1165
+ /** Number of items that were successfully processed. */
1166
+ totalSuccesses?: number;
1167
+ /** Number of items that couldn't be processed. */
1168
+ totalFailures?: number;
1169
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1170
+ undetailedFailures?: number;
1171
+ }
1172
+ export interface ResumeOrderRequest {
1173
+ /** Order ID. */
1174
+ _id: string;
1175
+ }
1176
+ export interface ResumeOrderResponse {
1177
+ }
1178
+ export interface OrderResumed {
1179
+ /** Resumed order. */
1180
+ order?: Order;
1181
+ }
1182
+ export interface BulkResumeOrderRequest {
1183
+ /** List of Order IDs. */
1184
+ ids?: string[];
1185
+ /** Set to true to return Order entity in response. */
1186
+ returnFullEntity?: boolean;
1187
+ }
1188
+ export interface BulkResumeOrderResponse {
1189
+ /** Orders that were resumed. */
1190
+ results?: BulkOrderResult[];
1191
+ /** Bulk action metadata. */
1192
+ bulkActionMetadata?: BulkActionMetadata;
1193
+ }
1194
+ interface BuyerNonNullableFields {
1195
+ memberId: string;
1196
+ contactId: string;
1197
+ }
1198
+ interface DurationNonNullableFields {
1199
+ unit: PeriodUnit;
1200
+ }
1201
+ interface RecurrenceNonNullableFields {
1202
+ cycleDuration?: DurationNonNullableFields;
1203
+ }
1204
+ interface TaxNonNullableFields {
1205
+ name: string;
1206
+ includedInPrice: boolean;
1207
+ rate: string;
1208
+ amount: string;
1209
+ }
1210
+ interface CouponNonNullableFields {
1211
+ code: string;
1212
+ amount: string;
1213
+ _id: string;
1214
+ }
1215
+ interface PriceDetailsNonNullableFields {
1216
+ subscription?: RecurrenceNonNullableFields;
1217
+ singlePaymentForDuration?: DurationNonNullableFields;
1218
+ subtotal: string;
1219
+ discount: string;
1220
+ tax?: TaxNonNullableFields;
1221
+ total: string;
1222
+ planPrice: string;
1223
+ currency: string;
1224
+ coupon?: CouponNonNullableFields;
1225
+ }
1226
+ interface PriceDurationNonNullableFields {
1227
+ cycleFrom: number;
1228
+ }
1229
+ interface FeeNonNullableFields {
1230
+ name: string;
1231
+ amount: string;
1232
+ }
1233
+ interface PriceNonNullableFields {
1234
+ subtotal: string;
1235
+ coupon?: CouponNonNullableFields;
1236
+ discount: string;
1237
+ tax?: TaxNonNullableFields;
1238
+ total: string;
1239
+ currency: string;
1240
+ fees: FeeNonNullableFields[];
1241
+ proration: string;
1242
+ }
1243
+ interface SpannedPriceNonNullableFields {
1244
+ duration?: PriceDurationNonNullableFields;
1245
+ price?: PriceNonNullableFields;
1246
+ }
1247
+ interface PricingDetailsNonNullableFields {
1248
+ subscription?: RecurrenceNonNullableFields;
1249
+ singlePaymentForDuration?: DurationNonNullableFields;
1250
+ prices: SpannedPriceNonNullableFields[];
1251
+ }
1252
+ interface CancellationNonNullableFields {
1253
+ cause: CancellationCause;
1254
+ effectiveAt: CancellationEffectiveAt;
1255
+ }
1256
+ interface PausePeriodNonNullableFields {
1257
+ status: Status;
1258
+ }
1259
+ interface CurrentCycleNonNullableFields {
1260
+ index: number;
1261
+ }
1262
+ interface OrderCycleNonNullableFields {
1263
+ index: number;
1264
+ }
1265
+ export interface OrderNonNullableFields {
1266
+ _id: string;
1267
+ planId: string;
1268
+ subscriptionId: string;
1269
+ buyer?: BuyerNonNullableFields;
1270
+ priceDetails?: PriceDetailsNonNullableFields;
1271
+ pricing?: PricingDetailsNonNullableFields;
1272
+ type: OrderType;
1273
+ orderMethod: OrderMethod;
1274
+ status: OrderStatus;
1275
+ cancellation?: CancellationNonNullableFields;
1276
+ lastPaymentStatus: PaymentStatus;
1277
+ pausePeriods: PausePeriodNonNullableFields[];
1278
+ currentCycle?: CurrentCycleNonNullableFields;
1279
+ cycles: OrderCycleNonNullableFields[];
1280
+ planName: string;
1281
+ planDescription: string;
1282
+ planPrice: string;
1283
+ }
1284
+ export interface MemberGetOrderResponseNonNullableFields {
1285
+ order?: OrderNonNullableFields;
1286
+ }
1287
+ export interface MemberListOrdersResponseNonNullableFields {
1288
+ orders: OrderNonNullableFields[];
1289
+ }
1290
+ export interface CreateOnlineOrderResponseNonNullableFields {
1291
+ order?: OrderNonNullableFields;
1292
+ }
1293
+ export interface CreateOfflineOrderResponseNonNullableFields {
1294
+ order?: OrderNonNullableFields;
1295
+ }
1296
+ export interface GetOnlineOrderPreviewResponseNonNullableFields {
1297
+ order?: OrderNonNullableFields;
1298
+ purchaseLimitExceeded: boolean;
1299
+ }
1300
+ export interface GetOfflineOrderPreviewResponseNonNullableFields {
1301
+ order?: OrderNonNullableFields;
1302
+ purchaseLimitExceeded: boolean;
1303
+ }
1304
+ export interface GetPricePreviewResponseNonNullableFields {
1305
+ price?: PriceDetailsNonNullableFields;
1306
+ prices: SpannedPriceNonNullableFields[];
1307
+ }
1308
+ export interface GetOrderResponseNonNullableFields {
1309
+ order?: OrderNonNullableFields;
1310
+ }
1311
+ export interface ListOrdersResponseNonNullableFields {
1312
+ orders: OrderNonNullableFields[];
1313
+ }
1314
+ export interface BaseEventMetadata {
1315
+ /** App instance ID. */
1316
+ instanceId?: string | null;
1317
+ /** Event type. */
1318
+ eventType?: string;
1319
+ /** The identification type and identity data. */
1320
+ identity?: IdentificationData;
1321
+ }
1322
+ export interface EventMetadata extends BaseEventMetadata {
1323
+ /**
1324
+ * Unique event ID.
1325
+ * Allows clients to ignore duplicate webhooks.
1326
+ */
1327
+ _id?: string;
1328
+ /**
1329
+ * Assumes actions are also always typed to an entity_type
1330
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1331
+ */
1332
+ entityFqdn?: string;
1333
+ /**
1334
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1335
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1336
+ * Example: created/updated/deleted/started/completed/email_opened
1337
+ */
1338
+ slug?: string;
1339
+ /** ID of the entity associated with the event. */
1340
+ entityId?: string;
1341
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1342
+ eventTime?: Date | null;
1343
+ /**
1344
+ * Whether the event was triggered as a result of a privacy regulation application
1345
+ * (for example, GDPR).
1346
+ */
1347
+ triggeredByAnonymizeRequest?: boolean | null;
1348
+ /** If present, indicates the action that triggered the event. */
1349
+ originatedFrom?: string | null;
1350
+ /**
1351
+ * A sequence number defining the order of updates to the underlying entity.
1352
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1353
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1354
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1355
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1356
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1357
+ */
1358
+ entityEventSequence?: string | null;
1359
+ }
1360
+ export interface OrderCanceledEnvelope {
1361
+ data: OrderCanceled;
1362
+ metadata: EventMetadata;
1363
+ }
1364
+ /**
1365
+ * Triggered when an order is canceled.
1366
+ *
1367
+ * This webhook is triggered either immediately or at the end of the current payment cycle, as follows:
1368
+ * + If the order is canceled and `effectiveAt` is set to `IMMEDIATELY`, the webhook is triggered immediately when canceled.
1369
+ * + 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.
1370
+ * @permissionScope Manage Orders
1371
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1372
+ * @permissionScope Read Orders
1373
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1374
+ * @permissionId PRICING_PLANS.READ_ORDERS
1375
+ * @webhook
1376
+ * @eventType wix.pricing_plans.v2.order_canceled
1377
+ */
1378
+ export declare function onOrderCanceled(handler: (event: OrderCanceledEnvelope) => void | Promise<void>): void;
1379
+ export interface OrderCreatedEnvelope {
1380
+ entity: Order;
1381
+ metadata: EventMetadata;
1382
+ }
1383
+ /**
1384
+ * Triggered when an order is created.
1385
+ * @permissionScope Manage Orders
1386
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1387
+ * @permissionScope Read Orders
1388
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1389
+ * @permissionId PRICING_PLANS.READ_ORDERS
1390
+ * @webhook
1391
+ * @eventType wix.pricing_plans.v2.order_created
1392
+ */
1393
+ export declare function onOrderCreated(handler: (event: OrderCreatedEnvelope) => void | Promise<void>): void;
1394
+ export interface OrderStartDateChangedEnvelope {
1395
+ data: OrderStartDateChanged;
1396
+ metadata: EventMetadata;
1397
+ }
1398
+ /**
1399
+ * Triggered when an order's `startDate` is changed.
1400
+ * @permissionScope Manage Orders
1401
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1402
+ * @permissionScope Read Orders
1403
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1404
+ * @permissionId PRICING_PLANS.READ_ORDERS
1405
+ * @webhook
1406
+ * @eventType wix.pricing_plans.v2.order_start_date_changed
1407
+ */
1408
+ export declare function onOrderStartDateChanged(handler: (event: OrderStartDateChangedEnvelope) => void | Promise<void>): void;
1409
+ export interface OrderUpdatedEnvelope {
1410
+ entity: Order;
1411
+ metadata: EventMetadata;
1412
+ }
1413
+ /**
1414
+ * Triggered for any of the following update events:
1415
+ *
1416
+ * + Order is paid for. Order Purchased is also triggered.
1417
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
1418
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
1419
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
1420
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
1421
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
1422
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
1423
+ * @permissionScope Manage Orders
1424
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1425
+ * @permissionScope Read Orders
1426
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1427
+ * @permissionId PRICING_PLANS.READ_ORDERS
1428
+ * @webhook
1429
+ * @eventType wix.pricing_plans.v2.order_updated
1430
+ */
1431
+ export declare function onOrderUpdated(handler: (event: OrderUpdatedEnvelope) => void | Promise<void>): void;
1432
+ export interface OrderAutoRenewCanceledEnvelope {
1433
+ data: OrderAutoRenewCanceled;
1434
+ metadata: EventMetadata;
1435
+ }
1436
+ /**
1437
+ * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
1438
+ *
1439
+ * This webhook is *not* triggered in the following scenarios:
1440
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`. Instead, at the time of cancellation, Order Canceled is triggered.
1441
+ * + 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.
1442
+ * @permissionScope Manage Orders
1443
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1444
+ * @permissionScope Read Orders
1445
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1446
+ * @permissionId PRICING_PLANS.READ_ORDERS
1447
+ * @webhook
1448
+ * @eventType wix.pricing_plans.v2.order_auto_renew_canceled
1449
+ */
1450
+ export declare function onOrderAutoRenewCanceled(handler: (event: OrderAutoRenewCanceledEnvelope) => void | Promise<void>): void;
1451
+ export interface OrderCycleStartedEnvelope {
1452
+ data: OrderCycleStarted;
1453
+ metadata: EventMetadata;
1454
+ }
1455
+ /**
1456
+ * Triggered at the start of a new payment cycle for an existing order.
1457
+ *
1458
+ * Not triggered at the initial start of an offline order.
1459
+ * @permissionScope Manage Orders
1460
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1461
+ * @permissionScope Read Orders
1462
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1463
+ * @permissionId PRICING_PLANS.READ_ORDERS
1464
+ * @webhook
1465
+ * @eventType wix.pricing_plans.v2.order_cycle_started
1466
+ */
1467
+ export declare function onOrderCycleStarted(handler: (event: OrderCycleStartedEnvelope) => void | Promise<void>): void;
1468
+ export interface OrderEndDatePostponedEnvelope {
1469
+ data: OrderEndDatePostponed;
1470
+ metadata: EventMetadata;
1471
+ }
1472
+ /**
1473
+ * Triggered when an order's `endDate` is postponed.
1474
+ * @permissionScope Manage Orders
1475
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1476
+ * @permissionScope Read Orders
1477
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1478
+ * @permissionId PRICING_PLANS.READ_ORDERS
1479
+ * @webhook
1480
+ * @eventType wix.pricing_plans.v2.order_end_date_postponed
1481
+ */
1482
+ export declare function onOrderEndDatePostponed(handler: (event: OrderEndDatePostponedEnvelope) => void | Promise<void>): void;
1483
+ export interface OrderEndedEnvelope {
1484
+ data: OrderEnded;
1485
+ metadata: EventMetadata;
1486
+ }
1487
+ /**
1488
+ * Triggered when an order ends.
1489
+ *
1490
+ * This webhook is triggered:
1491
+ * + When an order expires at the end of the current payment cycle.
1492
+ * + When an order is canceled and `effectiveAt` is set to `IMMEDIATELY`.
1493
+ * @permissionScope Manage Orders
1494
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1495
+ * @permissionScope Read Orders
1496
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1497
+ * @permissionId PRICING_PLANS.READ_ORDERS
1498
+ * @webhook
1499
+ * @eventType wix.pricing_plans.v2.order_ended
1500
+ */
1501
+ export declare function onOrderEnded(handler: (event: OrderEndedEnvelope) => void | Promise<void>): void;
1502
+ export interface OrderMarkedAsPaidEnvelope {
1503
+ data: OrderMarkedAsPaid;
1504
+ metadata: EventMetadata;
1505
+ }
1506
+ /**
1507
+ * Triggered when an offline order is marked as paid.
1508
+ * @permissionScope Manage Orders
1509
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1510
+ * @permissionScope Read Orders
1511
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1512
+ * @permissionId PRICING_PLANS.READ_ORDERS
1513
+ * @webhook
1514
+ * @eventType wix.pricing_plans.v2.order_marked_as_paid
1515
+ */
1516
+ export declare function onOrderMarkedAsPaid(handler: (event: OrderMarkedAsPaidEnvelope) => void | Promise<void>): void;
1517
+ export interface OrderPausedEnvelope {
1518
+ data: OrderPaused;
1519
+ metadata: EventMetadata;
1520
+ }
1521
+ /**
1522
+ * Triggered when an order is paused.
1523
+ * @permissionScope Manage Orders
1524
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1525
+ * @permissionScope Read Orders
1526
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1527
+ * @permissionId PRICING_PLANS.READ_ORDERS
1528
+ * @webhook
1529
+ * @eventType wix.pricing_plans.v2.order_paused
1530
+ */
1531
+ export declare function onOrderPaused(handler: (event: OrderPausedEnvelope) => void | Promise<void>): void;
1532
+ export interface OrderPurchasedEnvelope {
1533
+ data: OrderPurchased;
1534
+ metadata: EventMetadata;
1535
+ }
1536
+ /**
1537
+ * Triggered for any of the following purchase events:
1538
+ * + Order is paid in full.
1539
+ * + At least 1 order cycle payment is paid for.
1540
+ * + Offline order is created, even if not yet marked as paid.
1541
+ * + Free order is created.
1542
+ * @permissionScope Manage Orders
1543
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1544
+ * @permissionScope Read Orders
1545
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1546
+ * @permissionId PRICING_PLANS.READ_ORDERS
1547
+ * @webhook
1548
+ * @eventType wix.pricing_plans.v2.order_purchased
1549
+ */
1550
+ export declare function onOrderPurchased(handler: (event: OrderPurchasedEnvelope) => void | Promise<void>): void;
1551
+ export interface OrderResumedEnvelope {
1552
+ data: OrderResumed;
1553
+ metadata: EventMetadata;
1554
+ }
1555
+ /**
1556
+ * Triggered when a paused order is resumed.
1557
+ * @permissionScope Manage Orders
1558
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1559
+ * @permissionScope Read Orders
1560
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1561
+ * @permissionId PRICING_PLANS.READ_ORDERS
1562
+ * @webhook
1563
+ * @eventType wix.pricing_plans.v2.order_resumed
1564
+ */
1565
+ export declare function onOrderResumed(handler: (event: OrderResumedEnvelope) => void | Promise<void>): void;
1566
+ export interface OrderStartedEnvelope {
1567
+ data: OrderStarted;
1568
+ metadata: EventMetadata;
1569
+ }
1570
+ /**
1571
+ * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
1572
+ * @permissionScope Manage Orders
1573
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1574
+ * @permissionScope Read Orders
1575
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1576
+ * @permissionId PRICING_PLANS.READ_ORDERS
1577
+ * @webhook
1578
+ * @eventType wix.pricing_plans.v2.order_started
1579
+ */
1580
+ export declare function onOrderStarted(handler: (event: OrderStartedEnvelope) => void | Promise<void>): void;
1581
+ /**
1582
+ * Retrieves an order for the currently logged-in member by ID.
1583
+ * @param _id - Order ID.
1584
+ * @public
1585
+ * @requiredField _id
1586
+ * @param options - Options for getting a logged-in member's order.
1587
+ * @permissionId PRICING_PLANS.READ_OWN_ORDERS
1588
+ * @applicableIdentity MEMBER
1589
+ * @returns Requested order.
1590
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder
1591
+ */
1592
+ export declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<Order & OrderNonNullableFields>;
1593
+ export interface MemberGetOrderOptions {
1594
+ /**
1595
+ * Predefined set of fields to return.
1596
+ *
1597
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1598
+ */
1599
+ fieldSet?: Set;
1600
+ }
1601
+ /**
1602
+ * Retrieves a list of up to 100 pricing plan orders for currently logged-in member.
1603
+ * @public
1604
+ * @param options - Filtering, sorting, and pagination options.
1605
+ * @permissionId PRICING_PLANS.READ_OWN_ORDERS
1606
+ * @applicableIdentity MEMBER
1607
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders
1608
+ */
1609
+ export declare function memberListOrders(options?: MemberListOrdersOptions): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
1610
+ export interface MemberListOrdersOptions {
1611
+ /** Filter by plan IDs. */
1612
+ planIds?: string[];
1613
+ /** Filter for orders where auto renewal was canceled. */
1614
+ autoRenewCanceled?: boolean | null;
1615
+ /** Filter by order status. */
1616
+ orderStatuses?: OrderStatus[];
1617
+ /** Filter by payment status. */
1618
+ paymentStatuses?: PaymentStatus[];
1619
+ /** Limit the number of pricing plans returned. Default limit is 50. */
1620
+ limit?: number | null;
1621
+ /** Number of entries to offset. */
1622
+ offset?: number | null;
1623
+ /** Sorting direction (defaults to ASC) and field to sort by. */
1624
+ sorting?: Sorting;
1625
+ /**
1626
+ * Predefined set of fields to return.
1627
+ *
1628
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1629
+ */
1630
+ fieldSet?: Set;
1631
+ }
1632
+ /**
1633
+ * Cancels an order. Recurring orders can be canceled either immediately or at the next payment date. One time orders can only be canceled immediately.
1634
+ *
1635
+ * There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
1636
+ *
1637
+ * Canceling during the free trial period: When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end of the free trial period and they won't be billed. The buyer may continue using the benefits until the end of the free trial period.
1638
+ *
1639
+ * >**Note:**
1640
+ * >This method requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
1641
+ * @param _id - Order ID.
1642
+ * @param effectiveAt - Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately.
1643
+ * @public
1644
+ * @requiredField _id
1645
+ * @requiredField effectiveAt
1646
+ * @param options - Options for requesting a cancellation.
1647
+ * @permissionId PRICING_PLANS.MANAGE_OWN_ORDERS
1648
+ * @applicableIdentity MEMBER
1649
+ * @fqn com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation
1650
+ */
1651
+ export declare function requestCancellation(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
1652
+ /**
1653
+ * Creates an online order for a site member.
1654
+ *
1655
+ * If this method is called by a site member ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)), the plan is automatically ordered on behalf of that site member. Otherwise, you must specify `onBehalf.memberId` in your call.
1656
+ *
1657
+ * When an online order is created, but payment hasn't been processed, its status is set to `DRAFT`. After the payment has been processed, if the start date is in the future the order's status is set to `PENDING`. Otherwise, it's set to `ACTIVE`.
1658
+ * @param planId - Plan ID.
1659
+ * @public
1660
+ * @requiredField options.onBehalf.memberId
1661
+ * @requiredField planId
1662
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.CreateOnlineOrder
1663
+ */
1664
+ export declare function createOnlineOrder(planId: string, options?: CreateOnlineOrderOptions): Promise<CreateOnlineOrderResponse & CreateOnlineOrderResponseNonNullableFields>;
1665
+ export interface CreateOnlineOrderOptions {
1666
+ /**
1667
+ * Start date and time for the plan of the online order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1668
+ *
1669
+ * Default: Current date and time.
1670
+ */
1671
+ startDate?: Date | null;
1672
+ /** Coupon code to apply. */
1673
+ couponCode?: string | null;
1674
+ /** Provided if checkout is initiated on buyer's behalf. */
1675
+ onBehalf?: OnBehalf;
1676
+ /** Submission ID of the form submitted with this order. */
1677
+ submissionId?: string | null;
1678
+ }
1679
+ /**
1680
+ * Creates an order for a buyer who purchased the plan with an offline transaction.
1681
+ *
1682
+ * An offline order is handled off of the Wix site and is marked as `type`: `offline`. If a pricing plan
1683
+ * has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
1684
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
1685
+ *
1686
+ * When creating a free offline order:
1687
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
1688
+ * The order's last payment status is set to `"NOT_APPLICABLE"`. "
1689
+ *
1690
+ * When creating a non-free offline order:
1691
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
1692
+ * The order's last payment status is set to `"UNPAID"` or `"PAID"` based on the data passed in the `paid` boolean in the request.
1693
+ *
1694
+ * Payment for an offline order can be set in 1 of 2 ways:
1695
+ * + During order creation, set `paid`: `true`.
1696
+ * + After creation, call Mark As Paid.
1697
+ * @param planId - ID of the plan being ordered, from the Plans API.
1698
+ * @param memberId - ID of the member ordering the plan, from the Members API.
1699
+ * @public
1700
+ * @requiredField memberId
1701
+ * @requiredField planId
1702
+ * @param options - Options for creating an offline order.
1703
+ * @permissionId PRICING_PLANS.REGISTER_OFFLINE_ORDERS
1704
+ * @permissionScope Manage Orders
1705
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1706
+ * @applicableIdentity APP
1707
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.CreateOfflineOrder
1708
+ */
1709
+ export declare function createOfflineOrder(planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
1710
+ export interface CreateOfflineOrderOptions {
1711
+ /**
1712
+ * Start date and time for the ordered plan in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1713
+ *
1714
+ * Default: Current date and time.
1715
+ */
1716
+ startDate?: Date | null;
1717
+ /**
1718
+ * Whether the order is paid.
1719
+ *
1720
+ * Default: `false`
1721
+ */
1722
+ paid?: boolean | null;
1723
+ /** Coupon code to apply, from the Coupons API. */
1724
+ couponCode?: string | null;
1725
+ /** Form submission ID that was submitted with the order. */
1726
+ submissionId?: string | null;
1727
+ }
1728
+ /**
1729
+ * Returns an `order` object that represents a potential online order for a site member.
1730
+ *
1731
+ * You can use this method to show a site member a preview of an online order before [creating](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/create-online-order) it.
1732
+ *
1733
+ * This method must be called using the site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)). Therefore, [Wix apps](https://dev.wix.com/docs/build-apps) can't currently call this method using REST.
1734
+ * @param planId - Plan ID.
1735
+ * @public
1736
+ * @requiredField planId
1737
+ * @permissionId PRICING_PLANS.PURCHASE_PLANS
1738
+ * @permissionScope Manage Bookings Services and Settings
1739
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1740
+ * @permissionScope Manage Portfolio
1741
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
1742
+ * @permissionScope Manage Restaurants - all permissions
1743
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1744
+ * @applicableIdentity APP
1745
+ * @applicableIdentity MEMBER
1746
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetOnlineOrderPreview
1747
+ */
1748
+ export declare function getOnlineOrderPreview(planId: string, options?: GetOnlineOrderPreviewOptions): Promise<GetOnlineOrderPreviewResponse & GetOnlineOrderPreviewResponseNonNullableFields>;
1749
+ export interface GetOnlineOrderPreviewOptions {
1750
+ /**
1751
+ * Start date and time for the plan of the order preview in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1752
+ *
1753
+ * Default: Current date and time.
1754
+ */
1755
+ startDate?: Date | null;
1756
+ /** Coupon code to apply. */
1757
+ couponCode?: string | null;
1758
+ }
1759
+ /**
1760
+ * Performs a dry run of a purchase and provides an order preview.
1761
+ *
1762
+ * The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
1763
+ * created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
1764
+ * (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
1765
+ * <br>
1766
+ * If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
1767
+ * But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
1768
+ * `purchaseLimitExceeded` will return as `true`.
1769
+ *
1770
+ * To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.
1771
+ * @param memberId - Member ID of the buyer the previewed order is for, from the Members API.
1772
+ * @public
1773
+ * @requiredField memberId
1774
+ * @requiredField planId
1775
+ * @param options - Options for previewing the offline order.
1776
+ * @param planId - ID of the plan of the previewed order.
1777
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1778
+ * @permissionScope Manage Orders
1779
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1780
+ * @applicableIdentity APP
1781
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetOfflineOrderPreview
1782
+ */
1783
+ export declare function getOfflineOrderPreview(planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
1784
+ export interface GetOfflineOrderPreviewOptions {
1785
+ /**
1786
+ * Start date and time for plan of the previewed order in a `YYYY-MM-DDThh:mm[:ss][.sss]Z` format.
1787
+ *
1788
+ * Default: Current date and time.
1789
+ */
1790
+ startDate?: Date | null;
1791
+ /** Coupon code to apply, from the Coupons API. */
1792
+ couponCode?: string | null;
1793
+ }
1794
+ /**
1795
+ * Retrieves a plan's pricing.
1796
+ *
1797
+ * The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
1798
+ * the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
1799
+ * in the pricing model format used for orders. Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
1800
+ *
1801
+ * Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
1802
+ * generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.
1803
+ * @param planId - ID of plan to preview.
1804
+ * @public
1805
+ * @requiredField planId
1806
+ * @param options - Options for getting a price preview.
1807
+ * @permissionId PRICING_PLANS.READ_PUBLIC_PLANS
1808
+ * @permissionScope Read Pricing Plans
1809
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
1810
+ * @permissionScope Manage Orders
1811
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1812
+ * @permissionScope Manage Bookings Services and Settings
1813
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1814
+ * @permissionScope Read Orders
1815
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1816
+ * @permissionScope Manage Portfolio
1817
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
1818
+ * @permissionScope Manage Pricing Plans
1819
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1820
+ * @permissionScope Manage Restaurants - all permissions
1821
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
1822
+ * @applicableIdentity APP
1823
+ * @applicableIdentity VISITOR
1824
+ * @fqn com.wixpress.membership.v2.orders.CheckoutService.GetPricePreview
1825
+ */
1826
+ export declare function getPricePreview(planId: string, options?: GetPricePreviewOptions): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
1827
+ export interface GetPricePreviewOptions {
1828
+ /** Coupon code to apply, from the Coupons API. */
1829
+ couponCode?: string | null;
1830
+ }
1831
+ /**
1832
+ * Retrieves an order by ID.
1833
+ * @param _id - Order ID.
1834
+ * @public
1835
+ * @requiredField _id
1836
+ * @param options - Options to use when getting an order.
1837
+ * @permissionId PRICING_PLANS.READ_ORDERS
1838
+ * @permissionScope Manage Orders
1839
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1840
+ * @permissionScope Read Orders
1841
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1842
+ * @applicableIdentity APP
1843
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.GetOrder
1844
+ */
1845
+ export declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
1846
+ export interface ManagementGetOrderOptions {
1847
+ /**
1848
+ * Predefined set of fields to return.
1849
+ *
1850
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1851
+ */
1852
+ fieldSet?: Set;
1853
+ }
1854
+ /**
1855
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
1856
+ *
1857
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
1858
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
1859
+ * @public
1860
+ * @param options - Filtering, sorting, and pagination options.
1861
+ * @permissionId PRICING_PLANS.READ_ORDERS
1862
+ * @permissionScope Manage Orders
1863
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1864
+ * @permissionScope Read Orders
1865
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
1866
+ * @applicableIdentity APP
1867
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ListOrders
1868
+ */
1869
+ export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
1870
+ export interface ManagementListOrdersOptions {
1871
+ /** Filter by a buyer's member ID, from the Members API. */
1872
+ buyerIds?: string[];
1873
+ /** Filter by plan IDs, from the Plans API. */
1874
+ planIds?: string[];
1875
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1876
+ autoRenewCanceled?: boolean | null;
1877
+ /** Filter by order status. */
1878
+ orderStatuses?: OrderStatus[];
1879
+ /** Filter by payment status. */
1880
+ paymentStatuses?: PaymentStatus[];
1881
+ /**
1882
+ * Number of orders to return. See Sorting and Paging for more information.
1883
+ *
1884
+ * Max: `50`
1885
+ */
1886
+ limit?: number | null;
1887
+ /** Number of orders to skip in the current sort order. */
1888
+ offset?: number | null;
1889
+ /**
1890
+ * Sort order.
1891
+ *
1892
+ * Use `ASC` for ascending order or `DESC` for descending order.
1893
+ *
1894
+ * Default: `DESC`.
1895
+ */
1896
+ sorting?: Sorting;
1897
+ /**
1898
+ * Predefined set of fields to return.
1899
+ *
1900
+ * Default: If `fieldSet` is omitted, no order form submission data is returned.
1901
+ */
1902
+ fieldSet?: Set;
1903
+ }
1904
+ /**
1905
+ * 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.
1906
+ *
1907
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
1908
+ * Can't postpone an order with `status`: `PAUSED`.
1909
+ * @param _id - Order ID.
1910
+ * @param endDate - New end date and time.
1911
+ *
1912
+ * Must be later than the current end date and time.
1913
+ * @public
1914
+ * @requiredField _id
1915
+ * @requiredField endDate
1916
+ * @param options - Options for postponing the end date of an order.
1917
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1918
+ * @permissionScope Manage Orders
1919
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1920
+ * @applicableIdentity APP
1921
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate
1922
+ */
1923
+ export declare function postponeEndDate(_id: string, endDate: Date | null): Promise<void>;
1924
+ /**
1925
+ * Cancels an existing order.
1926
+ *
1927
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
1928
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
1929
+ *
1930
+ * #### Canceling during the free trial period.
1931
+ *
1932
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
1933
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
1934
+ * of the free trial period.
1935
+ *
1936
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
1937
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
1938
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
1939
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
1940
+ * Then, the subscription ends and the buyer is not billed.
1941
+ * @param _id - Order ID.
1942
+ * @param effectiveAt - __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`.
1943
+ * @public
1944
+ * @requiredField _id
1945
+ * @requiredField effectiveAt
1946
+ * @param options - Options for canceling orders.
1947
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1948
+ * @permissionScope Manage Orders
1949
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1950
+ * @applicableIdentity APP
1951
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder
1952
+ */
1953
+ export declare function cancelOrder(_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
1954
+ /**
1955
+ * Marks an offline order as paid.
1956
+ * > __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.
1957
+ *
1958
+ * Marking an offline order as paid causes the following changes:
1959
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
1960
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
1961
+ *
1962
+ * An error occurs if you attempt to:
1963
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
1964
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
1965
+ * @param _id - Order ID.
1966
+ * @public
1967
+ * @requiredField _id
1968
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1969
+ * @permissionScope Manage Orders
1970
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1971
+ * @applicableIdentity APP
1972
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid
1973
+ */
1974
+ export declare function markAsPaid(_id: string): Promise<void>;
1975
+ /**
1976
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
1977
+ *
1978
+ * Only orders with `status`: `ACTIVE` can be paused.
1979
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
1980
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
1981
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
1982
+ *
1983
+ * To resume a paused order, call Resume Order.
1984
+ * @param _id - Order ID.
1985
+ * @public
1986
+ * @requiredField _id
1987
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
1988
+ * @permissionScope Manage Orders
1989
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
1990
+ * @applicableIdentity APP
1991
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder
1992
+ */
1993
+ export declare function pauseOrder(_id: string): Promise<void>;
1994
+ /**
1995
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
1996
+ *
1997
+ * Resuming an order causes the following changes:
1998
+ * - The order status changes to `"ACTIVE"`.
1999
+ * - The `pausePeriods` array is updated.
2000
+ * - The `endDate` for the order is adjusted to include the pause period.
2001
+ * - For orders with recurring payments, the payment schedule is restarted.
2002
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
2003
+ *
2004
+ * To pause an order, call Pause Order.
2005
+ * @param _id - Order ID.
2006
+ * @public
2007
+ * @requiredField _id
2008
+ * @permissionId PRICING_PLANS.MANAGE_ORDERS
2009
+ * @permissionScope Manage Orders
2010
+ * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
2011
+ * @applicableIdentity APP
2012
+ * @fqn com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder
2013
+ */
2014
+ export declare function resumeOrder(_id: string): Promise<void>;
2015
+ export {};