@wix/pricing-plans 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/build/cjs/index.d.ts +2 -0
  2. package/build/cjs/index.js +25 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/pricing-plans-v2-order.http.d.ts +105 -0
  5. package/build/cjs/src/pricing-plans-v2-order.http.js +751 -0
  6. package/build/cjs/src/pricing-plans-v2-order.http.js.map +1 -0
  7. package/build/cjs/src/pricing-plans-v2-order.public.d.ts +17 -0
  8. package/build/cjs/src/pricing-plans-v2-order.public.js +95 -0
  9. package/build/cjs/src/pricing-plans-v2-order.public.js.map +1 -0
  10. package/build/cjs/src/pricing-plans-v2-order.types.d.ts +1071 -0
  11. package/build/cjs/src/pricing-plans-v2-order.types.js +133 -0
  12. package/build/cjs/src/pricing-plans-v2-order.types.js.map +1 -0
  13. package/build/cjs/src/pricing-plans-v2-order.universal.d.ts +1346 -0
  14. package/build/cjs/src/pricing-plans-v2-order.universal.js +962 -0
  15. package/build/cjs/src/pricing-plans-v2-order.universal.js.map +1 -0
  16. package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +44 -0
  17. package/build/cjs/src/pricing-plans-v2-plan.http.js +453 -0
  18. package/build/cjs/src/pricing-plans-v2-plan.http.js.map +1 -0
  19. package/build/cjs/src/pricing-plans-v2-plan.public.d.ts +16 -0
  20. package/build/cjs/src/pricing-plans-v2-plan.public.js +82 -0
  21. package/build/cjs/src/pricing-plans-v2-plan.public.js.map +1 -0
  22. package/build/cjs/src/pricing-plans-v2-plan.types.d.ts +357 -0
  23. package/build/cjs/src/pricing-plans-v2-plan.types.js +35 -0
  24. package/build/cjs/src/pricing-plans-v2-plan.types.js.map +1 -0
  25. package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +554 -0
  26. package/build/cjs/src/pricing-plans-v2-plan.universal.js +728 -0
  27. package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +1 -0
  28. package/build/es/index.d.ts +2 -0
  29. package/build/es/index.js +3 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/src/pricing-plans-v2-order.http.d.ts +105 -0
  32. package/build/es/src/pricing-plans-v2-order.http.js +735 -0
  33. package/build/es/src/pricing-plans-v2-order.http.js.map +1 -0
  34. package/build/es/src/pricing-plans-v2-order.public.d.ts +17 -0
  35. package/build/es/src/pricing-plans-v2-order.public.js +68 -0
  36. package/build/es/src/pricing-plans-v2-order.public.js.map +1 -0
  37. package/build/es/src/pricing-plans-v2-order.types.d.ts +1071 -0
  38. package/build/es/src/pricing-plans-v2-order.types.js +130 -0
  39. package/build/es/src/pricing-plans-v2-order.types.js.map +1 -0
  40. package/build/es/src/pricing-plans-v2-order.universal.d.ts +1346 -0
  41. package/build/es/src/pricing-plans-v2-order.universal.js +927 -0
  42. package/build/es/src/pricing-plans-v2-order.universal.js.map +1 -0
  43. package/build/es/src/pricing-plans-v2-plan.http.d.ts +44 -0
  44. package/build/es/src/pricing-plans-v2-plan.http.js +438 -0
  45. package/build/es/src/pricing-plans-v2-plan.http.js.map +1 -0
  46. package/build/es/src/pricing-plans-v2-plan.public.d.ts +16 -0
  47. package/build/es/src/pricing-plans-v2-plan.public.js +63 -0
  48. package/build/es/src/pricing-plans-v2-plan.public.js.map +1 -0
  49. package/build/es/src/pricing-plans-v2-plan.types.d.ts +357 -0
  50. package/build/es/src/pricing-plans-v2-plan.types.js +32 -0
  51. package/build/es/src/pricing-plans-v2-plan.types.js.map +1 -0
  52. package/build/es/src/pricing-plans-v2-plan.universal.d.ts +554 -0
  53. package/build/es/src/pricing-plans-v2-plan.universal.js +694 -0
  54. package/build/es/src/pricing-plans-v2-plan.universal.js.map +1 -0
  55. package/package.json +37 -0
@@ -0,0 +1,1346 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /**
8
+ * An order object includes all of the details related to the purchase of a Pricing Plan.
9
+ * You can manage existing orders, create offline orders, and preview orders not yet purchased.
10
+ *
11
+ * Orders are based on pricing models based on the payment and duration cycles for each plan. See here to
12
+ * [learn more about pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models).
13
+ */
14
+ export interface Order {
15
+ /**
16
+ * Order ID.
17
+ * @readonly
18
+ */
19
+ _id?: string;
20
+ /**
21
+ * ID of the plan purchased with the order. See [Plans for more information about pricing plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/introduction).
22
+ * @readonly
23
+ */
24
+ planId?: string;
25
+ /**
26
+ * ID of the related Wix subscription.
27
+ *
28
+ * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. See here
29
+ * for a [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business).
30
+ * @readonly
31
+ */
32
+ subscriptionId?: string;
33
+ /**
34
+ * Wix Pay order ID.
35
+ *
36
+ * Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
37
+ * @readonly
38
+ */
39
+ wixPayOrderId?: string | null;
40
+ /**
41
+ * The buyer's IDs. Includes `memberId` and `contactId`.
42
+ *
43
+ * Currently, Pricing Plan purchases are limited to members only. `contactId` is returned,
44
+ * but a buyer will not be able to purchase a plan without a `memberId`.
45
+ * @readonly
46
+ */
47
+ buyer?: Buyer;
48
+ /**
49
+ * __Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022.
50
+ * @readonly
51
+ */
52
+ priceDetails?: PriceDetails;
53
+ /**
54
+ * Order pricing model, price, and payment schedule.
55
+ *
56
+ * [Learn more about pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models).
57
+ * @readonly
58
+ */
59
+ pricing?: PricingDetails;
60
+ /**
61
+ * How the order was processed. One of:
62
+ * + `ONLINE`: The buyer purchased the plan using the site.
63
+ * + `OFFLINE`: The buyer made a manual, offline purchase without using the site.
64
+ * @readonly
65
+ */
66
+ type?: OrderType;
67
+ /**
68
+ * Status of the order. One of:
69
+ * + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
70
+ * + `PENDING`: Order has been purchased and its start date is set in the future.
71
+ * + `ACTIVE`: Order has been processed. The plan is available for use.
72
+ * + `PAUSED`: Order, and use of the plan, is [paused](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/pause-order). The order, and use of the plan, can be [resumed](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/resume-order).
73
+ * + `ENDED`: Order has completed its duration and is no longer available for use.
74
+ * + `CANCELED`: Order has been [canceled](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/cancel-order).
75
+ * @readonly
76
+ */
77
+ status?: OrderStatus;
78
+ /**
79
+ * Whether the order will be canceled at the next payment date.
80
+ *
81
+ * If `true`, the order status will be `CANCELED` and the next payment won't be charged. Omitted for single payment orders.
82
+ * @readonly
83
+ */
84
+ autoRenewCanceled?: boolean | null;
85
+ /**
86
+ * Details about the cancellation of an order.
87
+ *
88
+ * Only present if the status is `CANCELED`.
89
+ * @readonly
90
+ */
91
+ cancellation?: Cancellation;
92
+ /**
93
+ * Status of the last payment for the order.
94
+ * Updated automatically for online orders. Updated manually by the site owner for offline orders. One of:
95
+ * + `PAID`: The last payment was paid.
96
+ * + `REFUNDED`: The last payment was refunded.
97
+ * + `FAILED`: The last payment transaction didn't complete.
98
+ * + `UNPAID`: The last payment wasn't paid.
99
+ * + `PENDING`: Awaiting payment.
100
+ * + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
101
+ * @readonly
102
+ */
103
+ lastPaymentStatus?: PaymentStatus;
104
+ /**
105
+ * Start date and time for the ordered plan.
106
+ * @readonly
107
+ */
108
+ startDate?: Date;
109
+ /**
110
+ * Current end date and time for the ordered plan.
111
+ *
112
+ * `endDate` may be updated over the course of an order. If the order is [paused](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/pause-order),
113
+ * it will have a later `endDate` once it [resumes](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/resume-order). `endDate` may also be [postponed](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/postpone-end-date).
114
+ *
115
+ * Omitted if the order is valid until canceled and still `ACTIVE`.
116
+ * @readonly
117
+ */
118
+ endDate?: Date;
119
+ /**
120
+ * List of periods during which the order is paused.
121
+ * @readonly
122
+ */
123
+ pausePeriods?: PausePeriod[];
124
+ /**
125
+ * Free trial period for the order, in days.
126
+ *
127
+ * Only available for recurring plans.
128
+ * @readonly
129
+ */
130
+ freeTrialDays?: number | null;
131
+ /**
132
+ * Earliest end date and time that the plan for the order can expire.
133
+ *
134
+ * Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
135
+ * @readonly
136
+ */
137
+ earliestEndDate?: Date;
138
+ /**
139
+ * Current payment cycle for the order.
140
+ *
141
+ * `currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet.
142
+ * @readonly
143
+ */
144
+ currentCycle?: CurrentCycle;
145
+ /**
146
+ * Plan name at the time of purchase.
147
+ * @readonly
148
+ */
149
+ planName?: string;
150
+ /**
151
+ * Plan description at the time of purchase
152
+ * @readonly
153
+ */
154
+ planDescription?: string;
155
+ /**
156
+ * Plan price as it was at the moment of order creation.
157
+ * @readonly
158
+ */
159
+ planPrice?: string;
160
+ /**
161
+ * Date and time the order was created.
162
+ * @readonly
163
+ */
164
+ _createdDate?: Date;
165
+ /**
166
+ * Date and time the order was updated.
167
+ * @readonly
168
+ */
169
+ _updatedDate?: Date;
170
+ }
171
+ export interface Buyer {
172
+ /**
173
+ * Member ID for a Wix site member. See [Members to learn more about a site's members](https://dev.wix.com/api/rest/members/members).
174
+ * @readonly
175
+ */
176
+ memberId?: string;
177
+ /**
178
+ * Contact ID for a Wix site contact. See [Contacts to learn more about a site's contacts](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-object).
179
+ * @readonly
180
+ */
181
+ contactId?: string;
182
+ }
183
+ export interface PriceDetails extends PriceDetailsPricingModelOneOf {
184
+ /** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
185
+ subtotal?: string;
186
+ /** Total discount applied. */
187
+ discount?: string;
188
+ /** Tax applied. */
189
+ tax?: Tax;
190
+ /**
191
+ * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
192
+ *
193
+ * If no tax is applied, the amount is the same as `subtotal`.
194
+ */
195
+ total?: string;
196
+ /** Plan price as it was at the moment of order creation. */
197
+ planPrice?: string;
198
+ /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
199
+ currency?: string;
200
+ /** Free trial period for the order in days. Only available for recurring plans. */
201
+ freeTrialDays?: number | null;
202
+ /** Coupon applied to the order. Empty means no coupon was applied. */
203
+ coupon?: Coupon;
204
+ /** Order has recurring payments. */
205
+ subscription?: Recurrence;
206
+ /** One-time payment. Order is valid for a specified duration. */
207
+ singlePaymentForDuration?: Duration;
208
+ /** One-time payment. Order is valid until it is canceled. */
209
+ singlePaymentUnlimited?: boolean | null;
210
+ }
211
+ /** @oneof */
212
+ export interface PriceDetailsPricingModelOneOf {
213
+ /** Order has recurring payments. */
214
+ subscription?: Recurrence;
215
+ /** One-time payment. Order is valid for a specified duration. */
216
+ singlePaymentForDuration?: Duration;
217
+ /** One-time payment. Order is valid until it is canceled. */
218
+ singlePaymentUnlimited?: boolean | null;
219
+ }
220
+ export interface Tax {
221
+ /** Name of the tax. For example, VAT. */
222
+ name?: string;
223
+ /** Whether tax is included in the original price. When `false`, tax is added at checkout. */
224
+ includedInPrice?: boolean;
225
+ /** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
226
+ rate?: string;
227
+ /** Total tax, specified as a monetary amount. For example, `"3.99"`. */
228
+ amount?: string;
229
+ }
230
+ /** An object specifying how often and for how long payments recur (may be forever). */
231
+ export interface Recurrence {
232
+ /** Length of one payment cycle. */
233
+ cycleDuration?: Duration;
234
+ /**
235
+ * Amount of payment cycles this subscription is valid for.
236
+ *
237
+ * `0` for unlimited or until-canceled.
238
+ */
239
+ cycleCount?: number | null;
240
+ }
241
+ /** A duration expressed in number of time units. */
242
+ export interface Duration {
243
+ /**
244
+ * The amount of a duration `unit` in a single payment cycle.
245
+ *
246
+ * Currently limited to support only `1`.
247
+ */
248
+ count?: number | null;
249
+ /** Unit of time for the cycle duration. */
250
+ unit?: PeriodUnit;
251
+ }
252
+ export declare enum PeriodUnit {
253
+ UNDEFINED = "UNDEFINED",
254
+ DAY = "DAY",
255
+ WEEK = "WEEK",
256
+ MONTH = "MONTH",
257
+ YEAR = "YEAR"
258
+ }
259
+ export interface Coupon {
260
+ /** Code of the applied coupon. */
261
+ code?: string;
262
+ /** Total discount of the coupon, as a monetary amount. */
263
+ amount?: string;
264
+ /**
265
+ * Coupon ID.
266
+ * @readonly
267
+ */
268
+ _id?: string;
269
+ }
270
+ export interface PricingDetails extends PricingDetailsPricingModelOneOf {
271
+ /**
272
+ * Pricing details for all pricing models.
273
+ * @readonly
274
+ */
275
+ prices?: SpannedPrice[];
276
+ /** Pricing model for an order with recurring payment cycles. */
277
+ subscription?: Recurrence;
278
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
279
+ singlePaymentForDuration?: Duration;
280
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
281
+ singlePaymentUnlimited?: boolean | null;
282
+ }
283
+ /** @oneof */
284
+ export interface PricingDetailsPricingModelOneOf {
285
+ /** Pricing model for an order with recurring payment cycles. */
286
+ subscription?: Recurrence;
287
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
288
+ singlePaymentForDuration?: Duration;
289
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
290
+ singlePaymentUnlimited?: boolean | null;
291
+ }
292
+ export interface SpannedPrice {
293
+ /**
294
+ * Cycle duration to apply `price` for.
295
+ *
296
+ * Use with all pricing models.
297
+ * Can apply the same price to multiple payment cycles.
298
+ */
299
+ duration?: PriceDuration;
300
+ /** Order price. */
301
+ price?: Price;
302
+ }
303
+ export interface PriceDuration {
304
+ /**
305
+ * Price starts to apply with this cycle.
306
+ *
307
+ * `1` is the first payment cycle for all pricing models.
308
+ */
309
+ cycleFrom?: number;
310
+ /**
311
+ * Amount of cycles to apply price for.
312
+ *
313
+ * For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.
314
+ *
315
+ * For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.
316
+ *
317
+ * For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`.
318
+ */
319
+ numberOfCycles?: number | null;
320
+ }
321
+ export interface Price {
322
+ /** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
323
+ subtotal?: string;
324
+ /**
325
+ * Coupon applied to the order.
326
+ *
327
+ * See Coupons [to learn more about coupons](https://dev.wix.com/api/rest/coupons).
328
+ */
329
+ coupon?: Coupon;
330
+ /** Total discount applied to the order. */
331
+ discount?: string;
332
+ /**
333
+ * Tax applied to the order.
334
+ *
335
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
336
+ */
337
+ tax?: Tax;
338
+ /**
339
+ * Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
340
+ *
341
+ * If no tax is applied, the amount is the same as `subtotal`.
342
+ */
343
+ total?: string;
344
+ /**
345
+ * Three-letter currency code in
346
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
347
+ */
348
+ currency?: string;
349
+ }
350
+ export declare enum OrderType {
351
+ UNDEFINED = "UNDEFINED",
352
+ /** Payments made by the buyer */
353
+ ONLINE = "ONLINE",
354
+ /** Payments managed manually by the site owner */
355
+ OFFLINE = "OFFLINE"
356
+ }
357
+ export declare enum OrderMethod {
358
+ UNKNOWN = "UNKNOWN",
359
+ /** Mail Order / Telephone Order transaction */
360
+ MOTO = "MOTO",
361
+ /** Point of Sale transaction */
362
+ POS = "POS"
363
+ }
364
+ export declare enum OrderStatus {
365
+ /** Order status undefined */
366
+ UNDEFINED = "UNDEFINED",
367
+ /** Order created, but hasn't been paid for yet. Filtered out in ListOrders response by default. */
368
+ DRAFT = "DRAFT",
369
+ /** Order has been paid for, but the start date is in the future */
370
+ PENDING = "PENDING",
371
+ /** Order is active */
372
+ ACTIVE = "ACTIVE",
373
+ /** Order is paused until site owner resumes it */
374
+ PAUSED = "PAUSED",
375
+ /** Order has ended */
376
+ ENDED = "ENDED",
377
+ /** Order has been canceled */
378
+ CANCELED = "CANCELED"
379
+ }
380
+ export interface Cancellation {
381
+ /** Date and time the cancellation was requested. */
382
+ requestedDate?: Date;
383
+ /**
384
+ * Reason for the cancellation. One of:
385
+ * + `OWNER_ACTION`: Site owner canceled the order.
386
+ * + `MEMBER_ACTION`: Buyer initiated the cancellation.
387
+ * + `PAYMENT_FAILURE`: Payment transaction failed.
388
+ * + `PAYMENT_SETUP_FAILURE`: Buyer's payment details weren't set up correctly.
389
+ * + `UNKNOWN`: Reason for the cancellation is unknown.
390
+ */
391
+ cause?: CancellationCause;
392
+ /**
393
+ * When the cancellation takes effect. Set when cancelling the order. One of:
394
+ * + `IMMEDIATELY`: Cancellation occurs immediately and the buyer can no longer use the plan.
395
+ * + `NEXT_PAYMENT_DATE`: Cancellation occurs at the next payment date and time. Buyer can continue to use the plan until that date and time.
396
+ */
397
+ effectiveAt?: CancellationEffectiveAt;
398
+ }
399
+ export declare enum CancellationCause {
400
+ /** Cancellation initiator undefined */
401
+ UNDEFINED = "UNDEFINED",
402
+ /** Order was canceled by site owner (default if canceled by user or service identity) */
403
+ OWNER_ACTION = "OWNER_ACTION",
404
+ /** Order was canceled by member (default if canceled by member identity) */
405
+ MEMBER_ACTION = "MEMBER_ACTION",
406
+ /** Order was canceled because of payment failure */
407
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
408
+ /** Order was canceled because of payment setup failure */
409
+ PAYMENT_SETUP_FAILURE = "PAYMENT_SETUP_FAILURE",
410
+ /** Order was cancelled because of an unknown reason. It's not possible to know with certain payment providers (e.g. paypal) */
411
+ UNKNOWN = "UNKNOWN"
412
+ }
413
+ export declare enum CancellationEffectiveAt {
414
+ /** Cancellation time undefined */
415
+ UNDEFINED = "UNDEFINED",
416
+ /** Will cancel the order now, i.e. update validUntil to the current date */
417
+ IMMEDIATELY = "IMMEDIATELY",
418
+ /** Will cancel the order at the date when next payment should have been made */
419
+ NEXT_PAYMENT_DATE = "NEXT_PAYMENT_DATE"
420
+ }
421
+ export declare enum PaymentStatus {
422
+ /** Payment status undefined */
423
+ UNDEFINED = "UNDEFINED",
424
+ /** Payment has been paid */
425
+ PAID = "PAID",
426
+ /** Payment has been refunded */
427
+ REFUNDED = "REFUNDED",
428
+ /** Recurring payment has failed */
429
+ FAILED = "FAILED",
430
+ /** Payment has not been paid */
431
+ UNPAID = "UNPAID",
432
+ /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
433
+ PENDING = "PENDING",
434
+ /** Used in cases where the plan is free */
435
+ NOT_APPLICABLE = "NOT_APPLICABLE"
436
+ }
437
+ export interface PausePeriod {
438
+ /**
439
+ * Status of the pause period. One of:
440
+ *
441
+ * + `ACTIVE`: Status while the order is [paused](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/pause-order).
442
+ * + `ENDED`: Status when the order is [resumed](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/resume-order).
443
+ */
444
+ status?: Status;
445
+ /** Start date and time of the pause period. */
446
+ pauseDate?: Date;
447
+ /**
448
+ * End date and time of the pause period.
449
+ *
450
+ * Omitted while the pause period remains `ACTIVE`.
451
+ */
452
+ resumeDate?: Date;
453
+ }
454
+ export declare enum Status {
455
+ UNDEFINED = "UNDEFINED",
456
+ /** Order suspension is active */
457
+ ACTIVE = "ACTIVE",
458
+ /** Order suspension has ended */
459
+ ENDED = "ENDED"
460
+ }
461
+ /**
462
+ * Current cycle will be empty when order is cancelled, expired or order start date is in the future
463
+ * Current cycle start and end dates take into account free trial days and suspensions
464
+ */
465
+ export interface CurrentCycle {
466
+ /**
467
+ * Index of the current payment cycle in the order.
468
+ *
469
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
470
+ */
471
+ index?: number;
472
+ /** Start date and time for the current payment cycle. */
473
+ startedDate?: Date;
474
+ /** End date and time for the current payment cycle. */
475
+ endedDate?: Date;
476
+ }
477
+ /** Order cycle start and end dates take into account free trial days and suspensions */
478
+ export interface OrderCycle {
479
+ /**
480
+ * Index of this cycle in the order.
481
+ *
482
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
483
+ */
484
+ index?: number;
485
+ /** Start date and time for this order cycle. */
486
+ startedDate?: Date;
487
+ /** End date and time for this order cycle. */
488
+ endedDate?: Date;
489
+ }
490
+ export interface FormData {
491
+ /** Reference to the form which was used to gather additional data in checkout. */
492
+ formId?: string | null;
493
+ /** Reference to the submission of the form. */
494
+ submissionId?: string | null;
495
+ /**
496
+ * Data submitted to the form at checkout.
497
+ * This field is only returned when `FieldSet.FULL` is specified when fetching the data
498
+ * @readonly
499
+ */
500
+ submissionData?: Record<string, any>;
501
+ }
502
+ export interface MemberGetOrderRequest {
503
+ /** Order ID. */
504
+ _id: string;
505
+ fieldSet?: Set;
506
+ }
507
+ export declare enum Set {
508
+ /** Same behavior as BASIC */
509
+ UNKNOWN_SET = "UNKNOWN_SET",
510
+ /**
511
+ * Returns fields of the entity that are available in the database.
512
+ * By default a field is available in the database unless explicitly specified in the documentation
513
+ */
514
+ BASIC = "BASIC",
515
+ /**
516
+ * Returns all fields in the entity.
517
+ * This might make additional calls to gather the full entity
518
+ */
519
+ FULL = "FULL"
520
+ }
521
+ export interface MemberGetOrderResponse {
522
+ /** Requested order. */
523
+ order?: Order;
524
+ }
525
+ export interface MemberListOrdersRequest {
526
+ /** Filter by plan IDs. */
527
+ planIds?: string[];
528
+ /** Filter for orders where auto renewal was canceled. */
529
+ autoRenewCanceled?: boolean | null;
530
+ /** Filter by order status. */
531
+ orderStatuses?: OrderStatus[];
532
+ /** Filter by payment status. */
533
+ paymentStatuses?: PaymentStatus[];
534
+ /** Limit the number of pricing plans returned. Default limit is 50. */
535
+ limit?: number | null;
536
+ /** Number of entries to offset. */
537
+ offset?: number | null;
538
+ /** Sorting direction (defaults to ASC) and field to sort by. [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
539
+ sorting?: Sorting;
540
+ }
541
+ export interface Sorting {
542
+ /** Name of the field to sort by. */
543
+ fieldName?: string;
544
+ /** Sort order. */
545
+ order?: SortOrder;
546
+ }
547
+ export declare enum SortOrder {
548
+ ASC = "ASC",
549
+ DESC = "DESC"
550
+ }
551
+ export interface MemberListOrdersResponse {
552
+ orders?: Order[];
553
+ }
554
+ /**
555
+ * TODO: Write orders filter and sort docs page
556
+ * Retrieves a list of up to 1,000 orders, based on the provided paging, [sorting, and filtering](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort).
557
+ */
558
+ export interface QueryOrdersRequest {
559
+ query?: QueryV2;
560
+ }
561
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
562
+ /**
563
+ * Filter object in the following format:
564
+ * `"filter" : {
565
+ * "fieldName1": "value1",
566
+ * "fieldName2":{"$operator":"value2"}
567
+ * }`
568
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
569
+ */
570
+ filter?: Record<string, any> | null;
571
+ /**
572
+ * Sort object in the following format:
573
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
574
+ */
575
+ sort?: Sorting[];
576
+ /** 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. */
577
+ fields?: string[];
578
+ /** 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. */
579
+ fieldsets?: string[];
580
+ /** Paging options to limit and skip the number of items. */
581
+ paging?: Paging;
582
+ /** 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`. */
583
+ cursorPaging?: CursorPaging;
584
+ }
585
+ /** @oneof */
586
+ export interface QueryV2PagingMethodOneOf {
587
+ /** Paging options to limit and skip the number of items. */
588
+ paging?: Paging;
589
+ /** 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`. */
590
+ cursorPaging?: CursorPaging;
591
+ }
592
+ export interface Paging {
593
+ /** Number of items to load. */
594
+ limit?: number | null;
595
+ /** Number of items to skip in the current sort order. */
596
+ offset?: number | null;
597
+ }
598
+ export interface CursorPaging {
599
+ /** Number of items to load. */
600
+ limit?: number | null;
601
+ /**
602
+ * Pointer to the next or previous page in the list of results.
603
+ *
604
+ * You can get the relevant cursor token
605
+ * from the `pagingMetadata` object in the previous call's response.
606
+ * Not relevant for the first request.
607
+ */
608
+ cursor?: string | null;
609
+ }
610
+ export interface QueryOrdersResponse {
611
+ /** Order data. */
612
+ plans?: Order[];
613
+ /** Paging-related data (number of orders returned, offset). */
614
+ pagingMetadata?: PagingMetadataV2;
615
+ }
616
+ export interface PagingMetadataV2 {
617
+ /** Number of items returned in the response. */
618
+ count?: number | null;
619
+ /** Offset that was requested. */
620
+ offset?: number | null;
621
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
622
+ total?: number | null;
623
+ /** Flag that indicates the server failed to calculate the `total` field. */
624
+ tooManyToCount?: boolean | null;
625
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
626
+ cursors?: Cursors;
627
+ }
628
+ export interface Cursors {
629
+ /** Cursor pointing to next page in the list of results. */
630
+ next?: string | null;
631
+ /** Cursor pointing to previous page in the list of results. */
632
+ prev?: string | null;
633
+ }
634
+ export interface RequestCancellationRequest {
635
+ /** Order ID. */
636
+ _id: string;
637
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
638
+ effectiveAt?: CancellationEffectiveAt;
639
+ }
640
+ export interface RequestCancellationResponse {
641
+ }
642
+ /**
643
+ * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
644
+ *
645
+ * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
646
+ */
647
+ export interface OrderCanceled {
648
+ /** Canceled order. */
649
+ order?: Order;
650
+ }
651
+ export interface CreateOnlineOrderRequest {
652
+ /** Plan ID. */
653
+ planId?: string;
654
+ /**
655
+ * Start date for the ordered plan.
656
+ *
657
+ * Default: Current date
658
+ */
659
+ startDate?: Date;
660
+ /** Coupon code to apply. */
661
+ couponCode?: string | null;
662
+ /** Provided if checkout is initiated on buyer's behalf. */
663
+ onBehalf?: OnBehalf;
664
+ /** Form submission id that was submitted together with the order */
665
+ submissionId?: string | null;
666
+ }
667
+ export interface OnBehalf {
668
+ /** Member ID. */
669
+ memberId?: string;
670
+ /** Method by which checkout is initiated on buyer's behalf */
671
+ orderMethod?: OrderMethod;
672
+ }
673
+ export interface CreateOnlineOrderResponse {
674
+ /** Order. */
675
+ order?: Order;
676
+ }
677
+ export interface CouponsError {
678
+ couponCode?: string;
679
+ planId?: string;
680
+ }
681
+ export interface CreateGuestOnlineOrderRequest {
682
+ /** Plan ID. */
683
+ planId?: string;
684
+ /**
685
+ * Start date for the ordered plan.
686
+ *
687
+ * Default: Current date
688
+ */
689
+ startDate?: Date;
690
+ /** Coupon code to apply. */
691
+ couponCode?: string | null;
692
+ /** Captcha data to prove you are not a robot */
693
+ captcha?: Captcha;
694
+ /** Visitor info */
695
+ guest?: Guest;
696
+ /** Form submission id that was submitted together with the order */
697
+ submissionId?: string | null;
698
+ }
699
+ export interface Captcha {
700
+ /** Token from captcha */
701
+ token?: string;
702
+ }
703
+ export interface Guest {
704
+ /** Email for checkout */
705
+ email?: string;
706
+ }
707
+ export interface CreateGuestOnlineOrderResponse {
708
+ /** Order. */
709
+ order?: Order;
710
+ }
711
+ export interface CreateOfflineOrderRequest {
712
+ /** ID of the plan being ordered. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
713
+ planId: string;
714
+ /** ID of the member ordering the plan. See [Members for more information about member IDs](https://dev.wix.com/api/rest/members/members). */
715
+ memberId: string;
716
+ /**
717
+ * Start date and time for the ordered plan.
718
+ *
719
+ * Default: Current date and time
720
+ */
721
+ startDate?: Date;
722
+ /**
723
+ * Whether the order is paid.
724
+ *
725
+ * Default: `false`
726
+ */
727
+ paid?: boolean | null;
728
+ /**
729
+ * Coupon code to apply.
730
+ *
731
+ * See [Coupons to learn more](https://dev.wix.com/api/rest/coupons).
732
+ */
733
+ couponCode?: string | null;
734
+ /** Form submission id that was submitted together with the order */
735
+ submissionId?: string | null;
736
+ }
737
+ export interface CreateOfflineOrderResponse {
738
+ /** Order. */
739
+ order?: Order;
740
+ }
741
+ export interface GetOnlineOrderPreviewRequest {
742
+ /** Plan ID. */
743
+ planId?: string;
744
+ /**
745
+ * Start date for the ordered plan.
746
+ *
747
+ * Default: Current date
748
+ */
749
+ startDate?: Date;
750
+ /** Coupon code to apply. */
751
+ couponCode?: string | null;
752
+ }
753
+ export interface GetOnlineOrderPreviewResponse {
754
+ /** Will be missing if limit is exceeded */
755
+ order?: Order;
756
+ /**
757
+ * Whether the purchase limit has already been reached for this plan by this member.
758
+ * Always false for plans without purchase limits.
759
+ */
760
+ purchaseLimitExceeded?: boolean;
761
+ }
762
+ export interface GetGuestOnlineOrderPreviewRequest {
763
+ /** Plan ID. */
764
+ planId?: string;
765
+ /**
766
+ * Start date for the ordered plan.
767
+ *
768
+ * Default: Current date
769
+ */
770
+ startDate?: Date;
771
+ /** Coupon code to apply. */
772
+ couponCode?: string | null;
773
+ email?: string;
774
+ }
775
+ export interface GetGuestOnlineOrderPreviewResponse {
776
+ /** Will be missing if limit is exceeded */
777
+ order?: Order;
778
+ /**
779
+ * Whether the purchase limit has already been reached for this plan by this email.
780
+ * Always false for plans without purchase limits.
781
+ */
782
+ purchaseLimitExceeded?: boolean;
783
+ }
784
+ export interface GetOfflineOrderPreviewRequest {
785
+ /** ID of the plan of the previewed order. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
786
+ planId: string;
787
+ /** Member ID of the buyer the previewed order is for. See [Members for more information about member IDs](https://dev.wix.com/api/rest/members/members). */
788
+ memberId: string;
789
+ /**
790
+ * Start date and time for plan of the previewed order.
791
+ *
792
+ * Default: Current date and time
793
+ */
794
+ startDate?: Date;
795
+ /** Coupon code to apply. See [Coupons to learn more](https://dev.wix.com/api/rest/coupons). */
796
+ couponCode?: string | null;
797
+ }
798
+ export interface GetOfflineOrderPreviewResponse {
799
+ /** The previewed order, as if the plan had been ordered. */
800
+ order?: Order;
801
+ /**
802
+ * Whether this previewed order would exceed the permitted amount of purchases available
803
+ * for this plan for this buyer.
804
+ *
805
+ * Always `false` for plans that do not have purchase limits.
806
+ */
807
+ purchaseLimitExceeded?: boolean;
808
+ }
809
+ export interface GetPricePreviewRequest {
810
+ /** ID of plan to preview. */
811
+ planId: string;
812
+ /**
813
+ * Coupon code to apply.
814
+ *
815
+ * See Coupons [to learn more](https://dev.wix.com/api/rest/coupons).
816
+ */
817
+ couponCode?: string | null;
818
+ }
819
+ export interface GetPricePreviewResponse {
820
+ /** __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022. */
821
+ price?: PriceDetails;
822
+ /** Pricing details. */
823
+ prices?: SpannedPrice[];
824
+ }
825
+ export interface ChangeStartDateRequest {
826
+ /** Draft order ID. */
827
+ orderId?: string;
828
+ /** New valid from date (timestamp). */
829
+ startDate?: Date;
830
+ }
831
+ export interface ChangeStartDateResponse {
832
+ /** Updated draft order. */
833
+ order?: Order;
834
+ }
835
+ export interface OrderStartDateChanged {
836
+ /** Order whose `startDate` changed. */
837
+ order?: Order;
838
+ }
839
+ export interface ApplyCouponRequest {
840
+ /** Draft order ID. */
841
+ orderId?: string;
842
+ /** Coupon code to apply. */
843
+ couponCode?: string;
844
+ }
845
+ export interface ApplyCouponResponse {
846
+ /** Order with applied coupon and recalculated tax. */
847
+ order?: Order;
848
+ }
849
+ export interface SetSubmissionRequest {
850
+ orderId?: string;
851
+ submissionId?: string;
852
+ }
853
+ export interface SetSubmissionResponse {
854
+ /** Order with submission id */
855
+ order?: Order;
856
+ }
857
+ export interface OrderPurchased {
858
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
859
+ order?: Order;
860
+ }
861
+ export interface OrderStarted {
862
+ /** Order that reached its `startDate`. */
863
+ order?: Order;
864
+ }
865
+ /**
866
+ * Triggered at the start of a new payment cycle for an existing order.
867
+ *
868
+ * This webhook does not trigger at the initial start of an offline order.
869
+ */
870
+ export interface OrderCycleStarted {
871
+ /** Order whose new cycle started. */
872
+ order?: Order;
873
+ /** 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. */
874
+ cycleNumber?: number;
875
+ }
876
+ /** Emitted when a recurring order is canceled for the next payment cycle */
877
+ export interface OrderAutoRenewCanceled {
878
+ /** Order that is canceled, effective at the end of the current payment cycle. */
879
+ order?: Order;
880
+ }
881
+ export interface OrderEnded {
882
+ /** Order that ended. */
883
+ order?: Order;
884
+ }
885
+ export interface GetOrderRequest {
886
+ /** Order ID. */
887
+ _id: string;
888
+ fieldSet?: Set;
889
+ }
890
+ export interface GetOrderResponse {
891
+ /** Order. */
892
+ order?: Order;
893
+ }
894
+ export interface ListOrdersRequest {
895
+ /** Filter by a buyer's member ID. See [Members to learn more about a site's members](https://dev.wix.com/api/rest/members/members). */
896
+ buyerIds?: string[];
897
+ /** Filter by plan IDs. See [Plans to learn more about pricing plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
898
+ planIds?: string[];
899
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
900
+ autoRenewCanceled?: boolean | null;
901
+ /** Filter by order status. */
902
+ orderStatuses?: OrderStatus[];
903
+ /** Filter by payment status. */
904
+ paymentStatuses?: PaymentStatus[];
905
+ /**
906
+ * Number of orders to return. See [Pagination](https://dev.wix.com/api/rest/getting-started/sorting-and-paging#getting-started_sorting-and-paging_paging) for more information.
907
+ *
908
+ * Max: `50`
909
+ */
910
+ limit?: number | null;
911
+ /** Number of orders to skip in the current sort order. */
912
+ offset?: number | null;
913
+ /**
914
+ * Sort order.
915
+ *
916
+ * Use `ASC` for ascending order or `DESC` for descending order.
917
+ *
918
+ * Default: `DESC`
919
+ */
920
+ sorting?: Sorting;
921
+ }
922
+ export interface ListOrdersResponse {
923
+ /** List of orders. */
924
+ orders?: Order[];
925
+ }
926
+ export interface OrdersQueryOrdersRequest {
927
+ /** [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
928
+ query?: QueryV2;
929
+ }
930
+ export interface OrdersQueryOrdersResponse {
931
+ /** Retrieved orders. */
932
+ plans?: Order[];
933
+ /** Paging-related data (number of orders returned, offset). */
934
+ pagingMetadata?: PagingMetadataV2;
935
+ }
936
+ export interface GetOrdersStatsRequest {
937
+ }
938
+ export interface GetOrdersStatsResponse {
939
+ /** Total number of orders. */
940
+ totalOrderCount?: number;
941
+ /** Number of active orders. */
942
+ activeOrderCount?: number;
943
+ }
944
+ export interface GetAvailableOrderActionsRequest {
945
+ /** Order ID. */
946
+ _id?: string;
947
+ }
948
+ export interface GetAvailableOrderActionsResponse {
949
+ /** Whether the order can be suspended. */
950
+ suspendable?: boolean;
951
+ /** If the order cannot be suspended, a reason is returned here. */
952
+ notSuspendableReason?: ReasonNotSuspendable;
953
+ /** Whether the order can be canceled by the buyer. */
954
+ cancelableByBuyer?: boolean;
955
+ }
956
+ export declare enum ReasonNotSuspendable {
957
+ /** Reason unknown */
958
+ UNDEFINED = "UNDEFINED",
959
+ /** Saved in the database but is awaiting payment. Non-active orders cannot be suspended */
960
+ PENDING = "PENDING",
961
+ /** Trial orders cannot be suspended */
962
+ TRIAL = "TRIAL",
963
+ /** Canceled orders cannot be suspended */
964
+ CANCELED = "CANCELED",
965
+ /** Ended orders cannot be suspended */
966
+ ENDED = "ENDED",
967
+ /** Paid for orders with future start dates cannot be suspended */
968
+ NOT_STARTED = "NOT_STARTED",
969
+ /** Order is already suspended */
970
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
971
+ /** Orders based on recurring payments using older Stripe versions cannot be suspended */
972
+ OLD_STRIPE = "OLD_STRIPE"
973
+ }
974
+ export interface PostponeEndDateRequest {
975
+ /** Order ID. */
976
+ _id: string;
977
+ /**
978
+ * New end date and time.
979
+ *
980
+ * Must be later than the current end date and time.
981
+ */
982
+ endDate?: Date;
983
+ }
984
+ export interface PostponeEndDateResponse {
985
+ }
986
+ export interface OrderEndDatePostponed {
987
+ /** Order whose `endDate` was postponed. */
988
+ order?: Order;
989
+ }
990
+ export interface CancelOrderRequest {
991
+ /** Order ID. */
992
+ _id: string;
993
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
994
+ effectiveAt?: CancellationEffectiveAt;
995
+ }
996
+ export interface CancelOrderResponse {
997
+ }
998
+ export interface MarkAsPaidRequest {
999
+ /** Order ID. */
1000
+ _id: string;
1001
+ }
1002
+ export interface MarkAsPaidResponse {
1003
+ }
1004
+ export interface OrderMarkedAsPaid {
1005
+ /** Order that was marked as paid. */
1006
+ order?: Order;
1007
+ }
1008
+ export interface PauseOrderRequest {
1009
+ /** Order ID. */
1010
+ _id: string;
1011
+ }
1012
+ export interface PauseOrderResponse {
1013
+ }
1014
+ export interface OrderPaused {
1015
+ /** Paused order. */
1016
+ order?: Order;
1017
+ }
1018
+ export interface BulkPauseOrderRequest {
1019
+ /** List of Order IDs. */
1020
+ ids?: string[];
1021
+ /** Set to true to return Order entity in response. */
1022
+ returnFullEntity?: boolean;
1023
+ }
1024
+ export interface BulkPauseOrderResponse {
1025
+ results?: BulkOrderResult[];
1026
+ bulkActionMetadata?: BulkActionMetadata;
1027
+ }
1028
+ export interface BulkOrderResult {
1029
+ itemMetadata?: ItemMetadata;
1030
+ order?: Order;
1031
+ }
1032
+ export interface ItemMetadata {
1033
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1034
+ _id?: string | null;
1035
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1036
+ originalIndex?: number;
1037
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1038
+ success?: boolean;
1039
+ /** Details about the error in case of failure. */
1040
+ error?: ApplicationError;
1041
+ }
1042
+ export interface ApplicationError {
1043
+ /** Error code. */
1044
+ code?: string;
1045
+ /** Description of the error. */
1046
+ description?: string;
1047
+ /** Data related to the error. */
1048
+ data?: Record<string, any> | null;
1049
+ }
1050
+ export interface BulkActionMetadata {
1051
+ /** Number of items that were successfully processed. */
1052
+ totalSuccesses?: number;
1053
+ /** Number of items that couldn't be processed. */
1054
+ totalFailures?: number;
1055
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1056
+ undetailedFailures?: number;
1057
+ }
1058
+ export interface ResumeOrderRequest {
1059
+ /** Order ID. */
1060
+ _id: string;
1061
+ }
1062
+ export interface ResumeOrderResponse {
1063
+ }
1064
+ export interface OrderResumed {
1065
+ /** Resumed order. */
1066
+ order?: Order;
1067
+ }
1068
+ export interface BulkResumeOrderRequest {
1069
+ /** List of Order IDs. */
1070
+ ids?: string[];
1071
+ /** Set to true to return Order entity in response. */
1072
+ returnFullEntity?: boolean;
1073
+ }
1074
+ export interface BulkResumeOrderResponse {
1075
+ results?: BulkOrderResult[];
1076
+ bulkActionMetadata?: BulkActionMetadata;
1077
+ }
1078
+ /**
1079
+ * Retrieves an order by ID.
1080
+ * @param _id - Order ID.
1081
+ * @public
1082
+ * @documentationMaturity preview
1083
+ * @requiredField _id
1084
+ */
1085
+ export declare function memberGetOrder(_id: string, options?: MemberGetOrderOptions): Promise<MemberGetOrderResponse>;
1086
+ export interface MemberGetOrderOptions {
1087
+ fieldSet?: Set;
1088
+ }
1089
+ /**
1090
+ * Returns orders for currently logged in member.
1091
+ * @public
1092
+ * @documentationMaturity preview
1093
+ */
1094
+ export declare function memberListOrders(options?: MemberListOrdersOptions): Promise<MemberListOrdersResponse>;
1095
+ export interface MemberListOrdersOptions {
1096
+ /** Filter by plan IDs. */
1097
+ planIds?: string[];
1098
+ /** Filter for orders where auto renewal was canceled. */
1099
+ autoRenewCanceled?: boolean | null;
1100
+ /** Filter by order status. */
1101
+ orderStatuses?: OrderStatus[];
1102
+ /** Filter by payment status. */
1103
+ paymentStatuses?: PaymentStatus[];
1104
+ /** Limit the number of pricing plans returned. Default limit is 50. */
1105
+ limit?: number | null;
1106
+ /** Number of entries to offset. */
1107
+ offset?: number | null;
1108
+ /** Sorting direction (defaults to ASC) and field to sort by. [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
1109
+ sorting?: Sorting;
1110
+ }
1111
+ /**
1112
+ * Cancels an order. Recurring orders can be canceled either immediately or at the next payment date.
1113
+ * One time orders can only be canceled immediately.
1114
+ * @param _id - Order ID.
1115
+ * @public
1116
+ * @documentationMaturity preview
1117
+ * @requiredField _id
1118
+ */
1119
+ export declare function requestCancellation(_id: string, options?: RequestCancellationOptions): Promise<void>;
1120
+ export interface RequestCancellationOptions {
1121
+ /** Required. Whether to cancel the order effective immediately or at the next payment date. One-time orders can only be canceled immediately. */
1122
+ effectiveAt?: CancellationEffectiveAt;
1123
+ }
1124
+ /**
1125
+ * Creates an order for a buyer who purchased the plan with an offline transaction.
1126
+ *
1127
+ * An offline order is handled off of the Wix site and is marked as `offline` in `type`. If a pricing plan
1128
+ * has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
1129
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
1130
+ *
1131
+ * Handle payment for an offline order in 1 of 2 ways:
1132
+ * + When creating the order, select `true` in the `paid` request parameter.
1133
+ * + After creation, use [Mark As Paid to mark the order as paid](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/mark-as-paid).
1134
+ * @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
1135
+ * @public
1136
+ * @documentationMaturity preview
1137
+ * @requiredField options.memberId
1138
+ * @requiredField planId
1139
+ */
1140
+ export declare function createOfflineOrder(planId: string, options?: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse>;
1141
+ export interface CreateOfflineOrderOptions {
1142
+ /** ID of the member ordering the plan. See [Members for more information about member IDs](https://dev.wix.com/api/rest/members/members). */
1143
+ memberId: string;
1144
+ /**
1145
+ * Start date and time for the ordered plan.
1146
+ *
1147
+ * Default: Current date and time
1148
+ */
1149
+ startDate?: Date;
1150
+ /**
1151
+ * Whether the order is paid.
1152
+ *
1153
+ * Default: `false`
1154
+ */
1155
+ paid?: boolean | null;
1156
+ /**
1157
+ * Coupon code to apply.
1158
+ *
1159
+ * See [Coupons to learn more](https://dev.wix.com/api/rest/coupons).
1160
+ */
1161
+ couponCode?: string | null;
1162
+ /** Form submission id that was submitted together with the order */
1163
+ submissionId?: string | null;
1164
+ }
1165
+ /**
1166
+ * Performs a dry run of a purchase and provides an order preview.
1167
+ *
1168
+ * The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
1169
+ * created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
1170
+ * (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
1171
+ * <br>
1172
+ * If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
1173
+ * But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
1174
+ * `purchaseLimitExceeded` will return as `true`.
1175
+ *
1176
+ * To get a general price preview for a plan that's not buyer-specific, use [Get Price Preview](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/get-price-preview).
1177
+ * @param planId - ID of the plan of the previewed order. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
1178
+ * @public
1179
+ * @documentationMaturity preview
1180
+ * @requiredField options.memberId
1181
+ * @requiredField planId
1182
+ */
1183
+ export declare function getOfflineOrderPreview(planId: string, options?: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse>;
1184
+ export interface GetOfflineOrderPreviewOptions {
1185
+ /** Member ID of the buyer the previewed order is for. See [Members for more information about member IDs](https://dev.wix.com/api/rest/members/members). */
1186
+ memberId: string;
1187
+ /**
1188
+ * Start date and time for plan of the previewed order.
1189
+ *
1190
+ * Default: Current date and time
1191
+ */
1192
+ startDate?: Date;
1193
+ /** Coupon code to apply. See [Coupons to learn more](https://dev.wix.com/api/rest/coupons). */
1194
+ couponCode?: string | null;
1195
+ }
1196
+ /**
1197
+ * Retrieves a plan's pricing.
1198
+ *
1199
+ * The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
1200
+ * the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
1201
+ * in the [pricing model](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models) format used for orders.
1202
+ *
1203
+ * Buyers do not have to be logged in to preview the price, as such, the details returned are not buyer-specific. To
1204
+ * generate a preview of a purchase for a specific buyer, use [Get Offline Order Preview](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/get-offline-order-preview).
1205
+ * @param planId - ID of plan to preview.
1206
+ * @public
1207
+ * @documentationMaturity preview
1208
+ * @requiredField planId
1209
+ */
1210
+ export declare function getPricePreview(planId: string, options?: GetPricePreviewOptions): Promise<GetPricePreviewResponse>;
1211
+ export interface GetPricePreviewOptions {
1212
+ /**
1213
+ * Coupon code to apply.
1214
+ *
1215
+ * See Coupons [to learn more](https://dev.wix.com/api/rest/coupons).
1216
+ */
1217
+ couponCode?: string | null;
1218
+ }
1219
+ /**
1220
+ * Retrieves an order by ID.
1221
+ * @param _id - Order ID.
1222
+ * @public
1223
+ * @documentationMaturity preview
1224
+ * @requiredField _id
1225
+ */
1226
+ export declare function managementGetOrder(_id: string, options?: ManagementGetOrderOptions): Promise<GetOrderResponse>;
1227
+ export interface ManagementGetOrderOptions {
1228
+ fieldSet?: Set;
1229
+ }
1230
+ /**
1231
+ * Retrieves a list of orders and details, given the provided sorting and filtering.
1232
+ *
1233
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
1234
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
1235
+ * @public
1236
+ * @documentationMaturity preview
1237
+ */
1238
+ export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse>;
1239
+ export interface ManagementListOrdersOptions {
1240
+ /** Filter by a buyer's member ID. See [Members to learn more about a site's members](https://dev.wix.com/api/rest/members/members). */
1241
+ buyerIds?: string[];
1242
+ /** Filter by plan IDs. See [Plans to learn more about pricing plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
1243
+ planIds?: string[];
1244
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1245
+ autoRenewCanceled?: boolean | null;
1246
+ /** Filter by order status. */
1247
+ orderStatuses?: OrderStatus[];
1248
+ /** Filter by payment status. */
1249
+ paymentStatuses?: PaymentStatus[];
1250
+ /**
1251
+ * Number of orders to return. See [Pagination](https://dev.wix.com/api/rest/getting-started/sorting-and-paging#getting-started_sorting-and-paging_paging) for more information.
1252
+ *
1253
+ * Max: `50`
1254
+ */
1255
+ limit?: number | null;
1256
+ /** Number of orders to skip in the current sort order. */
1257
+ offset?: number | null;
1258
+ /**
1259
+ * Sort order.
1260
+ *
1261
+ * Use `ASC` for ascending order or `DESC` for descending order.
1262
+ *
1263
+ * Default: `DESC`
1264
+ */
1265
+ sorting?: Sorting;
1266
+ }
1267
+ /**
1268
+ * Extends the duration of a pricing plan order by postponing the order's `endDate`.
1269
+ *
1270
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
1271
+ * Can't postpone an order while it is [`PAUSED`](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/pause-order).
1272
+ * @param _id - Order ID.
1273
+ * @public
1274
+ * @documentationMaturity preview
1275
+ * @requiredField _id
1276
+ */
1277
+ export declare function postponeEndDate(_id: string, options?: PostponeEndDateOptions): Promise<void>;
1278
+ export interface PostponeEndDateOptions {
1279
+ /**
1280
+ * New end date and time.
1281
+ *
1282
+ * Must be later than the current end date and time.
1283
+ */
1284
+ endDate?: Date;
1285
+ }
1286
+ /**
1287
+ * Cancels an existing order.
1288
+ *
1289
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
1290
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
1291
+ *
1292
+ * #### Canceling during the free trial period.
1293
+ *
1294
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
1295
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
1296
+ * of the free trial period.
1297
+ *
1298
+ * When a site owner cancels an ordered plan during the free trial period, they choose to apply the cancellation
1299
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
1300
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
1301
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
1302
+ * Then, the subscription ends and the buyer is not billed.
1303
+ * @param _id - Order ID.
1304
+ * @public
1305
+ * @documentationMaturity preview
1306
+ * @requiredField _id
1307
+ */
1308
+ export declare function cancelOrder(_id: string, options?: CancelOrderOptions): Promise<void>;
1309
+ export interface CancelOrderOptions {
1310
+ /** __Required.__ When the order will be canceled. One-time orders can only be canceled `IMMEDIATELY`. */
1311
+ effectiveAt?: CancellationEffectiveAt;
1312
+ }
1313
+ /**
1314
+ * Marks an offline order as paid.
1315
+ * > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid.
1316
+ * @param _id - Order ID.
1317
+ * @public
1318
+ * @documentationMaturity preview
1319
+ * @requiredField _id
1320
+ */
1321
+ export declare function markAsPaid(_id: string): Promise<void>;
1322
+ /**
1323
+ * Pauses an order.
1324
+ *
1325
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
1326
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`. Can only pause orders with an `ACTIVE` status.
1327
+ *
1328
+ * Use [Resume Order to resume a paused order](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/resume-order/).
1329
+ * @param _id - Order ID.
1330
+ * @public
1331
+ * @documentationMaturity preview
1332
+ * @requiredField _id
1333
+ */
1334
+ export declare function pauseOrder(_id: string): Promise<void>;
1335
+ /**
1336
+ * Resumes a paused order.
1337
+ *
1338
+ * Updates `endDate` by adding the time the plan was paused.
1339
+ * For orders with recurring payments, it also restarts the payment schedule.
1340
+ * Use [Pause Order to pause an order](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/orders/pause-order/).
1341
+ * @param _id - Order ID.
1342
+ * @public
1343
+ * @documentationMaturity preview
1344
+ * @requiredField _id
1345
+ */
1346
+ export declare function resumeOrder(_id: string): Promise<void>;