@wix/auto_sdk_pricing-plans_orders 1.0.57 → 1.0.59

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