@wix/auto_sdk_pricing-plans_orders 1.0.57 → 1.0.59

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