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