@wix/pricing-plans 1.0.70 → 1.0.72

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.
@@ -0,0 +1,3551 @@
1
+ /**
2
+ * An order object includes all of the details related to the purchase of a Pricing Plan.
3
+ * You can manage existing orders, create offline orders, and preview orders not yet purchased.
4
+ *
5
+ * Orders are based on pricing models based on the payment and duration cycles for each plan. See here to
6
+ * [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).
7
+ */
8
+ interface Order {
9
+ /**
10
+ * Order ID.
11
+ * @readonly
12
+ */
13
+ _id?: string;
14
+ /**
15
+ * ID of the plan purchased with the order.
16
+ * @readonly
17
+ */
18
+ planId?: string;
19
+ /**
20
+ * ID of the related Wix subscription.
21
+ *
22
+ * Every pricing plan order corresponds to a Wix subscription, including orders for single payment plans. See a [Pricing Plans overview](https://support.wix.com/en/article/pricing-plans-an-overview#create-plans-to-suit-your-business).
23
+ * @readonly
24
+ */
25
+ subscriptionId?: string;
26
+ /**
27
+ * Wix Pay order ID.
28
+ *
29
+ * Provided by Wix whether the order is created online or offline. The field is omitted when the order is free.
30
+ * @readonly
31
+ */
32
+ wixPayOrderId?: string | null;
33
+ /**
34
+ * The buyer's IDs. Includes `memberId` and `contactId`.
35
+ *
36
+ * Currently, Pricing Plan purchases are limited to members only. `contactId` is returned,
37
+ * but a buyer will not be able to purchase a plan without a `memberId`.
38
+ * @readonly
39
+ */
40
+ buyer?: Buyer;
41
+ /**
42
+ * @internal
43
+ * @internal
44
+ * @readonly
45
+ * @deprecated __Deprecated.__ Use `pricing` instead. This property will be removed on September 30, 2022.
46
+ * @replacedBy pricing
47
+ * @removalDate 2022-10-01
48
+ */
49
+ priceDetails?: PriceDetails;
50
+ /**
51
+ * Pricing model, price, and payment schedule for the order.
52
+ * @readonly
53
+ */
54
+ pricing?: PricingDetails;
55
+ /**
56
+ * How the order was processed. Supported values:
57
+ * + `"ONLINE"`: The buyer purchased the plan using the site.
58
+ * + `"OFFLINE"`: The buyer made a manual, offline purchase without using the site.
59
+ * @readonly
60
+ */
61
+ type?: OrderType;
62
+ /**
63
+ * Status of the order. Supported values:
64
+ * + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
65
+ * + `PENDING`: Order has been purchased and its start date is set in the future.
66
+ * + `ACTIVE`: Order has been processed. The plan is available for use.
67
+ * + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
68
+ * + `ENDED`: Order has completed its duration and is no longer available for use.
69
+ * + `CANCELED`: Order has been [canceled](#cancelorder).
70
+ * @readonly
71
+ */
72
+ status?: OrderStatus;
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
+ *
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 site owner for offline orders.
90
+ *
91
+ * Supported values:
92
+ * + `PAID`: The last payment was paid.
93
+ * + `REFUNDED`: The last payment was refunded.
94
+ * + `FAILED`: The last payment transaction didn't complete.
95
+ * + `UNPAID`: The last payment wasn't paid.
96
+ * + `PENDING`: Awaiting payment.
97
+ * + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
98
+ * @readonly
99
+ */
100
+ lastPaymentStatus?: PaymentStatus;
101
+ /**
102
+ * Start date and time for the ordered plan.
103
+ * @readonly
104
+ */
105
+ startDate?: Date;
106
+ /**
107
+ * Current end date and time for the ordered plan.
108
+ *
109
+ * `endDate` may be updated over the course of an order. If the order is [paused](#pauseorder),
110
+ * it will have a later `endDate` once it [resumes](#resumeorder). `endDate` may also be [postponed](#postponeenddate).
111
+ *
112
+ * Omitted if the order is valid until canceled and still `ACTIVE`.
113
+ * @readonly
114
+ */
115
+ endDate?: Date;
116
+ /**
117
+ * List of periods during which the order is paused.
118
+ * @readonly
119
+ */
120
+ pausePeriods?: PausePeriod[];
121
+ /**
122
+ * Free trial period for the order, in days.
123
+ *
124
+ * Only available for recurring plans.
125
+ * @readonly
126
+ */
127
+ freeTrialDays?: number | null;
128
+ /**
129
+ * Earliest end date and time that the plan for the order can expire.
130
+ *
131
+ * Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
132
+ * @readonly
133
+ */
134
+ earliestEndDate?: Date;
135
+ /**
136
+ * Current payment cycle for the order.
137
+ *
138
+ * `currentCycle` will be omitted if the order's status is `CANCELED` or `ENDED`, or if the `startDate` hasn't passed yet.
139
+ * @readonly
140
+ */
141
+ currentCycle?: CurrentCycle;
142
+ /**
143
+ * Plan name at the time of purchase.
144
+ * @readonly
145
+ */
146
+ planName?: string;
147
+ /**
148
+ * Plan description at the time of purchase
149
+ * @readonly
150
+ */
151
+ planDescription?: string;
152
+ /**
153
+ * Plan price as it was at the moment of order creation.
154
+ * @readonly
155
+ */
156
+ planPrice?: string;
157
+ /**
158
+ * Date and time the order was created.
159
+ * @readonly
160
+ */
161
+ _createdDate?: Date;
162
+ /**
163
+ * Date and time the order was updated.
164
+ * @readonly
165
+ */
166
+ _updatedDate?: Date;
167
+ /**
168
+ * Information about the form submitted during the plan's checkout.
169
+ * @readonly
170
+ */
171
+ formData?: FormData;
172
+ }
173
+ interface Buyer {
174
+ /**
175
+ * Member ID for a buyer.
176
+ * @readonly
177
+ */
178
+ memberId?: string;
179
+ /**
180
+ * Contact ID for a buyer.
181
+ * @readonly
182
+ */
183
+ contactId?: string;
184
+ }
185
+ interface PriceDetails extends PriceDetailsPricingModelOneOf {
186
+ /** Order has recurring payments. */
187
+ subscription?: Recurrence$1;
188
+ /** One-time payment. Order is valid for a specified duration. */
189
+ singlePaymentForDuration?: Duration$1;
190
+ /** One-time payment. Order is valid until it is canceled. */
191
+ singlePaymentUnlimited?: boolean | null;
192
+ /** Price of the order excluding tax, specified as a monetary amount. for example, `"9.99"`. */
193
+ subtotal?: string;
194
+ /** Total discount applied. */
195
+ discount?: string;
196
+ /** Tax applied. */
197
+ tax?: Tax;
198
+ /**
199
+ * Price after tax and discount is applied, specified as a monetary amount. For example, `"13.98"`.
200
+ *
201
+ * If no tax is applied, the amount is the same as `subtotal`.
202
+ */
203
+ total?: string;
204
+ /** Plan price as it was at the moment of order creation. */
205
+ planPrice?: string;
206
+ /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
207
+ currency?: string;
208
+ /** Free trial period for the order in days. Only available for recurring plans. */
209
+ freeTrialDays?: number | null;
210
+ /** Coupon applied to the order. Empty means no coupon was applied. */
211
+ coupon?: Coupon;
212
+ }
213
+ /** @oneof */
214
+ interface PriceDetailsPricingModelOneOf {
215
+ /** Order has recurring payments. */
216
+ subscription?: Recurrence$1;
217
+ /** One-time payment. Order is valid for a specified duration. */
218
+ singlePaymentForDuration?: Duration$1;
219
+ /** One-time payment. Order is valid until it is canceled. */
220
+ singlePaymentUnlimited?: boolean | null;
221
+ }
222
+ interface Tax {
223
+ /** Name of the tax. For example, VAT. */
224
+ name?: string;
225
+ /** Whether tax is included in the original price. When `false`, tax is added at checkout. */
226
+ includedInPrice?: boolean;
227
+ /** Tax rate percentage, as a number between 0 and 100. For example, a 7% tax rate is `"7.00"`. */
228
+ rate?: string;
229
+ /** Total tax, specified as a monetary amount. For example, `"3.99"`. */
230
+ amount?: string;
231
+ }
232
+ /** An object specifying how often and for how long payments recur (may be forever). */
233
+ interface Recurrence$1 {
234
+ /** Length of one payment cycle. */
235
+ cycleDuration?: Duration$1;
236
+ /**
237
+ * Amount of payment cycles this subscription is valid for.
238
+ *
239
+ * `0` for unlimited or until-canceled.
240
+ */
241
+ cycleCount?: number | null;
242
+ }
243
+ /** A duration expressed in number of time units. */
244
+ interface Duration$1 {
245
+ /**
246
+ * The amount of a duration `unit` in a single payment cycle.
247
+ *
248
+ * Currently limited to support only `1`.
249
+ */
250
+ count?: number | null;
251
+ /** Unit of time for the cycle duration. */
252
+ unit?: PeriodUnit$1;
253
+ }
254
+ declare enum PeriodUnit$1 {
255
+ UNDEFINED = "UNDEFINED",
256
+ DAY = "DAY",
257
+ WEEK = "WEEK",
258
+ MONTH = "MONTH",
259
+ YEAR = "YEAR"
260
+ }
261
+ interface Coupon {
262
+ /** Code of the applied coupon. */
263
+ code?: string;
264
+ /** Total discount of the coupon, as a monetary amount. */
265
+ amount?: string;
266
+ /**
267
+ * Coupon ID.
268
+ * @readonly
269
+ */
270
+ _id?: string;
271
+ }
272
+ interface PricingDetails extends PricingDetailsPricingModelOneOf {
273
+ /** Pricing model for an order with recurring payment cycles. */
274
+ subscription?: Recurrence$1;
275
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
276
+ singlePaymentForDuration?: Duration$1;
277
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
278
+ singlePaymentUnlimited?: boolean | null;
279
+ /**
280
+ * Pricing details for all pricing models.
281
+ * @readonly
282
+ */
283
+ prices?: SpannedPrice[];
284
+ }
285
+ /** @oneof */
286
+ interface PricingDetailsPricingModelOneOf {
287
+ /** Pricing model for an order with recurring payment cycles. */
288
+ subscription?: Recurrence$1;
289
+ /** Pricing model for an order with a one-time payment and the order is valid for a specific amount of time. */
290
+ singlePaymentForDuration?: Duration$1;
291
+ /** Pricing model for an order with a one-time payment and the order is valid until canceled. */
292
+ singlePaymentUnlimited?: boolean | null;
293
+ }
294
+ interface SpannedPrice {
295
+ /**
296
+ * Cycle duration to apply `price` for.
297
+ *
298
+ * Use with all pricing models.
299
+ * Can apply the same price to multiple payment cycles.
300
+ */
301
+ duration?: PriceDuration;
302
+ /** Order price. */
303
+ price?: Price;
304
+ }
305
+ interface PriceDuration {
306
+ /**
307
+ * Price starts to apply with this cycle.
308
+ *
309
+ * `1` is the first payment cycle for all pricing models.
310
+ */
311
+ cycleFrom?: number;
312
+ /**
313
+ * Amount of cycles to apply price for.
314
+ *
315
+ * For `subscription` pricing models with a finite number of cycles, the `numberOfCycles` is the same as `pricing.subscription.cycleCount`.
316
+ *
317
+ * For `subscription` pricing models that are unlimited or until-canceled, the `numberOfCycles` is not returned.
318
+ *
319
+ * For `singlePaymentForDuration` and `singlePaymentUnlimited` pricing models, the `numberOfCycles` is `1`.
320
+ */
321
+ numberOfCycles?: number | null;
322
+ }
323
+ interface Price {
324
+ /** Price of the order excluding tax, specified as a monetary amount. For example, `"9.99"`. */
325
+ subtotal?: string;
326
+ /** Coupon applied to the order. */
327
+ coupon?: Coupon;
328
+ /** Total discount applied to the order. */
329
+ discount?: string;
330
+ /**
331
+ * Tax applied to the order.
332
+ *
333
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
334
+ */
335
+ tax?: Tax;
336
+ /**
337
+ * Price after tax and discount is applied. Specified as a monetary amount, for example, `"13.98"`.
338
+ *
339
+ * If no tax is applied, the amount is the same as `subtotal`.
340
+ */
341
+ total?: string;
342
+ /**
343
+ * Three-letter currency code in
344
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
345
+ */
346
+ currency?: string;
347
+ /** Price change after billing date was change and price was adjusted. Could be positive and negative values. */
348
+ proration?: string;
349
+ }
350
+ interface Fee$1 {
351
+ /** Fee name */
352
+ name?: string;
353
+ /** Amount of fee to be charged */
354
+ amount?: string;
355
+ }
356
+ declare enum OrderType {
357
+ UNDEFINED = "UNDEFINED",
358
+ /** Payments made by the buyer */
359
+ ONLINE = "ONLINE",
360
+ /** Payments managed manually by the site owner */
361
+ OFFLINE = "OFFLINE",
362
+ /** Payments managed externally */
363
+ EXTERNAL = "EXTERNAL"
364
+ }
365
+ declare enum OrderMethod {
366
+ UNKNOWN = "UNKNOWN",
367
+ /** Mail Order / Telephone Order transaction */
368
+ MOTO = "MOTO",
369
+ /** Point of Sale transaction */
370
+ POS = "POS"
371
+ }
372
+ declare enum OrderStatus {
373
+ /** Order status undefined */
374
+ UNDEFINED = "UNDEFINED",
375
+ /** Order created, but hasn't been paid for yet. Filtered out in ListOrders response by default. */
376
+ DRAFT = "DRAFT",
377
+ /** Order has been paid for, but the start date is in the future */
378
+ PENDING = "PENDING",
379
+ /** Order is active */
380
+ ACTIVE = "ACTIVE",
381
+ /** Order is paused until site owner resumes it */
382
+ PAUSED = "PAUSED",
383
+ /** Order has ended */
384
+ ENDED = "ENDED",
385
+ /** Order has been canceled */
386
+ CANCELED = "CANCELED"
387
+ }
388
+ interface Cancellation {
389
+ /** Date and time the cancellation was requested. */
390
+ requestedDate?: Date;
391
+ /**
392
+ * Reason for the cancellation. One of:
393
+ * + `OWNER_ACTION`: Site owner canceled the order.
394
+ * + `MEMBER_ACTION`: Buyer initiated the cancellation.
395
+ * + `PAYMENT_FAILURE`: Payment transaction failed.
396
+ * + `PAYMENT_SETUP_FAILURE`: Buyer's payment details weren't set up correctly.
397
+ * + `UNKNOWN`: Reason for the cancellation is unknown.
398
+ */
399
+ cause?: CancellationCause;
400
+ /**
401
+ * When the cancellation takes effect. Set when cancelling the order. One of:
402
+ * + `IMMEDIATELY`: Cancellation occurs immediately and the buyer can no longer use the plan.
403
+ * + `NEXT_PAYMENT_DATE`: Cancellation occurs at the next payment date and time. Buyer can continue to use the plan until that date and time.
404
+ */
405
+ effectiveAt?: CancellationEffectiveAt;
406
+ }
407
+ declare enum CancellationCause {
408
+ /** Cancellation initiator undefined */
409
+ UNDEFINED = "UNDEFINED",
410
+ /** Order was canceled by site owner (default if canceled by user or service identity) */
411
+ OWNER_ACTION = "OWNER_ACTION",
412
+ /** Order was canceled by member (default if canceled by member identity) */
413
+ MEMBER_ACTION = "MEMBER_ACTION",
414
+ /** Order was canceled because of payment failure */
415
+ PAYMENT_FAILURE = "PAYMENT_FAILURE",
416
+ /** Order was canceled because of payment setup failure */
417
+ PAYMENT_SETUP_FAILURE = "PAYMENT_SETUP_FAILURE",
418
+ /** Order was cancelled because of an unknown reason. It's not possible to know with certain payment providers (e.g. paypal) */
419
+ UNKNOWN = "UNKNOWN"
420
+ }
421
+ declare enum CancellationEffectiveAt {
422
+ /** Cancellation time undefined */
423
+ UNDEFINED = "UNDEFINED",
424
+ /** Will cancel the order now, i.e. update validUntil to the current date */
425
+ IMMEDIATELY = "IMMEDIATELY",
426
+ /** Will cancel the order at the date when next payment should have been made */
427
+ NEXT_PAYMENT_DATE = "NEXT_PAYMENT_DATE"
428
+ }
429
+ declare enum PaymentStatus {
430
+ /** Payment status undefined */
431
+ UNDEFINED = "UNDEFINED",
432
+ /** Payment has been paid */
433
+ PAID = "PAID",
434
+ /** Payment has been refunded */
435
+ REFUNDED = "REFUNDED",
436
+ /** Recurring payment has failed */
437
+ FAILED = "FAILED",
438
+ /** Payment has not been paid */
439
+ UNPAID = "UNPAID",
440
+ /** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
441
+ PENDING = "PENDING",
442
+ /** Used in cases where the plan is free */
443
+ NOT_APPLICABLE = "NOT_APPLICABLE"
444
+ }
445
+ interface PausePeriod {
446
+ /**
447
+ * Status of the pause period. Supported values:
448
+ * + `ACTIVE`: Status while the order is [paused](#pauseorder).
449
+ * + `ENDED`: Status when the order is [resumed](#resumeorder).
450
+ */
451
+ status?: Status;
452
+ /** Start date and time of the pause period. */
453
+ pauseDate?: Date;
454
+ /**
455
+ * End date and time of the pause period.
456
+ *
457
+ * Omitted while the pause period remains `ACTIVE`.
458
+ */
459
+ resumeDate?: Date;
460
+ }
461
+ declare enum Status {
462
+ UNDEFINED = "UNDEFINED",
463
+ /** Order suspension is active */
464
+ ACTIVE = "ACTIVE",
465
+ /** Order suspension has ended */
466
+ ENDED = "ENDED"
467
+ }
468
+ /**
469
+ * Current cycle will be empty when order is cancelled, expired or order start date is in the future
470
+ * Current cycle start and end dates take into account free trial days and suspensions
471
+ */
472
+ interface CurrentCycle {
473
+ /**
474
+ * Index of the current payment cycle in the order.
475
+ *
476
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
477
+ */
478
+ index?: number;
479
+ /** Start date and time for the current payment cycle. */
480
+ startedDate?: Date;
481
+ /** End date and time for the current payment cycle. */
482
+ endedDate?: Date;
483
+ }
484
+ /** Order cycle start and end dates take into account free trial days and suspensions */
485
+ interface OrderCycle {
486
+ /**
487
+ * Index of this cycle in the order.
488
+ *
489
+ * `0` when order is in a free trial period. In all other cases, the index starts with `1`.
490
+ */
491
+ index?: number;
492
+ /** Start date and time for this order cycle. */
493
+ startedDate?: Date;
494
+ /** End date and time for this order cycle. */
495
+ endedDate?: Date;
496
+ }
497
+ interface FormData {
498
+ /** ID of the form associated with the plan at checkout. */
499
+ formId?: string | null;
500
+ /** 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. */
501
+ submissionId?: string | null;
502
+ /**
503
+ * Data submitted to the plan's order form at checkout.
504
+ *
505
+ * This field is returned when a method's `fieldset` is set to `"FULL"`.
506
+ *
507
+ * @readonly
508
+ */
509
+ submissionData?: Record<string, any>;
510
+ }
511
+ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
512
+ createdEvent?: EntityCreatedEvent$1;
513
+ updatedEvent?: EntityUpdatedEvent$1;
514
+ deletedEvent?: EntityDeletedEvent$1;
515
+ actionEvent?: ActionEvent$1;
516
+ /**
517
+ * Unique event ID.
518
+ * Allows clients to ignore duplicate webhooks.
519
+ */
520
+ _id?: string;
521
+ /**
522
+ * Assumes actions are also always typed to an entity_type
523
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
524
+ */
525
+ entityFqdn?: string;
526
+ /**
527
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
528
+ * This is although the created/updated/deleted notion is duplication of the oneof types
529
+ * Example: created/updated/deleted/started/completed/email_opened
530
+ */
531
+ slug?: string;
532
+ /** ID of the entity associated with the event. */
533
+ entityId?: string;
534
+ /** Event timestamp. */
535
+ eventTime?: Date;
536
+ /**
537
+ * Whether the event was triggered as a result of a privacy regulation application
538
+ * (for example, GDPR).
539
+ */
540
+ triggeredByAnonymizeRequest?: boolean | null;
541
+ /** If present, indicates the action that triggered the event. */
542
+ originatedFrom?: string | null;
543
+ /**
544
+ * A sequence number defining the order of updates to the underlying entity.
545
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
546
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
547
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
548
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
549
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
550
+ */
551
+ entityEventSequence?: string | null;
552
+ }
553
+ /** @oneof */
554
+ interface DomainEventBodyOneOf$1 {
555
+ createdEvent?: EntityCreatedEvent$1;
556
+ updatedEvent?: EntityUpdatedEvent$1;
557
+ deletedEvent?: EntityDeletedEvent$1;
558
+ actionEvent?: ActionEvent$1;
559
+ }
560
+ interface EntityCreatedEvent$1 {
561
+ entity?: string;
562
+ }
563
+ interface EntityUpdatedEvent$1 {
564
+ /**
565
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
566
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
567
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
568
+ */
569
+ currentEntity?: string;
570
+ }
571
+ interface EntityDeletedEvent$1 {
572
+ /** Entity that was deleted */
573
+ deletedEntity?: string | null;
574
+ }
575
+ interface ActionEvent$1 {
576
+ body?: string;
577
+ }
578
+ interface Empty {
579
+ }
580
+ interface MemberGetOrderRequest {
581
+ /** Order ID. */
582
+ _id: string;
583
+ fieldSet?: Set;
584
+ }
585
+ declare enum Set {
586
+ /** Same behavior as BASIC */
587
+ UNKNOWN_SET = "UNKNOWN_SET",
588
+ /**
589
+ * Returns fields of the entity that are available in the database.
590
+ * By default a field is available in the database unless explicitly specified in the documentation
591
+ */
592
+ BASIC = "BASIC",
593
+ /**
594
+ * Returns all fields in the entity.
595
+ * This might make additional calls to gather the full entity
596
+ */
597
+ FULL = "FULL"
598
+ }
599
+ interface MemberGetOrderResponse {
600
+ /** Requested order. */
601
+ order?: Order;
602
+ }
603
+ interface MemberListOrdersRequest {
604
+ /** Filter by plan IDs. */
605
+ planIds?: string[];
606
+ /** Filter for orders where auto renewal was canceled. */
607
+ autoRenewCanceled?: boolean | null;
608
+ /** Filter by order status. */
609
+ orderStatuses?: OrderStatus[];
610
+ /** Filter by payment status. */
611
+ paymentStatuses?: PaymentStatus[];
612
+ /** Limit the number of pricing plans returned. Default limit is 50. */
613
+ limit?: number | null;
614
+ /** Number of entries to offset. */
615
+ offset?: number | null;
616
+ /** 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). */
617
+ sorting?: Sorting$1;
618
+ fieldSet?: Set;
619
+ }
620
+ interface Sorting$1 {
621
+ /** Name of the field to sort by. */
622
+ fieldName?: string;
623
+ /** Sort order. */
624
+ order?: SortOrder$1;
625
+ }
626
+ declare enum SortOrder$1 {
627
+ ASC = "ASC",
628
+ DESC = "DESC"
629
+ }
630
+ interface MemberListOrdersResponse {
631
+ /** List of orders. */
632
+ orders?: Order[];
633
+ /** Object containing paging-related data (number of orders returned, offset). */
634
+ pagingMetadata?: PagingMetadataV2$1;
635
+ }
636
+ interface PagingMetadataV2$1 {
637
+ /** Number of items returned in the response. */
638
+ count?: number | null;
639
+ /** Offset that was requested. */
640
+ offset?: number | null;
641
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
642
+ total?: number | null;
643
+ /** Flag that indicates the server failed to calculate the `total` field. */
644
+ tooManyToCount?: boolean | null;
645
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
646
+ cursors?: Cursors$1;
647
+ }
648
+ interface Cursors$1 {
649
+ /** Cursor string pointing to the next page in the list of results. */
650
+ next?: string | null;
651
+ /** Cursor pointing to the previous page in the list of results. */
652
+ prev?: string | null;
653
+ }
654
+ /**
655
+ * TODO: Write orders filter and sort docs page
656
+ * 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).
657
+ */
658
+ interface QueryOrdersRequest {
659
+ query?: QueryV2$1;
660
+ }
661
+ interface QueryV2$1 extends QueryV2PagingMethodOneOf {
662
+ /** Paging options to limit and skip the number of items. */
663
+ paging?: Paging$1;
664
+ /** 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`. */
665
+ cursorPaging?: CursorPaging;
666
+ /**
667
+ * Filter object in the following format:
668
+ * `"filter" : {
669
+ * "fieldName1": "value1",
670
+ * "fieldName2":{"$operator":"value2"}
671
+ * }`
672
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
673
+ */
674
+ filter?: Record<string, any> | null;
675
+ /**
676
+ * Sort object in the following format:
677
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
678
+ */
679
+ sort?: Sorting$1[];
680
+ /** 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. */
681
+ fields?: string[];
682
+ /** 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. */
683
+ fieldsets?: string[];
684
+ }
685
+ /** @oneof */
686
+ interface QueryV2PagingMethodOneOf {
687
+ /** Paging options to limit and skip the number of items. */
688
+ paging?: Paging$1;
689
+ /** 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`. */
690
+ cursorPaging?: CursorPaging;
691
+ }
692
+ interface Paging$1 {
693
+ /** Number of items to load. */
694
+ limit?: number | null;
695
+ /** Number of items to skip in the current sort order. */
696
+ offset?: number | null;
697
+ }
698
+ interface CursorPaging {
699
+ /** Maximum number of items to return in the results. */
700
+ limit?: number | null;
701
+ /**
702
+ * Pointer to the next or previous page in the list of results.
703
+ *
704
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
705
+ * Not relevant for the first request.
706
+ */
707
+ cursor?: string | null;
708
+ }
709
+ interface QueryOrdersResponse {
710
+ /** Order data. */
711
+ plans?: Order[];
712
+ /** Paging-related data (number of orders returned, offset). */
713
+ pagingMetadata?: PagingMetadataV2$1;
714
+ }
715
+ interface RequestCancellationRequest {
716
+ /** Order ID. */
717
+ _id: string;
718
+ /**
719
+ * Whether to cancel the order immediately or at the next payment date.
720
+ * One-time payment orders can only be canceled immediately.
721
+ *
722
+ * Supported values:
723
+ * - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
724
+ * - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
725
+ */
726
+ effectiveAt: CancellationEffectiveAt;
727
+ }
728
+ interface RequestCancellationResponse {
729
+ }
730
+ /**
731
+ * Emitted when an order is canceled immediately or when cycle ends for an order with canceled auto renewal
732
+ *
733
+ * To determine the specific reason of the cancellation check `order.cancellation.cause` field.
734
+ */
735
+ interface OrderCanceled {
736
+ /** Canceled order. */
737
+ order?: Order;
738
+ }
739
+ interface MessageEnvelope$1 {
740
+ /** App instance ID. */
741
+ instanceId?: string | null;
742
+ /** Event type. */
743
+ eventType?: string;
744
+ /** The identification type and identity data. */
745
+ identity?: IdentificationData$1;
746
+ /** Stringify payload. */
747
+ data?: string;
748
+ }
749
+ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
750
+ /** ID of a site visitor that has not logged in to the site. */
751
+ anonymousVisitorId?: string;
752
+ /** ID of a site visitor that has logged in to the site. */
753
+ memberId?: string;
754
+ /** ID of a Wix user (site owner, contributor, etc.). */
755
+ wixUserId?: string;
756
+ /** ID of an app. */
757
+ appId?: string;
758
+ /** @readonly */
759
+ identityType?: WebhookIdentityType$1;
760
+ }
761
+ /** @oneof */
762
+ interface IdentificationDataIdOneOf$1 {
763
+ /** ID of a site visitor that has not logged in to the site. */
764
+ anonymousVisitorId?: string;
765
+ /** ID of a site visitor that has logged in to the site. */
766
+ memberId?: string;
767
+ /** ID of a Wix user (site owner, contributor, etc.). */
768
+ wixUserId?: string;
769
+ /** ID of an app. */
770
+ appId?: string;
771
+ }
772
+ declare enum WebhookIdentityType$1 {
773
+ UNKNOWN = "UNKNOWN",
774
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
775
+ MEMBER = "MEMBER",
776
+ WIX_USER = "WIX_USER",
777
+ APP = "APP"
778
+ }
779
+ interface CreateOnlineOrderRequest {
780
+ /** Plan ID. */
781
+ planId?: string;
782
+ /**
783
+ * Start date for the ordered plan.
784
+ *
785
+ * Default: Current date
786
+ */
787
+ startDate?: Date;
788
+ /** Coupon code to apply. */
789
+ couponCode?: string | null;
790
+ /** Provided if checkout is initiated on buyer's behalf. */
791
+ onBehalf?: OnBehalf;
792
+ /** Form submission id that was submitted together with the order */
793
+ submissionId?: string | null;
794
+ }
795
+ interface OnBehalf {
796
+ /** Member ID. */
797
+ memberId?: string;
798
+ /** Method by which checkout is initiated on buyer's behalf */
799
+ orderMethod?: OrderMethod;
800
+ }
801
+ interface CreateOnlineOrderResponse {
802
+ /** Order. */
803
+ order?: Order;
804
+ }
805
+ interface CouponsError {
806
+ couponCode?: string;
807
+ planId?: string;
808
+ }
809
+ interface CreateGuestOnlineOrderRequest {
810
+ /** Plan ID. */
811
+ planId?: string;
812
+ /**
813
+ * Start date for the ordered plan.
814
+ *
815
+ * Default: Current date
816
+ */
817
+ startDate?: Date;
818
+ /** Coupon code to apply. */
819
+ couponCode?: string | null;
820
+ /** Captcha data to prove you are not a robot */
821
+ captcha?: Captcha;
822
+ /** Visitor info */
823
+ guest?: Guest;
824
+ /** Form submission id that was submitted together with the order */
825
+ submissionId?: string | null;
826
+ }
827
+ interface Captcha {
828
+ /** Token from captcha */
829
+ token?: string;
830
+ }
831
+ interface Guest {
832
+ /** Email for checkout */
833
+ email?: string;
834
+ }
835
+ interface CreateGuestOnlineOrderResponse {
836
+ /** Order. */
837
+ order?: Order;
838
+ }
839
+ interface CreateOfflineOrderRequest {
840
+ /** ID of the plan being ordered. */
841
+ planId: string;
842
+ /** ID of the member ordering the plan. */
843
+ memberId: string;
844
+ /**
845
+ * Start date and time for the ordered plan.
846
+ *
847
+ * Default: Current date and time
848
+ */
849
+ startDate?: Date;
850
+ /**
851
+ * Whether the order is paid.
852
+ *
853
+ * Default: `false`
854
+ */
855
+ paid?: boolean | null;
856
+ /**
857
+ * Coupon code to apply.
858
+ *
859
+ * See [Coupons to learn more](https://dev.wix.com/api/rest/coupons).
860
+ */
861
+ couponCode?: string | null;
862
+ /** Form submission id that was submitted together with the order */
863
+ submissionId?: string | null;
864
+ }
865
+ interface CreateOfflineOrderResponse {
866
+ /** Order. */
867
+ order?: Order;
868
+ }
869
+ interface CreateExternalOrderRequest {
870
+ /** Plan ID. */
871
+ planId?: string;
872
+ /** Form submission id that was submitted together with the order */
873
+ submissionId?: string | null;
874
+ }
875
+ interface CreateExternalOrderResponse {
876
+ /** Created order */
877
+ order?: Order;
878
+ }
879
+ interface GetOnlineOrderPreviewRequest {
880
+ /** Plan ID. */
881
+ planId?: string;
882
+ /**
883
+ * Start date for the ordered plan.
884
+ *
885
+ * Default: Current date
886
+ */
887
+ startDate?: Date;
888
+ /** Coupon code to apply. */
889
+ couponCode?: string | null;
890
+ }
891
+ interface GetOnlineOrderPreviewResponse {
892
+ /** Will be missing if limit is exceeded */
893
+ order?: Order;
894
+ /**
895
+ * Whether the purchase limit has already been reached for this plan by this member.
896
+ * Always false for plans without purchase limits.
897
+ */
898
+ purchaseLimitExceeded?: boolean;
899
+ }
900
+ interface GetGuestOnlineOrderPreviewRequest {
901
+ /** Plan ID. */
902
+ planId?: string;
903
+ /**
904
+ * Start date for the ordered plan.
905
+ *
906
+ * Default: Current date
907
+ */
908
+ startDate?: Date;
909
+ /** Coupon code to apply. */
910
+ couponCode?: string | null;
911
+ email?: string;
912
+ }
913
+ interface GetGuestOnlineOrderPreviewResponse {
914
+ /** Will be missing if limit is exceeded */
915
+ order?: Order;
916
+ /**
917
+ * Whether the purchase limit has already been reached for this plan by this email.
918
+ * Always false for plans without purchase limits.
919
+ */
920
+ purchaseLimitExceeded?: boolean;
921
+ }
922
+ interface GetOfflineOrderPreviewRequest {
923
+ /** 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). */
924
+ planId: string;
925
+ /** Member ID of the buyer the previewed order is for. */
926
+ memberId: string;
927
+ /**
928
+ * Start date and time for plan of the previewed order.
929
+ *
930
+ * Default: Current date and time
931
+ */
932
+ startDate?: Date;
933
+ /** Coupon code to apply. See [Coupons to learn more](https://dev.wix.com/api/rest/coupons). */
934
+ couponCode?: string | null;
935
+ }
936
+ interface GetOfflineOrderPreviewResponse {
937
+ /** The previewed order, as if the plan had been ordered. */
938
+ order?: Order;
939
+ /**
940
+ * Whether this previewed order would exceed the permitted amount of purchases available
941
+ * for this plan for this buyer.
942
+ *
943
+ * Always `false` for plans that do not have purchase limits.
944
+ */
945
+ purchaseLimitExceeded?: boolean;
946
+ }
947
+ interface GetPricePreviewRequest {
948
+ /** ID of plan to preview. */
949
+ planId: string;
950
+ /**
951
+ * Coupon code to apply.
952
+ *
953
+ * See Coupons [to learn more](https://dev.wix.com/api/rest/coupons).
954
+ */
955
+ couponCode?: string | null;
956
+ }
957
+ interface GetPricePreviewResponse {
958
+ /**
959
+ * @internal
960
+ * @internal
961
+ * @deprecated __Deprecated.__ Use `prices` instead. This property will be removed on September 30, 2022.
962
+ * @replacedBy prices
963
+ * @removalDate 2022-10-01
964
+ */
965
+ price?: PriceDetails;
966
+ /** Pricing details. */
967
+ prices?: SpannedPrice[];
968
+ }
969
+ interface ChangeStartDateRequest {
970
+ /** Draft order ID. */
971
+ orderId?: string;
972
+ /** New valid from date (timestamp). */
973
+ startDate?: Date;
974
+ }
975
+ interface ChangeStartDateResponse {
976
+ /** Updated draft order. */
977
+ order?: Order;
978
+ }
979
+ interface OrderStartDateChanged {
980
+ /** Order whose `startDate` changed. */
981
+ order?: Order;
982
+ }
983
+ interface ApplyCouponRequest {
984
+ /** Draft order ID. */
985
+ orderId?: string;
986
+ /** Coupon code to apply. */
987
+ couponCode?: string;
988
+ }
989
+ interface ApplyCouponResponse {
990
+ /** Order with applied coupon and recalculated tax. */
991
+ order?: Order;
992
+ }
993
+ interface SetSubmissionRequest {
994
+ orderId?: string;
995
+ submissionId?: string;
996
+ }
997
+ interface SetSubmissionResponse {
998
+ /** Order with submission id */
999
+ order?: Order;
1000
+ }
1001
+ interface OrderPurchased {
1002
+ /** Order that was paid for. If a free or an offline order, the order that was created. */
1003
+ order?: Order;
1004
+ }
1005
+ interface OrderStarted {
1006
+ /** Order that reached its `startDate`. */
1007
+ order?: Order;
1008
+ }
1009
+ /**
1010
+ * Triggered at the start of a new payment cycle for an existing order.
1011
+ *
1012
+ * This webhook does not trigger at the initial start of an offline order.
1013
+ */
1014
+ interface OrderCycleStarted {
1015
+ /** Order whose new cycle started. */
1016
+ order?: Order;
1017
+ /** 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. */
1018
+ cycleNumber?: number;
1019
+ }
1020
+ /** Emitted when a recurring order is canceled for the next payment cycle */
1021
+ interface OrderAutoRenewCanceled {
1022
+ /** Order that is canceled, effective at the end of the current payment cycle. */
1023
+ order?: Order;
1024
+ }
1025
+ interface OrderEnded {
1026
+ /** Order that ended. */
1027
+ order?: Order;
1028
+ }
1029
+ interface GetOrderRequest {
1030
+ /** Order ID. */
1031
+ _id: string;
1032
+ fieldSet?: Set;
1033
+ }
1034
+ interface GetOrderResponse {
1035
+ /** Order. */
1036
+ order?: Order;
1037
+ }
1038
+ interface ListOrdersRequest {
1039
+ /** 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). */
1040
+ buyerIds?: string[];
1041
+ /** Filter by plan IDs. See [Plans to learn more about pricing plans](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans). */
1042
+ planIds?: string[];
1043
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
1044
+ autoRenewCanceled?: boolean | null;
1045
+ /** Filter by order status. */
1046
+ orderStatuses?: OrderStatus[];
1047
+ /** Filter by payment status. */
1048
+ paymentStatuses?: PaymentStatus[];
1049
+ /**
1050
+ * 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.
1051
+ *
1052
+ * Max: `50`
1053
+ */
1054
+ limit?: number | null;
1055
+ /** Number of orders to skip in the current sort order. */
1056
+ offset?: number | null;
1057
+ /**
1058
+ * Sort order.
1059
+ *
1060
+ * Use `ASC` for ascending order or `DESC` for descending order.
1061
+ *
1062
+ * Default: `DESC`
1063
+ */
1064
+ sorting?: Sorting$1;
1065
+ /** Parameter to define amount of fields to return. FULL returns each order's submission data. Supported values: UNKNOWN_SET, BASIC, FULL */
1066
+ fieldSet?: Set;
1067
+ }
1068
+ interface ListOrdersResponse {
1069
+ /** List of orders. */
1070
+ orders?: Order[];
1071
+ /** Object containing paging-related data (number of orders returned, offset). */
1072
+ pagingMetadata?: PagingMetadataV2$1;
1073
+ }
1074
+ interface OrdersQueryOrdersRequest {
1075
+ /** [See available fields here](https://dev.wix.com/api/rest/pricing-plans/pricing-plans/order-v2/filter-and-sort). */
1076
+ query?: QueryV2$1;
1077
+ }
1078
+ interface OrdersQueryOrdersResponse {
1079
+ /** Retrieved orders. */
1080
+ plans?: Order[];
1081
+ /** Paging-related data (number of orders returned, offset). */
1082
+ pagingMetadata?: PagingMetadataV2$1;
1083
+ }
1084
+ interface GetOrdersStatsRequest {
1085
+ }
1086
+ interface GetOrdersStatsResponse {
1087
+ /** Total number of orders. */
1088
+ totalOrderCount?: number;
1089
+ /** Number of active orders. */
1090
+ activeOrderCount?: number;
1091
+ }
1092
+ interface GetAvailableOrderActionsRequest {
1093
+ /** Order ID. */
1094
+ _id?: string;
1095
+ }
1096
+ interface GetAvailableOrderActionsResponse {
1097
+ /** Whether the order can be suspended. */
1098
+ suspendable?: boolean;
1099
+ /** If the order cannot be suspended, a reason is returned here. */
1100
+ notSuspendableReason?: ReasonNotSuspendable;
1101
+ /** Whether the order can be canceled by the buyer. */
1102
+ cancelableByBuyer?: boolean;
1103
+ }
1104
+ declare enum ReasonNotSuspendable {
1105
+ /** Reason unknown */
1106
+ UNDEFINED = "UNDEFINED",
1107
+ /** Saved in the database but is awaiting payment. Non-active orders cannot be suspended */
1108
+ PENDING = "PENDING",
1109
+ /** Trial orders cannot be suspended */
1110
+ TRIAL = "TRIAL",
1111
+ /** Canceled orders cannot be suspended */
1112
+ CANCELED = "CANCELED",
1113
+ /** Ended orders cannot be suspended */
1114
+ ENDED = "ENDED",
1115
+ /** Paid for orders with future start dates cannot be suspended */
1116
+ NOT_STARTED = "NOT_STARTED",
1117
+ /** Order is already suspended */
1118
+ ALREADY_SUSPENDED = "ALREADY_SUSPENDED",
1119
+ /** Orders based on recurring payments using older Stripe versions cannot be suspended */
1120
+ OLD_STRIPE = "OLD_STRIPE"
1121
+ }
1122
+ interface PostponeEndDateRequest {
1123
+ /** Order ID. */
1124
+ _id: string;
1125
+ /**
1126
+ * New end date and time.
1127
+ *
1128
+ * Must be later than the current end date and time.
1129
+ */
1130
+ endDate: Date;
1131
+ }
1132
+ interface PostponeEndDateResponse {
1133
+ }
1134
+ interface OrderEndDatePostponed {
1135
+ /** Order whose `endDate` was postponed. */
1136
+ order?: Order;
1137
+ }
1138
+ interface CancelOrderRequest {
1139
+ /** Order ID. */
1140
+ _id: string;
1141
+ /**
1142
+ * When the order is canceled.
1143
+ *
1144
+ * One time orders can only be canceled immediately. Supported values:
1145
+ * - `"IMMEDIATELY"`: The order is canceled immediately.
1146
+ * - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
1147
+ */
1148
+ effectiveAt: CancellationEffectiveAt;
1149
+ }
1150
+ interface CancelOrderResponse {
1151
+ }
1152
+ interface MarkAsPaidRequest {
1153
+ /** Order ID. */
1154
+ _id: string;
1155
+ }
1156
+ interface MarkAsPaidResponse {
1157
+ }
1158
+ interface OrderMarkedAsPaid {
1159
+ /** Order that was marked as paid. */
1160
+ order?: Order;
1161
+ }
1162
+ interface PauseOrderRequest {
1163
+ /** Order ID. */
1164
+ _id: string;
1165
+ }
1166
+ interface PauseOrderResponse {
1167
+ }
1168
+ interface OrderPaused {
1169
+ /** Paused order. */
1170
+ order?: Order;
1171
+ }
1172
+ interface BulkPauseOrderRequest {
1173
+ /** List of Order IDs. */
1174
+ ids?: string[];
1175
+ /** Set to true to return Order entity in response. */
1176
+ returnFullEntity?: boolean;
1177
+ }
1178
+ interface BulkPauseOrderResponse {
1179
+ results?: BulkOrderResult[];
1180
+ bulkActionMetadata?: BulkActionMetadata$1;
1181
+ }
1182
+ interface BulkOrderResult {
1183
+ itemMetadata?: ItemMetadata$1;
1184
+ order?: Order;
1185
+ }
1186
+ interface ItemMetadata$1 {
1187
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1188
+ _id?: string | null;
1189
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1190
+ originalIndex?: number;
1191
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1192
+ success?: boolean;
1193
+ /** Details about the error in case of failure. */
1194
+ error?: ApplicationError$1;
1195
+ }
1196
+ interface ApplicationError$1 {
1197
+ /** Error code. */
1198
+ code?: string;
1199
+ /** Description of the error. */
1200
+ description?: string;
1201
+ /** Data related to the error. */
1202
+ data?: Record<string, any> | null;
1203
+ }
1204
+ interface BulkActionMetadata$1 {
1205
+ /** Number of items that were successfully processed. */
1206
+ totalSuccesses?: number;
1207
+ /** Number of items that couldn't be processed. */
1208
+ totalFailures?: number;
1209
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1210
+ undetailedFailures?: number;
1211
+ }
1212
+ interface ResumeOrderRequest {
1213
+ /** Order ID. */
1214
+ _id: string;
1215
+ }
1216
+ interface ResumeOrderResponse {
1217
+ }
1218
+ interface OrderResumed {
1219
+ /** Resumed order. */
1220
+ order?: Order;
1221
+ }
1222
+ interface BulkResumeOrderRequest {
1223
+ /** List of Order IDs. */
1224
+ ids?: string[];
1225
+ /** Set to true to return Order entity in response. */
1226
+ returnFullEntity?: boolean;
1227
+ }
1228
+ interface BulkResumeOrderResponse {
1229
+ results?: BulkOrderResult[];
1230
+ bulkActionMetadata?: BulkActionMetadata$1;
1231
+ }
1232
+ interface MemberGetOrderResponseNonNullableFields {
1233
+ order?: {
1234
+ _id: string;
1235
+ planId: string;
1236
+ subscriptionId: string;
1237
+ buyer?: {
1238
+ memberId: string;
1239
+ contactId: string;
1240
+ };
1241
+ priceDetails?: {
1242
+ subscription?: {
1243
+ cycleDuration?: {
1244
+ unit: PeriodUnit$1;
1245
+ };
1246
+ };
1247
+ singlePaymentForDuration?: {
1248
+ unit: PeriodUnit$1;
1249
+ };
1250
+ subtotal: string;
1251
+ discount: string;
1252
+ tax?: {
1253
+ name: string;
1254
+ includedInPrice: boolean;
1255
+ rate: string;
1256
+ amount: string;
1257
+ };
1258
+ total: string;
1259
+ planPrice: string;
1260
+ currency: string;
1261
+ coupon?: {
1262
+ code: string;
1263
+ amount: string;
1264
+ _id: string;
1265
+ };
1266
+ };
1267
+ pricing?: {
1268
+ subscription?: {
1269
+ cycleDuration?: {
1270
+ unit: PeriodUnit$1;
1271
+ };
1272
+ };
1273
+ singlePaymentForDuration?: {
1274
+ unit: PeriodUnit$1;
1275
+ };
1276
+ prices: {
1277
+ duration?: {
1278
+ cycleFrom: number;
1279
+ };
1280
+ price?: {
1281
+ subtotal: string;
1282
+ coupon?: {
1283
+ code: string;
1284
+ amount: string;
1285
+ _id: string;
1286
+ };
1287
+ discount: string;
1288
+ tax?: {
1289
+ name: string;
1290
+ includedInPrice: boolean;
1291
+ rate: string;
1292
+ amount: string;
1293
+ };
1294
+ total: string;
1295
+ currency: string;
1296
+ proration: string;
1297
+ };
1298
+ }[];
1299
+ };
1300
+ type: OrderType;
1301
+ status: OrderStatus;
1302
+ cancellation?: {
1303
+ cause: CancellationCause;
1304
+ effectiveAt: CancellationEffectiveAt;
1305
+ };
1306
+ lastPaymentStatus: PaymentStatus;
1307
+ pausePeriods: {
1308
+ status: Status;
1309
+ }[];
1310
+ currentCycle?: {
1311
+ index: number;
1312
+ };
1313
+ planName: string;
1314
+ planDescription: string;
1315
+ planPrice: string;
1316
+ };
1317
+ }
1318
+ interface MemberListOrdersResponseNonNullableFields {
1319
+ orders: {
1320
+ _id: string;
1321
+ planId: string;
1322
+ subscriptionId: string;
1323
+ buyer?: {
1324
+ memberId: string;
1325
+ contactId: string;
1326
+ };
1327
+ priceDetails?: {
1328
+ subscription?: {
1329
+ cycleDuration?: {
1330
+ unit: PeriodUnit$1;
1331
+ };
1332
+ };
1333
+ singlePaymentForDuration?: {
1334
+ unit: PeriodUnit$1;
1335
+ };
1336
+ subtotal: string;
1337
+ discount: string;
1338
+ tax?: {
1339
+ name: string;
1340
+ includedInPrice: boolean;
1341
+ rate: string;
1342
+ amount: string;
1343
+ };
1344
+ total: string;
1345
+ planPrice: string;
1346
+ currency: string;
1347
+ coupon?: {
1348
+ code: string;
1349
+ amount: string;
1350
+ _id: string;
1351
+ };
1352
+ };
1353
+ pricing?: {
1354
+ subscription?: {
1355
+ cycleDuration?: {
1356
+ unit: PeriodUnit$1;
1357
+ };
1358
+ };
1359
+ singlePaymentForDuration?: {
1360
+ unit: PeriodUnit$1;
1361
+ };
1362
+ prices: {
1363
+ duration?: {
1364
+ cycleFrom: number;
1365
+ };
1366
+ price?: {
1367
+ subtotal: string;
1368
+ coupon?: {
1369
+ code: string;
1370
+ amount: string;
1371
+ _id: string;
1372
+ };
1373
+ discount: string;
1374
+ tax?: {
1375
+ name: string;
1376
+ includedInPrice: boolean;
1377
+ rate: string;
1378
+ amount: string;
1379
+ };
1380
+ total: string;
1381
+ currency: string;
1382
+ proration: string;
1383
+ };
1384
+ }[];
1385
+ };
1386
+ type: OrderType;
1387
+ status: OrderStatus;
1388
+ cancellation?: {
1389
+ cause: CancellationCause;
1390
+ effectiveAt: CancellationEffectiveAt;
1391
+ };
1392
+ lastPaymentStatus: PaymentStatus;
1393
+ pausePeriods: {
1394
+ status: Status;
1395
+ }[];
1396
+ currentCycle?: {
1397
+ index: number;
1398
+ };
1399
+ planName: string;
1400
+ planDescription: string;
1401
+ planPrice: string;
1402
+ }[];
1403
+ }
1404
+ interface CreateOfflineOrderResponseNonNullableFields {
1405
+ order?: {
1406
+ _id: string;
1407
+ planId: string;
1408
+ subscriptionId: string;
1409
+ buyer?: {
1410
+ memberId: string;
1411
+ contactId: string;
1412
+ };
1413
+ priceDetails?: {
1414
+ subscription?: {
1415
+ cycleDuration?: {
1416
+ unit: PeriodUnit$1;
1417
+ };
1418
+ };
1419
+ singlePaymentForDuration?: {
1420
+ unit: PeriodUnit$1;
1421
+ };
1422
+ subtotal: string;
1423
+ discount: string;
1424
+ tax?: {
1425
+ name: string;
1426
+ includedInPrice: boolean;
1427
+ rate: string;
1428
+ amount: string;
1429
+ };
1430
+ total: string;
1431
+ planPrice: string;
1432
+ currency: string;
1433
+ coupon?: {
1434
+ code: string;
1435
+ amount: string;
1436
+ _id: string;
1437
+ };
1438
+ };
1439
+ pricing?: {
1440
+ subscription?: {
1441
+ cycleDuration?: {
1442
+ unit: PeriodUnit$1;
1443
+ };
1444
+ };
1445
+ singlePaymentForDuration?: {
1446
+ unit: PeriodUnit$1;
1447
+ };
1448
+ prices: {
1449
+ duration?: {
1450
+ cycleFrom: number;
1451
+ };
1452
+ price?: {
1453
+ subtotal: string;
1454
+ coupon?: {
1455
+ code: string;
1456
+ amount: string;
1457
+ _id: string;
1458
+ };
1459
+ discount: string;
1460
+ tax?: {
1461
+ name: string;
1462
+ includedInPrice: boolean;
1463
+ rate: string;
1464
+ amount: string;
1465
+ };
1466
+ total: string;
1467
+ currency: string;
1468
+ proration: string;
1469
+ };
1470
+ }[];
1471
+ };
1472
+ type: OrderType;
1473
+ status: OrderStatus;
1474
+ cancellation?: {
1475
+ cause: CancellationCause;
1476
+ effectiveAt: CancellationEffectiveAt;
1477
+ };
1478
+ lastPaymentStatus: PaymentStatus;
1479
+ pausePeriods: {
1480
+ status: Status;
1481
+ }[];
1482
+ currentCycle?: {
1483
+ index: number;
1484
+ };
1485
+ planName: string;
1486
+ planDescription: string;
1487
+ planPrice: string;
1488
+ };
1489
+ }
1490
+ interface GetOfflineOrderPreviewResponseNonNullableFields {
1491
+ order?: {
1492
+ _id: string;
1493
+ planId: string;
1494
+ subscriptionId: string;
1495
+ buyer?: {
1496
+ memberId: string;
1497
+ contactId: string;
1498
+ };
1499
+ priceDetails?: {
1500
+ subscription?: {
1501
+ cycleDuration?: {
1502
+ unit: PeriodUnit$1;
1503
+ };
1504
+ };
1505
+ singlePaymentForDuration?: {
1506
+ unit: PeriodUnit$1;
1507
+ };
1508
+ subtotal: string;
1509
+ discount: string;
1510
+ tax?: {
1511
+ name: string;
1512
+ includedInPrice: boolean;
1513
+ rate: string;
1514
+ amount: string;
1515
+ };
1516
+ total: string;
1517
+ planPrice: string;
1518
+ currency: string;
1519
+ coupon?: {
1520
+ code: string;
1521
+ amount: string;
1522
+ _id: string;
1523
+ };
1524
+ };
1525
+ pricing?: {
1526
+ subscription?: {
1527
+ cycleDuration?: {
1528
+ unit: PeriodUnit$1;
1529
+ };
1530
+ };
1531
+ singlePaymentForDuration?: {
1532
+ unit: PeriodUnit$1;
1533
+ };
1534
+ prices: {
1535
+ duration?: {
1536
+ cycleFrom: number;
1537
+ };
1538
+ price?: {
1539
+ subtotal: string;
1540
+ coupon?: {
1541
+ code: string;
1542
+ amount: string;
1543
+ _id: string;
1544
+ };
1545
+ discount: string;
1546
+ tax?: {
1547
+ name: string;
1548
+ includedInPrice: boolean;
1549
+ rate: string;
1550
+ amount: string;
1551
+ };
1552
+ total: string;
1553
+ currency: string;
1554
+ proration: string;
1555
+ };
1556
+ }[];
1557
+ };
1558
+ type: OrderType;
1559
+ status: OrderStatus;
1560
+ cancellation?: {
1561
+ cause: CancellationCause;
1562
+ effectiveAt: CancellationEffectiveAt;
1563
+ };
1564
+ lastPaymentStatus: PaymentStatus;
1565
+ pausePeriods: {
1566
+ status: Status;
1567
+ }[];
1568
+ currentCycle?: {
1569
+ index: number;
1570
+ };
1571
+ planName: string;
1572
+ planDescription: string;
1573
+ planPrice: string;
1574
+ };
1575
+ purchaseLimitExceeded: boolean;
1576
+ }
1577
+ interface GetPricePreviewResponseNonNullableFields {
1578
+ price?: {
1579
+ subscription?: {
1580
+ cycleDuration?: {
1581
+ unit: PeriodUnit$1;
1582
+ };
1583
+ };
1584
+ singlePaymentForDuration?: {
1585
+ unit: PeriodUnit$1;
1586
+ };
1587
+ subtotal: string;
1588
+ discount: string;
1589
+ tax?: {
1590
+ name: string;
1591
+ includedInPrice: boolean;
1592
+ rate: string;
1593
+ amount: string;
1594
+ };
1595
+ total: string;
1596
+ planPrice: string;
1597
+ currency: string;
1598
+ coupon?: {
1599
+ code: string;
1600
+ amount: string;
1601
+ _id: string;
1602
+ };
1603
+ };
1604
+ prices: {
1605
+ duration?: {
1606
+ cycleFrom: number;
1607
+ };
1608
+ price?: {
1609
+ subtotal: string;
1610
+ coupon?: {
1611
+ code: string;
1612
+ amount: string;
1613
+ _id: string;
1614
+ };
1615
+ discount: string;
1616
+ tax?: {
1617
+ name: string;
1618
+ includedInPrice: boolean;
1619
+ rate: string;
1620
+ amount: string;
1621
+ };
1622
+ total: string;
1623
+ currency: string;
1624
+ proration: string;
1625
+ };
1626
+ }[];
1627
+ }
1628
+ interface GetOrderResponseNonNullableFields {
1629
+ order?: {
1630
+ _id: string;
1631
+ planId: string;
1632
+ subscriptionId: string;
1633
+ buyer?: {
1634
+ memberId: string;
1635
+ contactId: string;
1636
+ };
1637
+ priceDetails?: {
1638
+ subscription?: {
1639
+ cycleDuration?: {
1640
+ unit: PeriodUnit$1;
1641
+ };
1642
+ };
1643
+ singlePaymentForDuration?: {
1644
+ unit: PeriodUnit$1;
1645
+ };
1646
+ subtotal: string;
1647
+ discount: string;
1648
+ tax?: {
1649
+ name: string;
1650
+ includedInPrice: boolean;
1651
+ rate: string;
1652
+ amount: string;
1653
+ };
1654
+ total: string;
1655
+ planPrice: string;
1656
+ currency: string;
1657
+ coupon?: {
1658
+ code: string;
1659
+ amount: string;
1660
+ _id: string;
1661
+ };
1662
+ };
1663
+ pricing?: {
1664
+ subscription?: {
1665
+ cycleDuration?: {
1666
+ unit: PeriodUnit$1;
1667
+ };
1668
+ };
1669
+ singlePaymentForDuration?: {
1670
+ unit: PeriodUnit$1;
1671
+ };
1672
+ prices: {
1673
+ duration?: {
1674
+ cycleFrom: number;
1675
+ };
1676
+ price?: {
1677
+ subtotal: string;
1678
+ coupon?: {
1679
+ code: string;
1680
+ amount: string;
1681
+ _id: string;
1682
+ };
1683
+ discount: string;
1684
+ tax?: {
1685
+ name: string;
1686
+ includedInPrice: boolean;
1687
+ rate: string;
1688
+ amount: string;
1689
+ };
1690
+ total: string;
1691
+ currency: string;
1692
+ proration: string;
1693
+ };
1694
+ }[];
1695
+ };
1696
+ type: OrderType;
1697
+ status: OrderStatus;
1698
+ cancellation?: {
1699
+ cause: CancellationCause;
1700
+ effectiveAt: CancellationEffectiveAt;
1701
+ };
1702
+ lastPaymentStatus: PaymentStatus;
1703
+ pausePeriods: {
1704
+ status: Status;
1705
+ }[];
1706
+ currentCycle?: {
1707
+ index: number;
1708
+ };
1709
+ planName: string;
1710
+ planDescription: string;
1711
+ planPrice: string;
1712
+ };
1713
+ }
1714
+ interface ListOrdersResponseNonNullableFields {
1715
+ orders: {
1716
+ _id: string;
1717
+ planId: string;
1718
+ subscriptionId: string;
1719
+ buyer?: {
1720
+ memberId: string;
1721
+ contactId: string;
1722
+ };
1723
+ priceDetails?: {
1724
+ subscription?: {
1725
+ cycleDuration?: {
1726
+ unit: PeriodUnit$1;
1727
+ };
1728
+ };
1729
+ singlePaymentForDuration?: {
1730
+ unit: PeriodUnit$1;
1731
+ };
1732
+ subtotal: string;
1733
+ discount: string;
1734
+ tax?: {
1735
+ name: string;
1736
+ includedInPrice: boolean;
1737
+ rate: string;
1738
+ amount: string;
1739
+ };
1740
+ total: string;
1741
+ planPrice: string;
1742
+ currency: string;
1743
+ coupon?: {
1744
+ code: string;
1745
+ amount: string;
1746
+ _id: string;
1747
+ };
1748
+ };
1749
+ pricing?: {
1750
+ subscription?: {
1751
+ cycleDuration?: {
1752
+ unit: PeriodUnit$1;
1753
+ };
1754
+ };
1755
+ singlePaymentForDuration?: {
1756
+ unit: PeriodUnit$1;
1757
+ };
1758
+ prices: {
1759
+ duration?: {
1760
+ cycleFrom: number;
1761
+ };
1762
+ price?: {
1763
+ subtotal: string;
1764
+ coupon?: {
1765
+ code: string;
1766
+ amount: string;
1767
+ _id: string;
1768
+ };
1769
+ discount: string;
1770
+ tax?: {
1771
+ name: string;
1772
+ includedInPrice: boolean;
1773
+ rate: string;
1774
+ amount: string;
1775
+ };
1776
+ total: string;
1777
+ currency: string;
1778
+ proration: string;
1779
+ };
1780
+ }[];
1781
+ };
1782
+ type: OrderType;
1783
+ status: OrderStatus;
1784
+ cancellation?: {
1785
+ cause: CancellationCause;
1786
+ effectiveAt: CancellationEffectiveAt;
1787
+ };
1788
+ lastPaymentStatus: PaymentStatus;
1789
+ pausePeriods: {
1790
+ status: Status;
1791
+ }[];
1792
+ currentCycle?: {
1793
+ index: number;
1794
+ };
1795
+ planName: string;
1796
+ planDescription: string;
1797
+ planPrice: string;
1798
+ }[];
1799
+ }
1800
+ interface BaseEventMetadata$1 {
1801
+ /** App instance ID. */
1802
+ instanceId?: string | null;
1803
+ /** Event type. */
1804
+ eventType?: string;
1805
+ /** The identification type and identity data. */
1806
+ identity?: IdentificationData$1;
1807
+ }
1808
+ interface EventMetadata$1 extends BaseEventMetadata$1 {
1809
+ /**
1810
+ * Unique event ID.
1811
+ * Allows clients to ignore duplicate webhooks.
1812
+ */
1813
+ _id?: string;
1814
+ /**
1815
+ * Assumes actions are also always typed to an entity_type
1816
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1817
+ */
1818
+ entityFqdn?: string;
1819
+ /**
1820
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1821
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1822
+ * Example: created/updated/deleted/started/completed/email_opened
1823
+ */
1824
+ slug?: string;
1825
+ /** ID of the entity associated with the event. */
1826
+ entityId?: string;
1827
+ /** Event timestamp. */
1828
+ eventTime?: Date;
1829
+ /**
1830
+ * Whether the event was triggered as a result of a privacy regulation application
1831
+ * (for example, GDPR).
1832
+ */
1833
+ triggeredByAnonymizeRequest?: boolean | null;
1834
+ /** If present, indicates the action that triggered the event. */
1835
+ originatedFrom?: string | null;
1836
+ /**
1837
+ * A sequence number defining the order of updates to the underlying entity.
1838
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1839
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1840
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1841
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1842
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1843
+ */
1844
+ entityEventSequence?: string | null;
1845
+ }
1846
+ interface OrderCanceledEnvelope {
1847
+ data: OrderCanceled;
1848
+ metadata: EventMetadata$1;
1849
+ }
1850
+ interface OrderCreatedEnvelope {
1851
+ entity: Order;
1852
+ metadata: EventMetadata$1;
1853
+ }
1854
+ interface OrderUpdatedEnvelope {
1855
+ entity: Order;
1856
+ metadata: EventMetadata$1;
1857
+ }
1858
+ interface OrderStartDateChangedEnvelope {
1859
+ data: OrderStartDateChanged;
1860
+ metadata: EventMetadata$1;
1861
+ }
1862
+ interface OrderPurchasedEnvelope {
1863
+ data: OrderPurchased;
1864
+ metadata: EventMetadata$1;
1865
+ }
1866
+ interface OrderStartedEnvelope {
1867
+ data: OrderStarted;
1868
+ metadata: EventMetadata$1;
1869
+ }
1870
+ interface OrderCycleStartedEnvelope {
1871
+ data: OrderCycleStarted;
1872
+ metadata: EventMetadata$1;
1873
+ }
1874
+ interface OrderAutoRenewCanceledEnvelope {
1875
+ data: OrderAutoRenewCanceled;
1876
+ metadata: EventMetadata$1;
1877
+ }
1878
+ interface OrderEndedEnvelope {
1879
+ data: OrderEnded;
1880
+ metadata: EventMetadata$1;
1881
+ }
1882
+ interface OrderEndDatePostponedEnvelope {
1883
+ data: OrderEndDatePostponed;
1884
+ metadata: EventMetadata$1;
1885
+ }
1886
+ interface OrderMarkedAsPaidEnvelope {
1887
+ data: OrderMarkedAsPaid;
1888
+ metadata: EventMetadata$1;
1889
+ }
1890
+ interface OrderPausedEnvelope {
1891
+ data: OrderPaused;
1892
+ metadata: EventMetadata$1;
1893
+ }
1894
+ interface OrderResumedEnvelope {
1895
+ data: OrderResumed;
1896
+ metadata: EventMetadata$1;
1897
+ }
1898
+ interface MemberGetOrderOptions {
1899
+ fieldSet?: Set;
1900
+ }
1901
+ interface MemberListOrdersOptions {
1902
+ /** Filter by plan IDs. */
1903
+ planIds?: string[];
1904
+ /** Filter for orders where auto renewal was canceled. */
1905
+ autoRenewCanceled?: boolean | null;
1906
+ /**
1907
+ * Filter by the order status. Supported values:
1908
+ * + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
1909
+ * + `PENDING`: Order has been purchased and its start date is set in the future.
1910
+ * + `ACTIVE`: Order has been processed. The plan is available for use.
1911
+ * + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
1912
+ * + `ENDED`: Order has completed its duration and is no longer available for use.
1913
+ * + `CANCELED`: Order has been [canceled](#cancelorder).
1914
+ */
1915
+ orderStatuses?: OrderStatus[];
1916
+ /**
1917
+ * Key Path to edit
1918
+ * ManagementListOrdersOptions.paymentStatuses
1919
+ * Production value
1920
+ * Filter by payment status.
1921
+ * Override
1922
+ * Filter by payment status.
1923
+ *
1924
+ * Supported values:
1925
+ * + `PAID`: The last payment was paid.
1926
+ * + `REFUNDED`: The last payment was refunded.
1927
+ * + `FAILED`: The last payment transaction didn't complete.
1928
+ * + `UNPAID`: The last payment wasn't paid.
1929
+ * + `PENDING`: Awaiting payment.
1930
+ * + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
1931
+ * Mark down view
1932
+ * Filter by payment status.
1933
+ *
1934
+ * Supported values:
1935
+ *
1936
+ * PAID: The last payment was paid.
1937
+ * REFUNDED: The last payment was refunded.
1938
+ * FAILED: The last payment transaction didn't complete.
1939
+ * UNPAID: The last payment wasn't paid.
1940
+ * PENDING: Awaiting payment.
1941
+ * NOT_APPLICABLE: No payment was necessary. For example, for free plans or free trials.
1942
+ */
1943
+ paymentStatuses?: PaymentStatus[];
1944
+ /**
1945
+ * Number of pricing plan orders to return.
1946
+ *
1947
+ * Default: `50`
1948
+ */
1949
+ limit?: number | null;
1950
+ /** Number of orders to skip in the current sort order. */
1951
+ offset?: number | null;
1952
+ /**
1953
+ * Sort order.
1954
+ *
1955
+ * Use `ASC` for ascending order or `DESC` for descending order.
1956
+ *
1957
+ * Default: `ASC`
1958
+ */
1959
+ sorting?: Sorting$1;
1960
+ fieldSet?: Set;
1961
+ }
1962
+ interface CreateOfflineOrderOptions {
1963
+ /**
1964
+ * Start date and time for the ordered plan.
1965
+ *
1966
+ * Default: Current date and time
1967
+ */
1968
+ startDate?: Date;
1969
+ /**
1970
+ * Whether the order is paid.
1971
+ *
1972
+ * Default: `false`
1973
+ */
1974
+ paid?: boolean | null;
1975
+ /** Coupon code to apply. */
1976
+ couponCode?: string | null;
1977
+ /** Form submission ID that was submitted together with the order. */
1978
+ submissionId?: string | null;
1979
+ }
1980
+ interface GetOfflineOrderPreviewOptions {
1981
+ /**
1982
+ * Start date and time for plan of the previewed order.
1983
+ *
1984
+ * Default: Current date and time
1985
+ */
1986
+ startDate?: Date;
1987
+ /** Coupon code to apply. */
1988
+ couponCode?: string | null;
1989
+ }
1990
+ interface GetPricePreviewOptions {
1991
+ /** Coupon code to apply. */
1992
+ couponCode?: string | null;
1993
+ }
1994
+ interface ManagementGetOrderOptions {
1995
+ fieldSet?: Set;
1996
+ }
1997
+ interface ManagementListOrdersOptions {
1998
+ /** Filter by specific member IDs of buyers who ordered a pricing plan. */
1999
+ buyerIds?: string[];
2000
+ /** Filter by specific IDs of plans that were ordered. */
2001
+ planIds?: string[];
2002
+ /** Filter by whether or not the auto-renewal of recurring orders was canceled. */
2003
+ autoRenewCanceled?: boolean | null;
2004
+ /**
2005
+ * Filter by the order status. Supported values:
2006
+ * + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
2007
+ * + `PENDING`: Order has been purchased and its start date is set in the future.
2008
+ * + `ACTIVE`: Order has been processed. The plan is available for use.
2009
+ * + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
2010
+ * + `ENDED`: Order has completed its duration and is no longer available for use.
2011
+ * + `CANCELED`: Order has been [canceled](#cancelorder).
2012
+ */
2013
+ orderStatuses?: OrderStatus[];
2014
+ /**
2015
+ * Filter by payment status.
2016
+ *
2017
+ * Supported values:
2018
+ * + `PAID`: The last payment was paid.
2019
+ * + `REFUNDED`: The last payment was refunded.
2020
+ * + `FAILED`: The last payment transaction didn't complete.
2021
+ * + `UNPAID`: The last payment wasn't paid.
2022
+ * + `PENDING`: Awaiting payment.
2023
+ * + `NOT_APPLICABLE`: No payment was necessary. For example, for free plans or free trials.
2024
+ */
2025
+ paymentStatuses?: PaymentStatus[];
2026
+ /**
2027
+ * Number of pricing plan orders to return.
2028
+ *
2029
+ * Default: `50`
2030
+ */
2031
+ limit?: number | null;
2032
+ /** Number of orders to skip in the current sort order. */
2033
+ offset?: number | null;
2034
+ /**
2035
+ * Sort order.
2036
+ *
2037
+ * Use `ASC` for ascending order or `DESC` for descending order.
2038
+ *
2039
+ * Default: `DESC`
2040
+ */
2041
+ sorting?: Sorting$1;
2042
+ /** Parameter to define amount of fields to return. FULL returns each order's submission data. Supported values: UNKNOWN_SET, BASIC, FULL */
2043
+ fieldSet?: Set;
2044
+ }
2045
+
2046
+ interface HttpClient {
2047
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
2048
+ }
2049
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
2050
+ type HttpResponse<T = any> = {
2051
+ data: T;
2052
+ status: number;
2053
+ statusText: string;
2054
+ headers: any;
2055
+ request?: any;
2056
+ };
2057
+ type RequestOptions<_TResponse = any, Data = any> = {
2058
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2059
+ url: string;
2060
+ data?: Data;
2061
+ params?: URLSearchParams;
2062
+ } & APIMetadata;
2063
+ type APIMetadata = {
2064
+ methodFqn?: string;
2065
+ entityFqdn?: string;
2066
+ packageName?: string;
2067
+ };
2068
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
2069
+ __type: 'event-definition';
2070
+ type: Type;
2071
+ isDomainEvent?: boolean;
2072
+ transformations?: unknown;
2073
+ __payload: Payload;
2074
+ };
2075
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2076
+
2077
+ declare const __metadata$1: {
2078
+ PACKAGE_NAME: string;
2079
+ };
2080
+ declare function memberGetOrder(httpClient: HttpClient): (_id: string, options?: MemberGetOrderOptions) => Promise<Order & {
2081
+ _id: string;
2082
+ planId: string;
2083
+ subscriptionId: string;
2084
+ buyer?: {
2085
+ memberId: string;
2086
+ contactId: string;
2087
+ } | undefined;
2088
+ priceDetails?: {
2089
+ subscription?: {
2090
+ cycleDuration?: {
2091
+ unit: PeriodUnit$1;
2092
+ } | undefined;
2093
+ } | undefined;
2094
+ singlePaymentForDuration?: {
2095
+ unit: PeriodUnit$1;
2096
+ } | undefined;
2097
+ subtotal: string;
2098
+ discount: string;
2099
+ tax?: {
2100
+ name: string;
2101
+ includedInPrice: boolean;
2102
+ rate: string;
2103
+ amount: string;
2104
+ } | undefined;
2105
+ total: string;
2106
+ planPrice: string;
2107
+ currency: string;
2108
+ coupon?: {
2109
+ code: string;
2110
+ amount: string;
2111
+ _id: string;
2112
+ } | undefined;
2113
+ } | undefined;
2114
+ pricing?: {
2115
+ subscription?: {
2116
+ cycleDuration?: {
2117
+ unit: PeriodUnit$1;
2118
+ } | undefined;
2119
+ } | undefined;
2120
+ singlePaymentForDuration?: {
2121
+ unit: PeriodUnit$1;
2122
+ } | undefined;
2123
+ prices: {
2124
+ duration?: {
2125
+ cycleFrom: number;
2126
+ } | undefined;
2127
+ price?: {
2128
+ subtotal: string;
2129
+ coupon?: {
2130
+ code: string;
2131
+ amount: string;
2132
+ _id: string;
2133
+ } | undefined;
2134
+ discount: string;
2135
+ tax?: {
2136
+ name: string;
2137
+ includedInPrice: boolean;
2138
+ rate: string;
2139
+ amount: string;
2140
+ } | undefined;
2141
+ total: string;
2142
+ currency: string;
2143
+ proration: string;
2144
+ } | undefined;
2145
+ }[];
2146
+ } | undefined;
2147
+ type: OrderType;
2148
+ status: OrderStatus;
2149
+ cancellation?: {
2150
+ cause: CancellationCause;
2151
+ effectiveAt: CancellationEffectiveAt;
2152
+ } | undefined;
2153
+ lastPaymentStatus: PaymentStatus;
2154
+ pausePeriods: {
2155
+ status: Status;
2156
+ }[];
2157
+ currentCycle?: {
2158
+ index: number;
2159
+ } | undefined;
2160
+ planName: string;
2161
+ planDescription: string;
2162
+ planPrice: string;
2163
+ }>;
2164
+ declare function memberListOrders(httpClient: HttpClient): (options?: MemberListOrdersOptions) => Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
2165
+ declare function requestCancellation(httpClient: HttpClient): (_id: string, effectiveAt: CancellationEffectiveAt) => Promise<void>;
2166
+ declare function createOfflineOrder(httpClient: HttpClient): (planId: string, memberId: string, options?: CreateOfflineOrderOptions) => Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
2167
+ declare function getOfflineOrderPreview(httpClient: HttpClient): (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions) => Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
2168
+ declare function getPricePreview(httpClient: HttpClient): (planId: string, options?: GetPricePreviewOptions) => Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
2169
+ declare function managementGetOrder(httpClient: HttpClient): (_id: string, options?: ManagementGetOrderOptions) => Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
2170
+ declare function managementListOrders(httpClient: HttpClient): (options?: ManagementListOrdersOptions) => Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
2171
+ declare function postponeEndDate(httpClient: HttpClient): (_id: string, endDate: Date) => Promise<void>;
2172
+ declare function cancelOrder(httpClient: HttpClient): (_id: string, effectiveAt: CancellationEffectiveAt) => Promise<void>;
2173
+ declare function markAsPaid(httpClient: HttpClient): (_id: string) => Promise<void>;
2174
+ declare function pauseOrder(httpClient: HttpClient): (_id: string) => Promise<void>;
2175
+ declare function resumeOrder(httpClient: HttpClient): (_id: string) => Promise<void>;
2176
+ declare const onOrderCanceled: EventDefinition<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
2177
+ declare const onOrderCreated: EventDefinition<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
2178
+ declare const onOrderUpdated: EventDefinition<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
2179
+ declare const onOrderStartDateChanged: EventDefinition<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
2180
+ declare const onOrderPurchased: EventDefinition<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
2181
+ declare const onOrderStarted: EventDefinition<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
2182
+ declare const onOrderCycleStarted: EventDefinition<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
2183
+ declare const onOrderAutoRenewCanceled: EventDefinition<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
2184
+ declare const onOrderEnded: EventDefinition<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
2185
+ declare const onOrderEndDatePostponed: EventDefinition<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
2186
+ declare const onOrderMarkedAsPaid: EventDefinition<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
2187
+ declare const onOrderPaused: EventDefinition<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
2188
+ declare const onOrderResumed: EventDefinition<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
2189
+
2190
+ type index_d$1_ApplyCouponRequest = ApplyCouponRequest;
2191
+ type index_d$1_ApplyCouponResponse = ApplyCouponResponse;
2192
+ type index_d$1_BulkOrderResult = BulkOrderResult;
2193
+ type index_d$1_BulkPauseOrderRequest = BulkPauseOrderRequest;
2194
+ type index_d$1_BulkPauseOrderResponse = BulkPauseOrderResponse;
2195
+ type index_d$1_BulkResumeOrderRequest = BulkResumeOrderRequest;
2196
+ type index_d$1_BulkResumeOrderResponse = BulkResumeOrderResponse;
2197
+ type index_d$1_Buyer = Buyer;
2198
+ type index_d$1_CancelOrderRequest = CancelOrderRequest;
2199
+ type index_d$1_CancelOrderResponse = CancelOrderResponse;
2200
+ type index_d$1_Cancellation = Cancellation;
2201
+ type index_d$1_CancellationCause = CancellationCause;
2202
+ declare const index_d$1_CancellationCause: typeof CancellationCause;
2203
+ type index_d$1_CancellationEffectiveAt = CancellationEffectiveAt;
2204
+ declare const index_d$1_CancellationEffectiveAt: typeof CancellationEffectiveAt;
2205
+ type index_d$1_Captcha = Captcha;
2206
+ type index_d$1_ChangeStartDateRequest = ChangeStartDateRequest;
2207
+ type index_d$1_ChangeStartDateResponse = ChangeStartDateResponse;
2208
+ type index_d$1_Coupon = Coupon;
2209
+ type index_d$1_CouponsError = CouponsError;
2210
+ type index_d$1_CreateExternalOrderRequest = CreateExternalOrderRequest;
2211
+ type index_d$1_CreateExternalOrderResponse = CreateExternalOrderResponse;
2212
+ type index_d$1_CreateGuestOnlineOrderRequest = CreateGuestOnlineOrderRequest;
2213
+ type index_d$1_CreateGuestOnlineOrderResponse = CreateGuestOnlineOrderResponse;
2214
+ type index_d$1_CreateOfflineOrderOptions = CreateOfflineOrderOptions;
2215
+ type index_d$1_CreateOfflineOrderRequest = CreateOfflineOrderRequest;
2216
+ type index_d$1_CreateOfflineOrderResponse = CreateOfflineOrderResponse;
2217
+ type index_d$1_CreateOfflineOrderResponseNonNullableFields = CreateOfflineOrderResponseNonNullableFields;
2218
+ type index_d$1_CreateOnlineOrderRequest = CreateOnlineOrderRequest;
2219
+ type index_d$1_CreateOnlineOrderResponse = CreateOnlineOrderResponse;
2220
+ type index_d$1_CurrentCycle = CurrentCycle;
2221
+ type index_d$1_CursorPaging = CursorPaging;
2222
+ type index_d$1_Empty = Empty;
2223
+ type index_d$1_FormData = FormData;
2224
+ type index_d$1_GetAvailableOrderActionsRequest = GetAvailableOrderActionsRequest;
2225
+ type index_d$1_GetAvailableOrderActionsResponse = GetAvailableOrderActionsResponse;
2226
+ type index_d$1_GetGuestOnlineOrderPreviewRequest = GetGuestOnlineOrderPreviewRequest;
2227
+ type index_d$1_GetGuestOnlineOrderPreviewResponse = GetGuestOnlineOrderPreviewResponse;
2228
+ type index_d$1_GetOfflineOrderPreviewOptions = GetOfflineOrderPreviewOptions;
2229
+ type index_d$1_GetOfflineOrderPreviewRequest = GetOfflineOrderPreviewRequest;
2230
+ type index_d$1_GetOfflineOrderPreviewResponse = GetOfflineOrderPreviewResponse;
2231
+ type index_d$1_GetOfflineOrderPreviewResponseNonNullableFields = GetOfflineOrderPreviewResponseNonNullableFields;
2232
+ type index_d$1_GetOnlineOrderPreviewRequest = GetOnlineOrderPreviewRequest;
2233
+ type index_d$1_GetOnlineOrderPreviewResponse = GetOnlineOrderPreviewResponse;
2234
+ type index_d$1_GetOrderRequest = GetOrderRequest;
2235
+ type index_d$1_GetOrderResponse = GetOrderResponse;
2236
+ type index_d$1_GetOrderResponseNonNullableFields = GetOrderResponseNonNullableFields;
2237
+ type index_d$1_GetOrdersStatsRequest = GetOrdersStatsRequest;
2238
+ type index_d$1_GetOrdersStatsResponse = GetOrdersStatsResponse;
2239
+ type index_d$1_GetPricePreviewOptions = GetPricePreviewOptions;
2240
+ type index_d$1_GetPricePreviewRequest = GetPricePreviewRequest;
2241
+ type index_d$1_GetPricePreviewResponse = GetPricePreviewResponse;
2242
+ type index_d$1_GetPricePreviewResponseNonNullableFields = GetPricePreviewResponseNonNullableFields;
2243
+ type index_d$1_Guest = Guest;
2244
+ type index_d$1_ListOrdersRequest = ListOrdersRequest;
2245
+ type index_d$1_ListOrdersResponse = ListOrdersResponse;
2246
+ type index_d$1_ListOrdersResponseNonNullableFields = ListOrdersResponseNonNullableFields;
2247
+ type index_d$1_ManagementGetOrderOptions = ManagementGetOrderOptions;
2248
+ type index_d$1_ManagementListOrdersOptions = ManagementListOrdersOptions;
2249
+ type index_d$1_MarkAsPaidRequest = MarkAsPaidRequest;
2250
+ type index_d$1_MarkAsPaidResponse = MarkAsPaidResponse;
2251
+ type index_d$1_MemberGetOrderOptions = MemberGetOrderOptions;
2252
+ type index_d$1_MemberGetOrderRequest = MemberGetOrderRequest;
2253
+ type index_d$1_MemberGetOrderResponse = MemberGetOrderResponse;
2254
+ type index_d$1_MemberGetOrderResponseNonNullableFields = MemberGetOrderResponseNonNullableFields;
2255
+ type index_d$1_MemberListOrdersOptions = MemberListOrdersOptions;
2256
+ type index_d$1_MemberListOrdersRequest = MemberListOrdersRequest;
2257
+ type index_d$1_MemberListOrdersResponse = MemberListOrdersResponse;
2258
+ type index_d$1_MemberListOrdersResponseNonNullableFields = MemberListOrdersResponseNonNullableFields;
2259
+ type index_d$1_OnBehalf = OnBehalf;
2260
+ type index_d$1_Order = Order;
2261
+ type index_d$1_OrderAutoRenewCanceled = OrderAutoRenewCanceled;
2262
+ type index_d$1_OrderAutoRenewCanceledEnvelope = OrderAutoRenewCanceledEnvelope;
2263
+ type index_d$1_OrderCanceled = OrderCanceled;
2264
+ type index_d$1_OrderCanceledEnvelope = OrderCanceledEnvelope;
2265
+ type index_d$1_OrderCreatedEnvelope = OrderCreatedEnvelope;
2266
+ type index_d$1_OrderCycle = OrderCycle;
2267
+ type index_d$1_OrderCycleStarted = OrderCycleStarted;
2268
+ type index_d$1_OrderCycleStartedEnvelope = OrderCycleStartedEnvelope;
2269
+ type index_d$1_OrderEndDatePostponed = OrderEndDatePostponed;
2270
+ type index_d$1_OrderEndDatePostponedEnvelope = OrderEndDatePostponedEnvelope;
2271
+ type index_d$1_OrderEnded = OrderEnded;
2272
+ type index_d$1_OrderEndedEnvelope = OrderEndedEnvelope;
2273
+ type index_d$1_OrderMarkedAsPaid = OrderMarkedAsPaid;
2274
+ type index_d$1_OrderMarkedAsPaidEnvelope = OrderMarkedAsPaidEnvelope;
2275
+ type index_d$1_OrderMethod = OrderMethod;
2276
+ declare const index_d$1_OrderMethod: typeof OrderMethod;
2277
+ type index_d$1_OrderPaused = OrderPaused;
2278
+ type index_d$1_OrderPausedEnvelope = OrderPausedEnvelope;
2279
+ type index_d$1_OrderPurchased = OrderPurchased;
2280
+ type index_d$1_OrderPurchasedEnvelope = OrderPurchasedEnvelope;
2281
+ type index_d$1_OrderResumed = OrderResumed;
2282
+ type index_d$1_OrderResumedEnvelope = OrderResumedEnvelope;
2283
+ type index_d$1_OrderStartDateChanged = OrderStartDateChanged;
2284
+ type index_d$1_OrderStartDateChangedEnvelope = OrderStartDateChangedEnvelope;
2285
+ type index_d$1_OrderStarted = OrderStarted;
2286
+ type index_d$1_OrderStartedEnvelope = OrderStartedEnvelope;
2287
+ type index_d$1_OrderStatus = OrderStatus;
2288
+ declare const index_d$1_OrderStatus: typeof OrderStatus;
2289
+ type index_d$1_OrderType = OrderType;
2290
+ declare const index_d$1_OrderType: typeof OrderType;
2291
+ type index_d$1_OrderUpdatedEnvelope = OrderUpdatedEnvelope;
2292
+ type index_d$1_OrdersQueryOrdersRequest = OrdersQueryOrdersRequest;
2293
+ type index_d$1_OrdersQueryOrdersResponse = OrdersQueryOrdersResponse;
2294
+ type index_d$1_PauseOrderRequest = PauseOrderRequest;
2295
+ type index_d$1_PauseOrderResponse = PauseOrderResponse;
2296
+ type index_d$1_PausePeriod = PausePeriod;
2297
+ type index_d$1_PaymentStatus = PaymentStatus;
2298
+ declare const index_d$1_PaymentStatus: typeof PaymentStatus;
2299
+ type index_d$1_PostponeEndDateRequest = PostponeEndDateRequest;
2300
+ type index_d$1_PostponeEndDateResponse = PostponeEndDateResponse;
2301
+ type index_d$1_Price = Price;
2302
+ type index_d$1_PriceDetails = PriceDetails;
2303
+ type index_d$1_PriceDetailsPricingModelOneOf = PriceDetailsPricingModelOneOf;
2304
+ type index_d$1_PriceDuration = PriceDuration;
2305
+ type index_d$1_PricingDetails = PricingDetails;
2306
+ type index_d$1_PricingDetailsPricingModelOneOf = PricingDetailsPricingModelOneOf;
2307
+ type index_d$1_QueryOrdersRequest = QueryOrdersRequest;
2308
+ type index_d$1_QueryOrdersResponse = QueryOrdersResponse;
2309
+ type index_d$1_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
2310
+ type index_d$1_ReasonNotSuspendable = ReasonNotSuspendable;
2311
+ declare const index_d$1_ReasonNotSuspendable: typeof ReasonNotSuspendable;
2312
+ type index_d$1_RequestCancellationRequest = RequestCancellationRequest;
2313
+ type index_d$1_RequestCancellationResponse = RequestCancellationResponse;
2314
+ type index_d$1_ResumeOrderRequest = ResumeOrderRequest;
2315
+ type index_d$1_ResumeOrderResponse = ResumeOrderResponse;
2316
+ type index_d$1_Set = Set;
2317
+ declare const index_d$1_Set: typeof Set;
2318
+ type index_d$1_SetSubmissionRequest = SetSubmissionRequest;
2319
+ type index_d$1_SetSubmissionResponse = SetSubmissionResponse;
2320
+ type index_d$1_SpannedPrice = SpannedPrice;
2321
+ type index_d$1_Status = Status;
2322
+ declare const index_d$1_Status: typeof Status;
2323
+ type index_d$1_Tax = Tax;
2324
+ declare const index_d$1_cancelOrder: typeof cancelOrder;
2325
+ declare const index_d$1_createOfflineOrder: typeof createOfflineOrder;
2326
+ declare const index_d$1_getOfflineOrderPreview: typeof getOfflineOrderPreview;
2327
+ declare const index_d$1_getPricePreview: typeof getPricePreview;
2328
+ declare const index_d$1_managementGetOrder: typeof managementGetOrder;
2329
+ declare const index_d$1_managementListOrders: typeof managementListOrders;
2330
+ declare const index_d$1_markAsPaid: typeof markAsPaid;
2331
+ declare const index_d$1_memberGetOrder: typeof memberGetOrder;
2332
+ declare const index_d$1_memberListOrders: typeof memberListOrders;
2333
+ declare const index_d$1_onOrderAutoRenewCanceled: typeof onOrderAutoRenewCanceled;
2334
+ declare const index_d$1_onOrderCanceled: typeof onOrderCanceled;
2335
+ declare const index_d$1_onOrderCreated: typeof onOrderCreated;
2336
+ declare const index_d$1_onOrderCycleStarted: typeof onOrderCycleStarted;
2337
+ declare const index_d$1_onOrderEndDatePostponed: typeof onOrderEndDatePostponed;
2338
+ declare const index_d$1_onOrderEnded: typeof onOrderEnded;
2339
+ declare const index_d$1_onOrderMarkedAsPaid: typeof onOrderMarkedAsPaid;
2340
+ declare const index_d$1_onOrderPaused: typeof onOrderPaused;
2341
+ declare const index_d$1_onOrderPurchased: typeof onOrderPurchased;
2342
+ declare const index_d$1_onOrderResumed: typeof onOrderResumed;
2343
+ declare const index_d$1_onOrderStartDateChanged: typeof onOrderStartDateChanged;
2344
+ declare const index_d$1_onOrderStarted: typeof onOrderStarted;
2345
+ declare const index_d$1_onOrderUpdated: typeof onOrderUpdated;
2346
+ declare const index_d$1_pauseOrder: typeof pauseOrder;
2347
+ declare const index_d$1_postponeEndDate: typeof postponeEndDate;
2348
+ declare const index_d$1_requestCancellation: typeof requestCancellation;
2349
+ declare const index_d$1_resumeOrder: typeof resumeOrder;
2350
+ declare namespace index_d$1 {
2351
+ export { type ActionEvent$1 as ActionEvent, type ApplicationError$1 as ApplicationError, type index_d$1_ApplyCouponRequest as ApplyCouponRequest, type index_d$1_ApplyCouponResponse as ApplyCouponResponse, type BaseEventMetadata$1 as BaseEventMetadata, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$1_BulkOrderResult as BulkOrderResult, type index_d$1_BulkPauseOrderRequest as BulkPauseOrderRequest, type index_d$1_BulkPauseOrderResponse as BulkPauseOrderResponse, type index_d$1_BulkResumeOrderRequest as BulkResumeOrderRequest, type index_d$1_BulkResumeOrderResponse as BulkResumeOrderResponse, type index_d$1_Buyer as Buyer, type index_d$1_CancelOrderRequest as CancelOrderRequest, type index_d$1_CancelOrderResponse as CancelOrderResponse, type index_d$1_Cancellation as Cancellation, index_d$1_CancellationCause as CancellationCause, index_d$1_CancellationEffectiveAt as CancellationEffectiveAt, type index_d$1_Captcha as Captcha, type index_d$1_ChangeStartDateRequest as ChangeStartDateRequest, type index_d$1_ChangeStartDateResponse as ChangeStartDateResponse, type index_d$1_Coupon as Coupon, type index_d$1_CouponsError as CouponsError, type index_d$1_CreateExternalOrderRequest as CreateExternalOrderRequest, type index_d$1_CreateExternalOrderResponse as CreateExternalOrderResponse, type index_d$1_CreateGuestOnlineOrderRequest as CreateGuestOnlineOrderRequest, type index_d$1_CreateGuestOnlineOrderResponse as CreateGuestOnlineOrderResponse, type index_d$1_CreateOfflineOrderOptions as CreateOfflineOrderOptions, type index_d$1_CreateOfflineOrderRequest as CreateOfflineOrderRequest, type index_d$1_CreateOfflineOrderResponse as CreateOfflineOrderResponse, type index_d$1_CreateOfflineOrderResponseNonNullableFields as CreateOfflineOrderResponseNonNullableFields, type index_d$1_CreateOnlineOrderRequest as CreateOnlineOrderRequest, type index_d$1_CreateOnlineOrderResponse as CreateOnlineOrderResponse, type index_d$1_CurrentCycle as CurrentCycle, type index_d$1_CursorPaging as CursorPaging, type Cursors$1 as Cursors, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Duration$1 as Duration, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type Fee$1 as Fee, type index_d$1_FormData as FormData, type index_d$1_GetAvailableOrderActionsRequest as GetAvailableOrderActionsRequest, type index_d$1_GetAvailableOrderActionsResponse as GetAvailableOrderActionsResponse, type index_d$1_GetGuestOnlineOrderPreviewRequest as GetGuestOnlineOrderPreviewRequest, type index_d$1_GetGuestOnlineOrderPreviewResponse as GetGuestOnlineOrderPreviewResponse, type index_d$1_GetOfflineOrderPreviewOptions as GetOfflineOrderPreviewOptions, type index_d$1_GetOfflineOrderPreviewRequest as GetOfflineOrderPreviewRequest, type index_d$1_GetOfflineOrderPreviewResponse as GetOfflineOrderPreviewResponse, type index_d$1_GetOfflineOrderPreviewResponseNonNullableFields as GetOfflineOrderPreviewResponseNonNullableFields, type index_d$1_GetOnlineOrderPreviewRequest as GetOnlineOrderPreviewRequest, type index_d$1_GetOnlineOrderPreviewResponse as GetOnlineOrderPreviewResponse, type index_d$1_GetOrderRequest as GetOrderRequest, type index_d$1_GetOrderResponse as GetOrderResponse, type index_d$1_GetOrderResponseNonNullableFields as GetOrderResponseNonNullableFields, type index_d$1_GetOrdersStatsRequest as GetOrdersStatsRequest, type index_d$1_GetOrdersStatsResponse as GetOrdersStatsResponse, type index_d$1_GetPricePreviewOptions as GetPricePreviewOptions, type index_d$1_GetPricePreviewRequest as GetPricePreviewRequest, type index_d$1_GetPricePreviewResponse as GetPricePreviewResponse, type index_d$1_GetPricePreviewResponseNonNullableFields as GetPricePreviewResponseNonNullableFields, type index_d$1_Guest as Guest, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type ItemMetadata$1 as ItemMetadata, type index_d$1_ListOrdersRequest as ListOrdersRequest, type index_d$1_ListOrdersResponse as ListOrdersResponse, type index_d$1_ListOrdersResponseNonNullableFields as ListOrdersResponseNonNullableFields, type index_d$1_ManagementGetOrderOptions as ManagementGetOrderOptions, type index_d$1_ManagementListOrdersOptions as ManagementListOrdersOptions, type index_d$1_MarkAsPaidRequest as MarkAsPaidRequest, type index_d$1_MarkAsPaidResponse as MarkAsPaidResponse, type index_d$1_MemberGetOrderOptions as MemberGetOrderOptions, type index_d$1_MemberGetOrderRequest as MemberGetOrderRequest, type index_d$1_MemberGetOrderResponse as MemberGetOrderResponse, type index_d$1_MemberGetOrderResponseNonNullableFields as MemberGetOrderResponseNonNullableFields, type index_d$1_MemberListOrdersOptions as MemberListOrdersOptions, type index_d$1_MemberListOrdersRequest as MemberListOrdersRequest, type index_d$1_MemberListOrdersResponse as MemberListOrdersResponse, type index_d$1_MemberListOrdersResponseNonNullableFields as MemberListOrdersResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_OnBehalf as OnBehalf, type index_d$1_Order as Order, type index_d$1_OrderAutoRenewCanceled as OrderAutoRenewCanceled, type index_d$1_OrderAutoRenewCanceledEnvelope as OrderAutoRenewCanceledEnvelope, type index_d$1_OrderCanceled as OrderCanceled, type index_d$1_OrderCanceledEnvelope as OrderCanceledEnvelope, type index_d$1_OrderCreatedEnvelope as OrderCreatedEnvelope, type index_d$1_OrderCycle as OrderCycle, type index_d$1_OrderCycleStarted as OrderCycleStarted, type index_d$1_OrderCycleStartedEnvelope as OrderCycleStartedEnvelope, type index_d$1_OrderEndDatePostponed as OrderEndDatePostponed, type index_d$1_OrderEndDatePostponedEnvelope as OrderEndDatePostponedEnvelope, type index_d$1_OrderEnded as OrderEnded, type index_d$1_OrderEndedEnvelope as OrderEndedEnvelope, type index_d$1_OrderMarkedAsPaid as OrderMarkedAsPaid, type index_d$1_OrderMarkedAsPaidEnvelope as OrderMarkedAsPaidEnvelope, index_d$1_OrderMethod as OrderMethod, type index_d$1_OrderPaused as OrderPaused, type index_d$1_OrderPausedEnvelope as OrderPausedEnvelope, type index_d$1_OrderPurchased as OrderPurchased, type index_d$1_OrderPurchasedEnvelope as OrderPurchasedEnvelope, type index_d$1_OrderResumed as OrderResumed, type index_d$1_OrderResumedEnvelope as OrderResumedEnvelope, type index_d$1_OrderStartDateChanged as OrderStartDateChanged, type index_d$1_OrderStartDateChangedEnvelope as OrderStartDateChangedEnvelope, type index_d$1_OrderStarted as OrderStarted, type index_d$1_OrderStartedEnvelope as OrderStartedEnvelope, index_d$1_OrderStatus as OrderStatus, index_d$1_OrderType as OrderType, type index_d$1_OrderUpdatedEnvelope as OrderUpdatedEnvelope, type index_d$1_OrdersQueryOrdersRequest as OrdersQueryOrdersRequest, type index_d$1_OrdersQueryOrdersResponse as OrdersQueryOrdersResponse, type Paging$1 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type index_d$1_PauseOrderRequest as PauseOrderRequest, type index_d$1_PauseOrderResponse as PauseOrderResponse, type index_d$1_PausePeriod as PausePeriod, index_d$1_PaymentStatus as PaymentStatus, PeriodUnit$1 as PeriodUnit, type index_d$1_PostponeEndDateRequest as PostponeEndDateRequest, type index_d$1_PostponeEndDateResponse as PostponeEndDateResponse, type index_d$1_Price as Price, type index_d$1_PriceDetails as PriceDetails, type index_d$1_PriceDetailsPricingModelOneOf as PriceDetailsPricingModelOneOf, type index_d$1_PriceDuration as PriceDuration, type index_d$1_PricingDetails as PricingDetails, type index_d$1_PricingDetailsPricingModelOneOf as PricingDetailsPricingModelOneOf, type index_d$1_QueryOrdersRequest as QueryOrdersRequest, type index_d$1_QueryOrdersResponse as QueryOrdersResponse, type QueryV2$1 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, index_d$1_ReasonNotSuspendable as ReasonNotSuspendable, type Recurrence$1 as Recurrence, type index_d$1_RequestCancellationRequest as RequestCancellationRequest, type index_d$1_RequestCancellationResponse as RequestCancellationResponse, type index_d$1_ResumeOrderRequest as ResumeOrderRequest, type index_d$1_ResumeOrderResponse as ResumeOrderResponse, index_d$1_Set as Set, type index_d$1_SetSubmissionRequest as SetSubmissionRequest, type index_d$1_SetSubmissionResponse as SetSubmissionResponse, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type index_d$1_SpannedPrice as SpannedPrice, index_d$1_Status as Status, type index_d$1_Tax as Tax, WebhookIdentityType$1 as WebhookIdentityType, __metadata$1 as __metadata, index_d$1_cancelOrder as cancelOrder, index_d$1_createOfflineOrder as createOfflineOrder, index_d$1_getOfflineOrderPreview as getOfflineOrderPreview, index_d$1_getPricePreview as getPricePreview, index_d$1_managementGetOrder as managementGetOrder, index_d$1_managementListOrders as managementListOrders, index_d$1_markAsPaid as markAsPaid, index_d$1_memberGetOrder as memberGetOrder, index_d$1_memberListOrders as memberListOrders, index_d$1_onOrderAutoRenewCanceled as onOrderAutoRenewCanceled, index_d$1_onOrderCanceled as onOrderCanceled, index_d$1_onOrderCreated as onOrderCreated, index_d$1_onOrderCycleStarted as onOrderCycleStarted, index_d$1_onOrderEndDatePostponed as onOrderEndDatePostponed, index_d$1_onOrderEnded as onOrderEnded, index_d$1_onOrderMarkedAsPaid as onOrderMarkedAsPaid, index_d$1_onOrderPaused as onOrderPaused, index_d$1_onOrderPurchased as onOrderPurchased, index_d$1_onOrderResumed as onOrderResumed, index_d$1_onOrderStartDateChanged as onOrderStartDateChanged, index_d$1_onOrderStarted as onOrderStarted, index_d$1_onOrderUpdated as onOrderUpdated, index_d$1_pauseOrder as pauseOrder, index_d$1_postponeEndDate as postponeEndDate, index_d$1_requestCancellation as requestCancellation, index_d$1_resumeOrder as resumeOrder };
2352
+ }
2353
+
2354
+ /** Information about the pricing plan. */
2355
+ interface Plan {
2356
+ /**
2357
+ * Plan ID.
2358
+ * @readonly
2359
+ */
2360
+ _id?: string;
2361
+ /** Plan name. */
2362
+ name?: string | null;
2363
+ /** Plan description. */
2364
+ description?: string | null;
2365
+ /**
2366
+ * List of text strings that promote what is included with this plan.
2367
+ *
2368
+ * For example, "Plenty of parking" or "Free gift on your birthday".
2369
+ */
2370
+ perks?: StringList;
2371
+ /** Plan price, payment schedule, and expiration. */
2372
+ pricing?: Pricing;
2373
+ /** Whether the plan is public (visible to site visitors and members). */
2374
+ public?: boolean | null;
2375
+ /**
2376
+ * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
2377
+ * @readonly
2378
+ */
2379
+ archived?: boolean;
2380
+ /**
2381
+ * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
2382
+ *
2383
+ * Default: `false`.
2384
+ * @readonly
2385
+ */
2386
+ primary?: boolean;
2387
+ /**
2388
+ * Whether the plan has any orders (including pending and unpaid orders).
2389
+ * @readonly
2390
+ */
2391
+ hasOrders?: boolean;
2392
+ /**
2393
+ * Date plan was created.
2394
+ * @readonly
2395
+ */
2396
+ _createdDate?: Date;
2397
+ /**
2398
+ * Date plan was last updated.
2399
+ * @readonly
2400
+ */
2401
+ _updatedDate?: Date;
2402
+ /**
2403
+ * URL-friendly version of plan name. Unique across all plans in the same site.
2404
+ * @readonly
2405
+ */
2406
+ slug?: string | null;
2407
+ /**
2408
+ * Number of times the same buyer can purchase the plan. Currently limited to support:
2409
+ * - Empty value or a value of `0`, meaning no limitation.
2410
+ * - Value of `1`, meaning limited to one purchase per buyer.
2411
+ */
2412
+ maxPurchasesPerBuyer?: number | null;
2413
+ /**
2414
+ * Whether the buyer can start the plan at a later date.
2415
+ *
2416
+ * Default: `false`.
2417
+ *
2418
+ */
2419
+ allowFutureStartDate?: boolean | null;
2420
+ /**
2421
+ * Whether the buyer is allowed to cancel their plan. If `false`, calling the [`requestCancellation()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/requestcancellation) function returns an error.
2422
+ *
2423
+ * Default: `true`.
2424
+ *
2425
+ */
2426
+ buyerCanCancel?: boolean | null;
2427
+ /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
2428
+ termsAndConditions?: string | null;
2429
+ /** ID of the form associated with the plan at checkout. */
2430
+ formId?: string | null;
2431
+ }
2432
+ /** This wrapper type exist in order to distinguish an empty string list from no list at all in update requests. */
2433
+ interface StringList {
2434
+ /** List of strings */
2435
+ values?: string[];
2436
+ }
2437
+ /** Plan pricing information. Includes the price of the plan and payment details. */
2438
+ interface Pricing extends PricingPricingModelOneOf {
2439
+ /**
2440
+ * Pricing model indicating that the plan has recurring payments.
2441
+ *
2442
+ * Note: This type of subscription is not a "Wix subscription," which encompasses various types of subscriptions, such as Wix Stores subscriptions, Wix invoice subscriptions, and *all* pricing plan models.
2443
+ */
2444
+ subscription?: Recurrence;
2445
+ /** Pricing model indicating a single payment per cycle and the length of the cycle. The cycle is the duration of the plan, not a payment cycle. */
2446
+ singlePaymentForDuration?: Duration;
2447
+ /** Pricing model indicating the plan is paid in one single payment. The plan is valid until canceled. */
2448
+ singlePaymentUnlimited?: boolean | null;
2449
+ /** Amount for a single payment. For subscriptions, this is the amount to pay each payment cycle and it is required. For plans that are not recurring plans, it is the single payment amount for the whole subscription. */
2450
+ price?: Money;
2451
+ /** Free trial period for the plan in days. Available only for recurring plans, meaning plans whose pricing model is `subscription`. Set to `0` to remove the free trial. */
2452
+ freeTrialDays?: number | null;
2453
+ }
2454
+ /** @oneof */
2455
+ interface PricingPricingModelOneOf {
2456
+ /** Plan has recurring payments. */
2457
+ subscription?: Recurrence;
2458
+ /** One time payment, plan is valid for the specified duration. */
2459
+ singlePaymentForDuration?: Duration;
2460
+ /** One time payment, plan is valid until it is canceled. */
2461
+ singlePaymentUnlimited?: boolean | null;
2462
+ }
2463
+ /** An object specifying how often and for how long payments recur (may be forever). */
2464
+ interface Recurrence {
2465
+ /** Length of one payment cycle. For example, 1 month to have monthly payments. Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration. Currently, only a value of `1` is supported. */
2466
+ cycleDuration?: Duration;
2467
+ /**
2468
+ * Amount of payment cycles the subscription is valid for.
2469
+ *
2470
+ * `0` for unlimited plans or for plans that are valid until canceled.
2471
+ */
2472
+ cycleCount?: number | null;
2473
+ }
2474
+ /** A duration expressed in number of time units. */
2475
+ interface Duration {
2476
+ /** Number of days days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
2477
+ count?: number | null;
2478
+ /** Unit of time for the cycle duration. */
2479
+ unit?: PeriodUnit;
2480
+ }
2481
+ declare enum PeriodUnit {
2482
+ UNDEFINED = "UNDEFINED",
2483
+ DAY = "DAY",
2484
+ WEEK = "WEEK",
2485
+ MONTH = "MONTH",
2486
+ YEAR = "YEAR"
2487
+ }
2488
+ interface Money {
2489
+ /** Monetary amount. Decimal string with a period as a decimal separator. For example, `'3.99'`. Cannot be a negative value. */
2490
+ value?: string;
2491
+ /**
2492
+ * Currency code. Three-letter currency code in
2493
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `'USD'`.
2494
+ */
2495
+ currency?: string;
2496
+ }
2497
+ interface FeeConfig {
2498
+ fee?: Fee;
2499
+ /** The time this fee will be charged */
2500
+ appliedAt?: AppliedAt;
2501
+ }
2502
+ interface Fee {
2503
+ /** Fee name */
2504
+ name?: string;
2505
+ /** Amount of fee to be charged */
2506
+ amount?: string;
2507
+ }
2508
+ declare enum AppliedAt {
2509
+ UNKNOWN_CHARGE_EVENT = "UNKNOWN_CHARGE_EVENT",
2510
+ /** Will charge the fee on first payment. If order has a free trial meaning it will charge after the free trial. */
2511
+ FIRST_PAYMENT = "FIRST_PAYMENT"
2512
+ }
2513
+ interface ListPublicPlansRequest {
2514
+ /**
2515
+ * Number of pricing plans to list.
2516
+ *
2517
+ * Default: `75`.
2518
+ */
2519
+ limit?: number | null;
2520
+ /**
2521
+ * Number of pricing plans to skip.
2522
+ *
2523
+ * Default: `0`.
2524
+ */
2525
+ offset?: number | null;
2526
+ /** IDs of public plans to list. If non-existent IDs are specified, they are ignored and don't cause errors. If no IDs are specified, all public are listed according to the [order](#arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
2527
+ planIds?: string[];
2528
+ }
2529
+ interface ListPublicPlansResponse {
2530
+ /** List of public pricing plans. */
2531
+ plans?: PublicPlan[];
2532
+ /** Details on the paged set of public pricing plans returned. */
2533
+ pagingMetadata?: PagingMetadataV2;
2534
+ }
2535
+ /** Public plan entity containing information about the pricing plan. Can be read by any site member or visitor. */
2536
+ interface PublicPlan {
2537
+ /** Plan ID. */
2538
+ _id?: string;
2539
+ /** Plan name. */
2540
+ name?: string | null;
2541
+ /** Plan description. */
2542
+ description?: string | null;
2543
+ /** What is included with this plan (e.g., 1 weekly entrance to a specific class). */
2544
+ perks?: StringList;
2545
+ /** Plan price, payment schedule, and expiration. */
2546
+ pricing?: Pricing;
2547
+ /** Whether the plan is marked as primary. */
2548
+ primary?: boolean;
2549
+ /** Date plan was created. */
2550
+ _createdDate?: Date;
2551
+ /** Date plan was last updated. */
2552
+ _updatedDate?: Date;
2553
+ /** URL-friendly version of plan name. Unique across all plans in the same site. */
2554
+ slug?: string | null;
2555
+ /** Number of times the same buyer can purchase the plan. An empty value or a value of zero means no limitation. */
2556
+ maxPurchasesPerBuyer?: number | null;
2557
+ /** Whether the buyer can start the plan at a later date. Defaults to false. */
2558
+ allowFutureStartDate?: boolean | null;
2559
+ /** Whether the buyer is allowed to cancel their plan. Defaults to false. */
2560
+ buyerCanCancel?: boolean | null;
2561
+ /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
2562
+ termsAndConditions?: string | null;
2563
+ /** ID of the form associated with the plan at checkout. */
2564
+ formId?: string | null;
2565
+ }
2566
+ interface PagingMetadataV2 {
2567
+ /** Number of items returned in the response. */
2568
+ count?: number | null;
2569
+ /** Offset that was requested. */
2570
+ offset?: number | null;
2571
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
2572
+ total?: number | null;
2573
+ /** Flag that indicates the server failed to calculate the `total` field. */
2574
+ tooManyToCount?: boolean | null;
2575
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
2576
+ cursors?: Cursors;
2577
+ }
2578
+ interface Cursors {
2579
+ /** Cursor string pointing to the next page in the list of results. */
2580
+ next?: string | null;
2581
+ /** Cursor pointing to the previous page in the list of results. */
2582
+ prev?: string | null;
2583
+ }
2584
+ interface QueryPublicPlansRequest {
2585
+ query?: QueryV2;
2586
+ }
2587
+ interface QueryV2 {
2588
+ /** A filter object. See [supported fields and operators](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/filter-and-sort#wix-pricing-plans_pricing-plans_plans_filter-and-sort_query-public-plans) */
2589
+ filter?: Record<string, any> | null;
2590
+ /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
2591
+ sort?: Sorting[];
2592
+ /** Pointer to page of results using offset. Can not be used together with 'cursorPaging' */
2593
+ paging?: Paging;
2594
+ }
2595
+ interface Sorting {
2596
+ /** Name of the field to sort by. */
2597
+ fieldName?: string;
2598
+ /** Sort order. */
2599
+ order?: SortOrder;
2600
+ }
2601
+ declare enum SortOrder {
2602
+ ASC = "ASC",
2603
+ DESC = "DESC"
2604
+ }
2605
+ interface Paging {
2606
+ /** Number of items to load. */
2607
+ limit?: number | null;
2608
+ /** Number of items to skip in the current sort order. */
2609
+ offset?: number | null;
2610
+ }
2611
+ interface QueryPublicPlansResponse {
2612
+ /** List of public pricing plans that match the specified query. */
2613
+ plans?: PublicPlan[];
2614
+ /** Object containing paging-related data (number of plans returned, offset). */
2615
+ pagingMetadata?: PagingMetadataV2;
2616
+ }
2617
+ interface GetPlanRequest {
2618
+ /** Plan ID. */
2619
+ _id: string;
2620
+ }
2621
+ interface GetPlanResponse {
2622
+ /** Pricing plan info. */
2623
+ plan?: Plan;
2624
+ }
2625
+ interface ListPlansRequest {
2626
+ /**
2627
+ * Archived filter.
2628
+ *
2629
+ * Default: `ACTIVE` (not archived).
2630
+ */
2631
+ archived?: ArchivedFilter;
2632
+ /**
2633
+ * Visibility filter.
2634
+ *
2635
+ * Default: `PUBLIC_AND_HIDDEN` (meaning, both public and hidden plans are listed).
2636
+ *
2637
+ */
2638
+ public?: PublicFilter;
2639
+ /**
2640
+ * Number of pricing plans to list.
2641
+ *
2642
+ * Default: `75`.
2643
+ */
2644
+ limit?: number | null;
2645
+ /**
2646
+ * Number of pricing plans to skip.
2647
+ *
2648
+ * Default: `0`.
2649
+ */
2650
+ offset?: number | null;
2651
+ /** IDs of plans to list. If non-existent IDs are specified, they are ignored and don't cause errors. If no IDs are specified, all public and hidden plans (based on `options`) are listed according to the [order](#arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
2652
+ planIds?: string[];
2653
+ }
2654
+ declare enum ArchivedFilter {
2655
+ /** Returns all plans that are active. */
2656
+ ACTIVE = "ACTIVE",
2657
+ /** Returns all plans that are archived. */
2658
+ ARCHIVED = "ARCHIVED",
2659
+ /** Returns all plans that are active and archived. */
2660
+ ARCHIVED_AND_ACTIVE = "ARCHIVED_AND_ACTIVE"
2661
+ }
2662
+ declare enum PublicFilter {
2663
+ /** Returns all public and hidden plans. */
2664
+ PUBLIC_AND_HIDDEN = "PUBLIC_AND_HIDDEN",
2665
+ /** Returns only public plans. */
2666
+ PUBLIC = "PUBLIC",
2667
+ /** Returns only hidden plans. */
2668
+ HIDDEN = "HIDDEN"
2669
+ }
2670
+ interface ListPlansResponse {
2671
+ /** List of all public and hidden pricing plans. */
2672
+ plans?: Plan[];
2673
+ /** Details on the paged set of pricing plans returned. */
2674
+ pagingMetadata?: PagingMetadataV2;
2675
+ }
2676
+ interface GetPlanStatsRequest {
2677
+ }
2678
+ interface GetPlanStatsResponse {
2679
+ /** Total number of plans created, including active plans (both public and hidden) and archived plans. */
2680
+ totalPlans?: number;
2681
+ }
2682
+ interface CreatePlanRequest {
2683
+ /** Information for the plan being created. */
2684
+ plan: Plan;
2685
+ }
2686
+ interface CreatePlanResponse {
2687
+ /** Plan info. */
2688
+ plan?: Plan;
2689
+ }
2690
+ interface UpdatePlanRequest {
2691
+ /** Plan info to update. */
2692
+ plan: Plan;
2693
+ }
2694
+ interface UpdatePlanResponse {
2695
+ /** Updated plan info. */
2696
+ plan?: Plan;
2697
+ }
2698
+ interface BuyerCanCancelUpdated {
2699
+ plan?: Plan;
2700
+ }
2701
+ interface SetPlanVisibilityRequest {
2702
+ /** The ID of the plan to either display or hide on the site page. */
2703
+ _id: string;
2704
+ /** Whether to set the plan as visible. */
2705
+ visible: boolean;
2706
+ }
2707
+ interface SetPlanVisibilityResponse {
2708
+ /** Plan info. */
2709
+ plan?: Plan;
2710
+ }
2711
+ interface MakePlanPrimaryRequest {
2712
+ /** ID of the pricing plan to set as the primary plan. */
2713
+ _id: string;
2714
+ }
2715
+ interface MakePlanPrimaryResponse {
2716
+ /** Primary plan info. */
2717
+ plan?: Plan;
2718
+ }
2719
+ interface ClearPrimaryRequest {
2720
+ }
2721
+ interface ClearPrimaryResponse {
2722
+ }
2723
+ interface ArchivePlanRequest {
2724
+ _id: string;
2725
+ }
2726
+ interface ArchivePlanResponse {
2727
+ /** Archived plan info. */
2728
+ plan?: Plan;
2729
+ }
2730
+ interface PlanArchived {
2731
+ plan?: Plan;
2732
+ }
2733
+ interface BulkArchivePlanRequest {
2734
+ /** List of Plan IDs. */
2735
+ ids?: string[];
2736
+ /** Set to true to return Plan entity in response. */
2737
+ returnFullEntity?: boolean;
2738
+ }
2739
+ interface BulkArchivePlanResponse {
2740
+ results?: BulkPlanResult[];
2741
+ bulkActionMetadata?: BulkActionMetadata;
2742
+ }
2743
+ interface BulkPlanResult {
2744
+ itemMetadata?: ItemMetadata;
2745
+ plan?: Plan;
2746
+ }
2747
+ interface ItemMetadata {
2748
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
2749
+ _id?: string | null;
2750
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
2751
+ originalIndex?: number;
2752
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2753
+ success?: boolean;
2754
+ /** Details about the error in case of failure. */
2755
+ error?: ApplicationError;
2756
+ }
2757
+ interface ApplicationError {
2758
+ /** Error code. */
2759
+ code?: string;
2760
+ /** Description of the error. */
2761
+ description?: string;
2762
+ /** Data related to the error. */
2763
+ data?: Record<string, any> | null;
2764
+ }
2765
+ interface BulkActionMetadata {
2766
+ /** Number of items that were successfully processed. */
2767
+ totalSuccesses?: number;
2768
+ /** Number of items that couldn't be processed. */
2769
+ totalFailures?: number;
2770
+ /** Number of failures without details because detailed failure threshold was exceeded. */
2771
+ undetailedFailures?: number;
2772
+ }
2773
+ interface ArrangePlansRequest {
2774
+ /** IDs of all non-archived plans in the order you want them arranged. */
2775
+ ids: string[];
2776
+ }
2777
+ interface ArrangePlansResponse {
2778
+ }
2779
+ interface DomainEvent extends DomainEventBodyOneOf {
2780
+ createdEvent?: EntityCreatedEvent;
2781
+ updatedEvent?: EntityUpdatedEvent;
2782
+ deletedEvent?: EntityDeletedEvent;
2783
+ actionEvent?: ActionEvent;
2784
+ /**
2785
+ * Unique event ID.
2786
+ * Allows clients to ignore duplicate webhooks.
2787
+ */
2788
+ _id?: string;
2789
+ /**
2790
+ * Assumes actions are also always typed to an entity_type
2791
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2792
+ */
2793
+ entityFqdn?: string;
2794
+ /**
2795
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2796
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2797
+ * Example: created/updated/deleted/started/completed/email_opened
2798
+ */
2799
+ slug?: string;
2800
+ /** ID of the entity associated with the event. */
2801
+ entityId?: string;
2802
+ /** Event timestamp. */
2803
+ eventTime?: Date;
2804
+ /**
2805
+ * Whether the event was triggered as a result of a privacy regulation application
2806
+ * (for example, GDPR).
2807
+ */
2808
+ triggeredByAnonymizeRequest?: boolean | null;
2809
+ /** If present, indicates the action that triggered the event. */
2810
+ originatedFrom?: string | null;
2811
+ /**
2812
+ * A sequence number defining the order of updates to the underlying entity.
2813
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2814
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2815
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2816
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2817
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2818
+ */
2819
+ entityEventSequence?: string | null;
2820
+ }
2821
+ /** @oneof */
2822
+ interface DomainEventBodyOneOf {
2823
+ createdEvent?: EntityCreatedEvent;
2824
+ updatedEvent?: EntityUpdatedEvent;
2825
+ deletedEvent?: EntityDeletedEvent;
2826
+ actionEvent?: ActionEvent;
2827
+ }
2828
+ interface EntityCreatedEvent {
2829
+ entity?: string;
2830
+ }
2831
+ interface EntityUpdatedEvent {
2832
+ /**
2833
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2834
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2835
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2836
+ */
2837
+ currentEntity?: string;
2838
+ }
2839
+ interface EntityDeletedEvent {
2840
+ /** Entity that was deleted */
2841
+ deletedEntity?: string | null;
2842
+ }
2843
+ interface ActionEvent {
2844
+ body?: string;
2845
+ }
2846
+ interface MessageEnvelope {
2847
+ /** App instance ID. */
2848
+ instanceId?: string | null;
2849
+ /** Event type. */
2850
+ eventType?: string;
2851
+ /** The identification type and identity data. */
2852
+ identity?: IdentificationData;
2853
+ /** Stringify payload. */
2854
+ data?: string;
2855
+ }
2856
+ interface IdentificationData extends IdentificationDataIdOneOf {
2857
+ /** ID of a site visitor that has not logged in to the site. */
2858
+ anonymousVisitorId?: string;
2859
+ /** ID of a site visitor that has logged in to the site. */
2860
+ memberId?: string;
2861
+ /** ID of a Wix user (site owner, contributor, etc.). */
2862
+ wixUserId?: string;
2863
+ /** ID of an app. */
2864
+ appId?: string;
2865
+ /** @readonly */
2866
+ identityType?: WebhookIdentityType;
2867
+ }
2868
+ /** @oneof */
2869
+ interface IdentificationDataIdOneOf {
2870
+ /** ID of a site visitor that has not logged in to the site. */
2871
+ anonymousVisitorId?: string;
2872
+ /** ID of a site visitor that has logged in to the site. */
2873
+ memberId?: string;
2874
+ /** ID of a Wix user (site owner, contributor, etc.). */
2875
+ wixUserId?: string;
2876
+ /** ID of an app. */
2877
+ appId?: string;
2878
+ }
2879
+ declare enum WebhookIdentityType {
2880
+ UNKNOWN = "UNKNOWN",
2881
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2882
+ MEMBER = "MEMBER",
2883
+ WIX_USER = "WIX_USER",
2884
+ APP = "APP"
2885
+ }
2886
+ interface ListPublicPlansResponseNonNullableFields {
2887
+ plans: {
2888
+ _id: string;
2889
+ perks?: {
2890
+ values: string[];
2891
+ };
2892
+ pricing?: {
2893
+ subscription?: {
2894
+ cycleDuration?: {
2895
+ unit: PeriodUnit;
2896
+ };
2897
+ };
2898
+ singlePaymentForDuration?: {
2899
+ unit: PeriodUnit;
2900
+ };
2901
+ price?: {
2902
+ value: string;
2903
+ currency: string;
2904
+ };
2905
+ };
2906
+ primary: boolean;
2907
+ }[];
2908
+ }
2909
+ interface QueryPublicPlansResponseNonNullableFields {
2910
+ plans: {
2911
+ _id: string;
2912
+ perks?: {
2913
+ values: string[];
2914
+ };
2915
+ pricing?: {
2916
+ subscription?: {
2917
+ cycleDuration?: {
2918
+ unit: PeriodUnit;
2919
+ };
2920
+ };
2921
+ singlePaymentForDuration?: {
2922
+ unit: PeriodUnit;
2923
+ };
2924
+ price?: {
2925
+ value: string;
2926
+ currency: string;
2927
+ };
2928
+ };
2929
+ primary: boolean;
2930
+ }[];
2931
+ }
2932
+ interface GetPlanResponseNonNullableFields {
2933
+ plan?: {
2934
+ _id: string;
2935
+ perks?: {
2936
+ values: string[];
2937
+ };
2938
+ pricing?: {
2939
+ subscription?: {
2940
+ cycleDuration?: {
2941
+ unit: PeriodUnit;
2942
+ };
2943
+ };
2944
+ singlePaymentForDuration?: {
2945
+ unit: PeriodUnit;
2946
+ };
2947
+ price?: {
2948
+ value: string;
2949
+ currency: string;
2950
+ };
2951
+ };
2952
+ archived: boolean;
2953
+ primary: boolean;
2954
+ hasOrders: boolean;
2955
+ };
2956
+ }
2957
+ interface ListPlansResponseNonNullableFields {
2958
+ plans: {
2959
+ _id: string;
2960
+ perks?: {
2961
+ values: string[];
2962
+ };
2963
+ pricing?: {
2964
+ subscription?: {
2965
+ cycleDuration?: {
2966
+ unit: PeriodUnit;
2967
+ };
2968
+ };
2969
+ singlePaymentForDuration?: {
2970
+ unit: PeriodUnit;
2971
+ };
2972
+ price?: {
2973
+ value: string;
2974
+ currency: string;
2975
+ };
2976
+ };
2977
+ archived: boolean;
2978
+ primary: boolean;
2979
+ hasOrders: boolean;
2980
+ }[];
2981
+ }
2982
+ interface GetPlanStatsResponseNonNullableFields {
2983
+ totalPlans: number;
2984
+ }
2985
+ interface CreatePlanResponseNonNullableFields {
2986
+ plan?: {
2987
+ _id: string;
2988
+ perks?: {
2989
+ values: string[];
2990
+ };
2991
+ pricing?: {
2992
+ subscription?: {
2993
+ cycleDuration?: {
2994
+ unit: PeriodUnit;
2995
+ };
2996
+ };
2997
+ singlePaymentForDuration?: {
2998
+ unit: PeriodUnit;
2999
+ };
3000
+ price?: {
3001
+ value: string;
3002
+ currency: string;
3003
+ };
3004
+ };
3005
+ archived: boolean;
3006
+ primary: boolean;
3007
+ hasOrders: boolean;
3008
+ };
3009
+ }
3010
+ interface UpdatePlanResponseNonNullableFields {
3011
+ plan?: {
3012
+ _id: string;
3013
+ perks?: {
3014
+ values: string[];
3015
+ };
3016
+ pricing?: {
3017
+ subscription?: {
3018
+ cycleDuration?: {
3019
+ unit: PeriodUnit;
3020
+ };
3021
+ };
3022
+ singlePaymentForDuration?: {
3023
+ unit: PeriodUnit;
3024
+ };
3025
+ price?: {
3026
+ value: string;
3027
+ currency: string;
3028
+ };
3029
+ };
3030
+ archived: boolean;
3031
+ primary: boolean;
3032
+ hasOrders: boolean;
3033
+ };
3034
+ }
3035
+ interface SetPlanVisibilityResponseNonNullableFields {
3036
+ plan?: {
3037
+ _id: string;
3038
+ perks?: {
3039
+ values: string[];
3040
+ };
3041
+ pricing?: {
3042
+ subscription?: {
3043
+ cycleDuration?: {
3044
+ unit: PeriodUnit;
3045
+ };
3046
+ };
3047
+ singlePaymentForDuration?: {
3048
+ unit: PeriodUnit;
3049
+ };
3050
+ price?: {
3051
+ value: string;
3052
+ currency: string;
3053
+ };
3054
+ };
3055
+ archived: boolean;
3056
+ primary: boolean;
3057
+ hasOrders: boolean;
3058
+ };
3059
+ }
3060
+ interface MakePlanPrimaryResponseNonNullableFields {
3061
+ plan?: {
3062
+ _id: string;
3063
+ perks?: {
3064
+ values: string[];
3065
+ };
3066
+ pricing?: {
3067
+ subscription?: {
3068
+ cycleDuration?: {
3069
+ unit: PeriodUnit;
3070
+ };
3071
+ };
3072
+ singlePaymentForDuration?: {
3073
+ unit: PeriodUnit;
3074
+ };
3075
+ price?: {
3076
+ value: string;
3077
+ currency: string;
3078
+ };
3079
+ };
3080
+ archived: boolean;
3081
+ primary: boolean;
3082
+ hasOrders: boolean;
3083
+ };
3084
+ }
3085
+ interface ArchivePlanResponseNonNullableFields {
3086
+ plan?: {
3087
+ _id: string;
3088
+ perks?: {
3089
+ values: string[];
3090
+ };
3091
+ pricing?: {
3092
+ subscription?: {
3093
+ cycleDuration?: {
3094
+ unit: PeriodUnit;
3095
+ };
3096
+ };
3097
+ singlePaymentForDuration?: {
3098
+ unit: PeriodUnit;
3099
+ };
3100
+ price?: {
3101
+ value: string;
3102
+ currency: string;
3103
+ };
3104
+ };
3105
+ archived: boolean;
3106
+ primary: boolean;
3107
+ hasOrders: boolean;
3108
+ };
3109
+ }
3110
+ interface BaseEventMetadata {
3111
+ /** App instance ID. */
3112
+ instanceId?: string | null;
3113
+ /** Event type. */
3114
+ eventType?: string;
3115
+ /** The identification type and identity data. */
3116
+ identity?: IdentificationData;
3117
+ }
3118
+ interface EventMetadata extends BaseEventMetadata {
3119
+ /**
3120
+ * Unique event ID.
3121
+ * Allows clients to ignore duplicate webhooks.
3122
+ */
3123
+ _id?: string;
3124
+ /**
3125
+ * Assumes actions are also always typed to an entity_type
3126
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3127
+ */
3128
+ entityFqdn?: string;
3129
+ /**
3130
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3131
+ * This is although the created/updated/deleted notion is duplication of the oneof types
3132
+ * Example: created/updated/deleted/started/completed/email_opened
3133
+ */
3134
+ slug?: string;
3135
+ /** ID of the entity associated with the event. */
3136
+ entityId?: string;
3137
+ /** Event timestamp. */
3138
+ eventTime?: Date;
3139
+ /**
3140
+ * Whether the event was triggered as a result of a privacy regulation application
3141
+ * (for example, GDPR).
3142
+ */
3143
+ triggeredByAnonymizeRequest?: boolean | null;
3144
+ /** If present, indicates the action that triggered the event. */
3145
+ originatedFrom?: string | null;
3146
+ /**
3147
+ * A sequence number defining the order of updates to the underlying entity.
3148
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
3149
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3150
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3151
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
3152
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3153
+ */
3154
+ entityEventSequence?: string | null;
3155
+ }
3156
+ interface PlanUpdatedEnvelope {
3157
+ entity: Plan;
3158
+ metadata: EventMetadata;
3159
+ }
3160
+ interface PlanCreatedEnvelope {
3161
+ entity: Plan;
3162
+ metadata: EventMetadata;
3163
+ }
3164
+ interface PlanBuyerCanCancelUpdatedEnvelope {
3165
+ data: BuyerCanCancelUpdated;
3166
+ metadata: EventMetadata;
3167
+ }
3168
+ interface PlanArchivedEnvelope {
3169
+ data: PlanArchived;
3170
+ metadata: EventMetadata;
3171
+ }
3172
+ interface ListPublicPlansOptions {
3173
+ /**
3174
+ * Number of pricing plans to list.
3175
+ *
3176
+ * Default: `75`.
3177
+ */
3178
+ limit?: number | null;
3179
+ /**
3180
+ * Number of pricing plans to skip.
3181
+ *
3182
+ * Default: `0`.
3183
+ */
3184
+ offset?: number | null;
3185
+ /** IDs of public plans to list. If non-existent IDs are specified, they are ignored and don't cause errors. If no IDs are specified, all public are listed according to the [order](#arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
3186
+ planIds?: string[];
3187
+ }
3188
+ interface QueryOffsetResult {
3189
+ currentPage: number | undefined;
3190
+ totalPages: number | undefined;
3191
+ totalCount: number | undefined;
3192
+ hasNext: () => boolean;
3193
+ hasPrev: () => boolean;
3194
+ length: number;
3195
+ pageSize: number;
3196
+ }
3197
+ interface PlansQueryResult extends QueryOffsetResult {
3198
+ items: PublicPlan[];
3199
+ query: PlansQueryBuilder;
3200
+ next: () => Promise<PlansQueryResult>;
3201
+ prev: () => Promise<PlansQueryResult>;
3202
+ }
3203
+ interface PlansQueryBuilder {
3204
+ /** @param propertyName - Property whose value is compared with `value`.
3205
+ * @param value - Value to compare against.
3206
+ */
3207
+ eq: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
3208
+ /** @param propertyName - Property whose value is compared with `value`.
3209
+ * @param value - Value to compare against.
3210
+ */
3211
+ ne: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
3212
+ /** @param propertyName - Property whose value is compared with `value`.
3213
+ * @param value - Value to compare against.
3214
+ */
3215
+ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
3216
+ /** @param propertyName - Property whose value is compared with `value`.
3217
+ * @param value - Value to compare against.
3218
+ */
3219
+ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
3220
+ /** @param propertyName - Property whose value is compared with `value`.
3221
+ * @param value - Value to compare against.
3222
+ */
3223
+ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
3224
+ /** @param propertyName - Property whose value is compared with `value`.
3225
+ * @param value - Value to compare against.
3226
+ */
3227
+ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
3228
+ /** @param propertyName - Property whose value is compared with `string`.
3229
+ * @param string - String to compare against. Case-insensitive.
3230
+ */
3231
+ startsWith: (propertyName: '_id' | 'slug', value: string) => PlansQueryBuilder;
3232
+ /** @param propertyName - Property whose value is compared with `values`.
3233
+ * @param values - List of values to compare against.
3234
+ */
3235
+ hasSome: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any[]) => PlansQueryBuilder;
3236
+ in: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
3237
+ exists: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: boolean) => PlansQueryBuilder;
3238
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
3239
+ ascending: (...propertyNames: Array<'_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug'>) => PlansQueryBuilder;
3240
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
3241
+ descending: (...propertyNames: Array<'_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug'>) => PlansQueryBuilder;
3242
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
3243
+ limit: (limit: number) => PlansQueryBuilder;
3244
+ /** @param skip - Number of items to skip in the query results before returning the results. */
3245
+ skip: (skip: number) => PlansQueryBuilder;
3246
+ find: () => Promise<PlansQueryResult>;
3247
+ }
3248
+ interface ListPlansOptions {
3249
+ /**
3250
+ * Archived filter.
3251
+ *
3252
+ * Default: `ACTIVE` (not archived).
3253
+ */
3254
+ archived?: ArchivedFilter;
3255
+ /**
3256
+ * Visibility filter.
3257
+ *
3258
+ * Default: `PUBLIC_AND_HIDDEN` (meaning, both public and hidden plans are listed).
3259
+ *
3260
+ */
3261
+ public?: PublicFilter;
3262
+ /**
3263
+ * Number of pricing plans to list.
3264
+ *
3265
+ * Default: `75`.
3266
+ */
3267
+ limit?: number | null;
3268
+ /**
3269
+ * Number of pricing plans to skip.
3270
+ *
3271
+ * Default: `0`.
3272
+ */
3273
+ offset?: number | null;
3274
+ /** IDs of plans to list. If non-existent IDs are specified, they are ignored and don't cause errors. If no IDs are specified, all public and hidden plans (based on `options`) are listed according to the [order](#arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
3275
+ planIds?: string[];
3276
+ }
3277
+ interface UpdatePlan {
3278
+ /**
3279
+ * Plan ID.
3280
+ * @readonly
3281
+ */
3282
+ _id?: string;
3283
+ /** Plan name. */
3284
+ name?: string | null;
3285
+ /** Plan description. */
3286
+ description?: string | null;
3287
+ /**
3288
+ * List of text strings that promote what is included with this plan.
3289
+ *
3290
+ * For example, "Plenty of parking" or "Free gift on your birthday".
3291
+ */
3292
+ perks?: StringList;
3293
+ /** Plan price, payment schedule, and expiration. */
3294
+ pricing?: Pricing;
3295
+ /** Whether the plan is public (visible to site visitors and members). */
3296
+ public?: boolean | null;
3297
+ /**
3298
+ * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
3299
+ * @readonly
3300
+ */
3301
+ archived?: boolean;
3302
+ /**
3303
+ * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
3304
+ *
3305
+ * Default: `false`.
3306
+ * @readonly
3307
+ */
3308
+ primary?: boolean;
3309
+ /**
3310
+ * Whether the plan has any orders (including pending and unpaid orders).
3311
+ * @readonly
3312
+ */
3313
+ hasOrders?: boolean;
3314
+ /**
3315
+ * Date plan was created.
3316
+ * @readonly
3317
+ */
3318
+ _createdDate?: Date;
3319
+ /**
3320
+ * Date plan was last updated.
3321
+ * @readonly
3322
+ */
3323
+ _updatedDate?: Date;
3324
+ /**
3325
+ * URL-friendly version of plan name. Unique across all plans in the same site.
3326
+ * @readonly
3327
+ */
3328
+ slug?: string | null;
3329
+ /**
3330
+ * Number of times the same buyer can purchase the plan. Currently limited to support:
3331
+ * - Empty value or a value of `0`, meaning no limitation.
3332
+ * - Value of `1`, meaning limited to one purchase per buyer.
3333
+ */
3334
+ maxPurchasesPerBuyer?: number | null;
3335
+ /**
3336
+ * Whether the buyer can start the plan at a later date.
3337
+ *
3338
+ * Default: `false`.
3339
+ *
3340
+ */
3341
+ allowFutureStartDate?: boolean | null;
3342
+ /**
3343
+ * Whether the buyer is allowed to cancel their plan. If `false`, calling the [`requestCancellation()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/requestcancellation) function returns an error.
3344
+ *
3345
+ * Default: `true`.
3346
+ *
3347
+ */
3348
+ buyerCanCancel?: boolean | null;
3349
+ /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
3350
+ termsAndConditions?: string | null;
3351
+ /** ID of the form associated with the plan at checkout. */
3352
+ formId?: string | null;
3353
+ }
3354
+
3355
+ declare const __metadata: {
3356
+ PACKAGE_NAME: string;
3357
+ };
3358
+ declare function listPublicPlans(httpClient: HttpClient): (options?: ListPublicPlansOptions) => Promise<ListPublicPlansResponse & ListPublicPlansResponseNonNullableFields>;
3359
+ declare function queryPublicPlans(httpClient: HttpClient): () => PlansQueryBuilder;
3360
+ declare function getPlan(httpClient: HttpClient): (_id: string) => Promise<Plan & {
3361
+ _id: string;
3362
+ perks?: {
3363
+ values: string[];
3364
+ } | undefined;
3365
+ pricing?: {
3366
+ subscription?: {
3367
+ cycleDuration?: {
3368
+ unit: PeriodUnit;
3369
+ } | undefined;
3370
+ } | undefined;
3371
+ singlePaymentForDuration?: {
3372
+ unit: PeriodUnit;
3373
+ } | undefined;
3374
+ price?: {
3375
+ value: string;
3376
+ currency: string;
3377
+ } | undefined;
3378
+ } | undefined;
3379
+ archived: boolean;
3380
+ primary: boolean;
3381
+ hasOrders: boolean;
3382
+ }>;
3383
+ declare function listPlans(httpClient: HttpClient): (options?: ListPlansOptions) => Promise<ListPlansResponse & ListPlansResponseNonNullableFields>;
3384
+ declare function getPlanStats(httpClient: HttpClient): () => Promise<GetPlanStatsResponse & GetPlanStatsResponseNonNullableFields>;
3385
+ declare function createPlan(httpClient: HttpClient): (plan: Plan) => Promise<Plan & {
3386
+ _id: string;
3387
+ perks?: {
3388
+ values: string[];
3389
+ } | undefined;
3390
+ pricing?: {
3391
+ subscription?: {
3392
+ cycleDuration?: {
3393
+ unit: PeriodUnit;
3394
+ } | undefined;
3395
+ } | undefined;
3396
+ singlePaymentForDuration?: {
3397
+ unit: PeriodUnit;
3398
+ } | undefined;
3399
+ price?: {
3400
+ value: string;
3401
+ currency: string;
3402
+ } | undefined;
3403
+ } | undefined;
3404
+ archived: boolean;
3405
+ primary: boolean;
3406
+ hasOrders: boolean;
3407
+ }>;
3408
+ declare function updatePlan(httpClient: HttpClient): (_id: string, plan: UpdatePlan) => Promise<Plan & {
3409
+ _id: string;
3410
+ perks?: {
3411
+ values: string[];
3412
+ } | undefined;
3413
+ pricing?: {
3414
+ subscription?: {
3415
+ cycleDuration?: {
3416
+ unit: PeriodUnit;
3417
+ } | undefined;
3418
+ } | undefined;
3419
+ singlePaymentForDuration?: {
3420
+ unit: PeriodUnit;
3421
+ } | undefined;
3422
+ price?: {
3423
+ value: string;
3424
+ currency: string;
3425
+ } | undefined;
3426
+ } | undefined;
3427
+ archived: boolean;
3428
+ primary: boolean;
3429
+ hasOrders: boolean;
3430
+ }>;
3431
+ declare function setPlanVisibility(httpClient: HttpClient): (_id: string, visible: boolean) => Promise<SetPlanVisibilityResponse & SetPlanVisibilityResponseNonNullableFields>;
3432
+ declare function makePlanPrimary(httpClient: HttpClient): (_id: string) => Promise<MakePlanPrimaryResponse & MakePlanPrimaryResponseNonNullableFields>;
3433
+ declare function clearPrimary(httpClient: HttpClient): () => Promise<void>;
3434
+ declare function archivePlan(httpClient: HttpClient): (_id: string) => Promise<ArchivePlanResponse & ArchivePlanResponseNonNullableFields>;
3435
+ declare function arrangePlans(httpClient: HttpClient): (ids: string[]) => Promise<void>;
3436
+ declare const onPlanUpdated: EventDefinition<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
3437
+ declare const onPlanCreated: EventDefinition<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
3438
+ declare const onPlanBuyerCanCancelUpdated: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
3439
+ declare const onPlanArchived: EventDefinition<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
3440
+
3441
+ type index_d_ActionEvent = ActionEvent;
3442
+ type index_d_ApplicationError = ApplicationError;
3443
+ type index_d_AppliedAt = AppliedAt;
3444
+ declare const index_d_AppliedAt: typeof AppliedAt;
3445
+ type index_d_ArchivePlanRequest = ArchivePlanRequest;
3446
+ type index_d_ArchivePlanResponse = ArchivePlanResponse;
3447
+ type index_d_ArchivePlanResponseNonNullableFields = ArchivePlanResponseNonNullableFields;
3448
+ type index_d_ArchivedFilter = ArchivedFilter;
3449
+ declare const index_d_ArchivedFilter: typeof ArchivedFilter;
3450
+ type index_d_ArrangePlansRequest = ArrangePlansRequest;
3451
+ type index_d_ArrangePlansResponse = ArrangePlansResponse;
3452
+ type index_d_BaseEventMetadata = BaseEventMetadata;
3453
+ type index_d_BulkActionMetadata = BulkActionMetadata;
3454
+ type index_d_BulkArchivePlanRequest = BulkArchivePlanRequest;
3455
+ type index_d_BulkArchivePlanResponse = BulkArchivePlanResponse;
3456
+ type index_d_BulkPlanResult = BulkPlanResult;
3457
+ type index_d_BuyerCanCancelUpdated = BuyerCanCancelUpdated;
3458
+ type index_d_ClearPrimaryRequest = ClearPrimaryRequest;
3459
+ type index_d_ClearPrimaryResponse = ClearPrimaryResponse;
3460
+ type index_d_CreatePlanRequest = CreatePlanRequest;
3461
+ type index_d_CreatePlanResponse = CreatePlanResponse;
3462
+ type index_d_CreatePlanResponseNonNullableFields = CreatePlanResponseNonNullableFields;
3463
+ type index_d_Cursors = Cursors;
3464
+ type index_d_DomainEvent = DomainEvent;
3465
+ type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
3466
+ type index_d_Duration = Duration;
3467
+ type index_d_EntityCreatedEvent = EntityCreatedEvent;
3468
+ type index_d_EntityDeletedEvent = EntityDeletedEvent;
3469
+ type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
3470
+ type index_d_EventMetadata = EventMetadata;
3471
+ type index_d_Fee = Fee;
3472
+ type index_d_FeeConfig = FeeConfig;
3473
+ type index_d_GetPlanRequest = GetPlanRequest;
3474
+ type index_d_GetPlanResponse = GetPlanResponse;
3475
+ type index_d_GetPlanResponseNonNullableFields = GetPlanResponseNonNullableFields;
3476
+ type index_d_GetPlanStatsRequest = GetPlanStatsRequest;
3477
+ type index_d_GetPlanStatsResponse = GetPlanStatsResponse;
3478
+ type index_d_GetPlanStatsResponseNonNullableFields = GetPlanStatsResponseNonNullableFields;
3479
+ type index_d_IdentificationData = IdentificationData;
3480
+ type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
3481
+ type index_d_ItemMetadata = ItemMetadata;
3482
+ type index_d_ListPlansOptions = ListPlansOptions;
3483
+ type index_d_ListPlansRequest = ListPlansRequest;
3484
+ type index_d_ListPlansResponse = ListPlansResponse;
3485
+ type index_d_ListPlansResponseNonNullableFields = ListPlansResponseNonNullableFields;
3486
+ type index_d_ListPublicPlansOptions = ListPublicPlansOptions;
3487
+ type index_d_ListPublicPlansRequest = ListPublicPlansRequest;
3488
+ type index_d_ListPublicPlansResponse = ListPublicPlansResponse;
3489
+ type index_d_ListPublicPlansResponseNonNullableFields = ListPublicPlansResponseNonNullableFields;
3490
+ type index_d_MakePlanPrimaryRequest = MakePlanPrimaryRequest;
3491
+ type index_d_MakePlanPrimaryResponse = MakePlanPrimaryResponse;
3492
+ type index_d_MakePlanPrimaryResponseNonNullableFields = MakePlanPrimaryResponseNonNullableFields;
3493
+ type index_d_MessageEnvelope = MessageEnvelope;
3494
+ type index_d_Money = Money;
3495
+ type index_d_Paging = Paging;
3496
+ type index_d_PagingMetadataV2 = PagingMetadataV2;
3497
+ type index_d_PeriodUnit = PeriodUnit;
3498
+ declare const index_d_PeriodUnit: typeof PeriodUnit;
3499
+ type index_d_Plan = Plan;
3500
+ type index_d_PlanArchived = PlanArchived;
3501
+ type index_d_PlanArchivedEnvelope = PlanArchivedEnvelope;
3502
+ type index_d_PlanBuyerCanCancelUpdatedEnvelope = PlanBuyerCanCancelUpdatedEnvelope;
3503
+ type index_d_PlanCreatedEnvelope = PlanCreatedEnvelope;
3504
+ type index_d_PlanUpdatedEnvelope = PlanUpdatedEnvelope;
3505
+ type index_d_PlansQueryBuilder = PlansQueryBuilder;
3506
+ type index_d_PlansQueryResult = PlansQueryResult;
3507
+ type index_d_Pricing = Pricing;
3508
+ type index_d_PricingPricingModelOneOf = PricingPricingModelOneOf;
3509
+ type index_d_PublicFilter = PublicFilter;
3510
+ declare const index_d_PublicFilter: typeof PublicFilter;
3511
+ type index_d_PublicPlan = PublicPlan;
3512
+ type index_d_QueryPublicPlansRequest = QueryPublicPlansRequest;
3513
+ type index_d_QueryPublicPlansResponse = QueryPublicPlansResponse;
3514
+ type index_d_QueryPublicPlansResponseNonNullableFields = QueryPublicPlansResponseNonNullableFields;
3515
+ type index_d_QueryV2 = QueryV2;
3516
+ type index_d_Recurrence = Recurrence;
3517
+ type index_d_SetPlanVisibilityRequest = SetPlanVisibilityRequest;
3518
+ type index_d_SetPlanVisibilityResponse = SetPlanVisibilityResponse;
3519
+ type index_d_SetPlanVisibilityResponseNonNullableFields = SetPlanVisibilityResponseNonNullableFields;
3520
+ type index_d_SortOrder = SortOrder;
3521
+ declare const index_d_SortOrder: typeof SortOrder;
3522
+ type index_d_Sorting = Sorting;
3523
+ type index_d_StringList = StringList;
3524
+ type index_d_UpdatePlan = UpdatePlan;
3525
+ type index_d_UpdatePlanRequest = UpdatePlanRequest;
3526
+ type index_d_UpdatePlanResponse = UpdatePlanResponse;
3527
+ type index_d_UpdatePlanResponseNonNullableFields = UpdatePlanResponseNonNullableFields;
3528
+ type index_d_WebhookIdentityType = WebhookIdentityType;
3529
+ declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
3530
+ declare const index_d___metadata: typeof __metadata;
3531
+ declare const index_d_archivePlan: typeof archivePlan;
3532
+ declare const index_d_arrangePlans: typeof arrangePlans;
3533
+ declare const index_d_clearPrimary: typeof clearPrimary;
3534
+ declare const index_d_createPlan: typeof createPlan;
3535
+ declare const index_d_getPlan: typeof getPlan;
3536
+ declare const index_d_getPlanStats: typeof getPlanStats;
3537
+ declare const index_d_listPlans: typeof listPlans;
3538
+ declare const index_d_listPublicPlans: typeof listPublicPlans;
3539
+ declare const index_d_makePlanPrimary: typeof makePlanPrimary;
3540
+ declare const index_d_onPlanArchived: typeof onPlanArchived;
3541
+ declare const index_d_onPlanBuyerCanCancelUpdated: typeof onPlanBuyerCanCancelUpdated;
3542
+ declare const index_d_onPlanCreated: typeof onPlanCreated;
3543
+ declare const index_d_onPlanUpdated: typeof onPlanUpdated;
3544
+ declare const index_d_queryPublicPlans: typeof queryPublicPlans;
3545
+ declare const index_d_setPlanVisibility: typeof setPlanVisibility;
3546
+ declare const index_d_updatePlan: typeof updatePlan;
3547
+ declare namespace index_d {
3548
+ export { type index_d_ActionEvent as ActionEvent, type index_d_ApplicationError as ApplicationError, index_d_AppliedAt as AppliedAt, type index_d_ArchivePlanRequest as ArchivePlanRequest, type index_d_ArchivePlanResponse as ArchivePlanResponse, type index_d_ArchivePlanResponseNonNullableFields as ArchivePlanResponseNonNullableFields, index_d_ArchivedFilter as ArchivedFilter, type index_d_ArrangePlansRequest as ArrangePlansRequest, type index_d_ArrangePlansResponse as ArrangePlansResponse, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_BulkActionMetadata as BulkActionMetadata, type index_d_BulkArchivePlanRequest as BulkArchivePlanRequest, type index_d_BulkArchivePlanResponse as BulkArchivePlanResponse, type index_d_BulkPlanResult as BulkPlanResult, type index_d_BuyerCanCancelUpdated as BuyerCanCancelUpdated, type index_d_ClearPrimaryRequest as ClearPrimaryRequest, type index_d_ClearPrimaryResponse as ClearPrimaryResponse, type index_d_CreatePlanRequest as CreatePlanRequest, type index_d_CreatePlanResponse as CreatePlanResponse, type index_d_CreatePlanResponseNonNullableFields as CreatePlanResponseNonNullableFields, type index_d_Cursors as Cursors, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_Duration as Duration, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_Fee as Fee, type index_d_FeeConfig as FeeConfig, type index_d_GetPlanRequest as GetPlanRequest, type index_d_GetPlanResponse as GetPlanResponse, type index_d_GetPlanResponseNonNullableFields as GetPlanResponseNonNullableFields, type index_d_GetPlanStatsRequest as GetPlanStatsRequest, type index_d_GetPlanStatsResponse as GetPlanStatsResponse, type index_d_GetPlanStatsResponseNonNullableFields as GetPlanStatsResponseNonNullableFields, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_ItemMetadata as ItemMetadata, type index_d_ListPlansOptions as ListPlansOptions, type index_d_ListPlansRequest as ListPlansRequest, type index_d_ListPlansResponse as ListPlansResponse, type index_d_ListPlansResponseNonNullableFields as ListPlansResponseNonNullableFields, type index_d_ListPublicPlansOptions as ListPublicPlansOptions, type index_d_ListPublicPlansRequest as ListPublicPlansRequest, type index_d_ListPublicPlansResponse as ListPublicPlansResponse, type index_d_ListPublicPlansResponseNonNullableFields as ListPublicPlansResponseNonNullableFields, type index_d_MakePlanPrimaryRequest as MakePlanPrimaryRequest, type index_d_MakePlanPrimaryResponse as MakePlanPrimaryResponse, type index_d_MakePlanPrimaryResponseNonNullableFields as MakePlanPrimaryResponseNonNullableFields, type index_d_MessageEnvelope as MessageEnvelope, type index_d_Money as Money, type index_d_Paging as Paging, type index_d_PagingMetadataV2 as PagingMetadataV2, index_d_PeriodUnit as PeriodUnit, type index_d_Plan as Plan, type index_d_PlanArchived as PlanArchived, type index_d_PlanArchivedEnvelope as PlanArchivedEnvelope, type index_d_PlanBuyerCanCancelUpdatedEnvelope as PlanBuyerCanCancelUpdatedEnvelope, type index_d_PlanCreatedEnvelope as PlanCreatedEnvelope, type index_d_PlanUpdatedEnvelope as PlanUpdatedEnvelope, type index_d_PlansQueryBuilder as PlansQueryBuilder, type index_d_PlansQueryResult as PlansQueryResult, type index_d_Pricing as Pricing, type index_d_PricingPricingModelOneOf as PricingPricingModelOneOf, index_d_PublicFilter as PublicFilter, type index_d_PublicPlan as PublicPlan, type index_d_QueryPublicPlansRequest as QueryPublicPlansRequest, type index_d_QueryPublicPlansResponse as QueryPublicPlansResponse, type index_d_QueryPublicPlansResponseNonNullableFields as QueryPublicPlansResponseNonNullableFields, type index_d_QueryV2 as QueryV2, type index_d_Recurrence as Recurrence, type index_d_SetPlanVisibilityRequest as SetPlanVisibilityRequest, type index_d_SetPlanVisibilityResponse as SetPlanVisibilityResponse, type index_d_SetPlanVisibilityResponseNonNullableFields as SetPlanVisibilityResponseNonNullableFields, index_d_SortOrder as SortOrder, type index_d_Sorting as Sorting, type index_d_StringList as StringList, type index_d_UpdatePlan as UpdatePlan, type index_d_UpdatePlanRequest as UpdatePlanRequest, type index_d_UpdatePlanResponse as UpdatePlanResponse, type index_d_UpdatePlanResponseNonNullableFields as UpdatePlanResponseNonNullableFields, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_archivePlan as archivePlan, index_d_arrangePlans as arrangePlans, index_d_clearPrimary as clearPrimary, index_d_createPlan as createPlan, index_d_getPlan as getPlan, index_d_getPlanStats as getPlanStats, index_d_listPlans as listPlans, index_d_listPublicPlans as listPublicPlans, index_d_makePlanPrimary as makePlanPrimary, index_d_onPlanArchived as onPlanArchived, index_d_onPlanBuyerCanCancelUpdated as onPlanBuyerCanCancelUpdated, index_d_onPlanCreated as onPlanCreated, index_d_onPlanUpdated as onPlanUpdated, index_d_queryPublicPlans as queryPublicPlans, index_d_setPlanVisibility as setPlanVisibility, index_d_updatePlan as updatePlan };
3549
+ }
3550
+
3551
+ export { index_d$1 as orders, index_d as plans };