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