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