@wix/pricing-plans 1.0.4 → 1.0.6

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.
@@ -15,7 +15,11 @@ export interface Plan {
15
15
  name?: string | null;
16
16
  /** Plan description. */
17
17
  description?: string | null;
18
- /** What is included with this plan (e.g., 1 weekly entrance to a specific class). */
18
+ /**
19
+ * List of text strings that promote what is included with this plan.
20
+ *
21
+ * For example, "Plenty of parking" or "Free gift on your birthday".
22
+ */
19
23
  perks?: StringList;
20
24
  /** Plan price, payment schedule, and expiration. */
21
25
  pricing?: Pricing;
@@ -27,7 +31,9 @@ export interface Plan {
27
31
  */
28
32
  archived?: boolean;
29
33
  /**
30
- * Whether the plan is marked as primary.
34
+ * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
35
+ *
36
+ * Default: `false`.
31
37
  * @readonly
32
38
  */
33
39
  primary?: boolean;
@@ -57,9 +63,19 @@ export interface Plan {
57
63
  * - Value of `1`, meaning limited to one purchase per buyer.
58
64
  */
59
65
  maxPurchasesPerBuyer?: number | null;
60
- /** Whether the buyer can start the plan at a later date. Defaults to false. */
66
+ /**
67
+ * Whether the buyer can start the plan at a later date.
68
+ *
69
+ * Default: `false`.
70
+ *
71
+ */
61
72
  allowFutureStartDate?: boolean | null;
62
- /** Whether the buyer is allowed to cancel their plan. Defaults to false. */
73
+ /**
74
+ * Whether the buyer is allowed to cancel their plan. If `false`, calling the `cancelOrder()` function returns an error.
75
+ *
76
+ * Default: `false`.
77
+ *
78
+ */
63
79
  buyerCanCancel?: boolean | null;
64
80
  /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
65
81
  termsAndConditions?: string | null;
@@ -74,15 +90,19 @@ export interface StringList {
74
90
  }
75
91
  /** Plan pricing information. Includes the price of the plan and payment details. */
76
92
  export interface Pricing extends PricingPricingModelOneOf {
77
- /** Amount for a single payment (or the whole subscription if it's not a recurring plan) */
93
+ /** 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. */
78
94
  price?: Money;
79
- /** Free trial period for the plan in days. It’s available only for recurring plans. Set to 0 to remove free trial. */
95
+ /** 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. */
80
96
  freeTrialDays?: number | null;
81
- /** Plan has recurring payments. */
97
+ /**
98
+ * Pricing model indicating that the plan has recurring payments.
99
+ *
100
+ * 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.
101
+ */
82
102
  subscription?: Recurrence;
83
- /** One time payment, plan is valid for the specified duration. */
103
+ /** 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. */
84
104
  singlePaymentForDuration?: Duration;
85
- /** One time payment, plan is valid until it is canceled. */
105
+ /** Pricing model indicating the plan is paid in one single payment. The plan is valid until canceled. */
86
106
  singlePaymentUnlimited?: boolean | null;
87
107
  }
88
108
  /** @oneof */
@@ -96,24 +116,25 @@ export interface PricingPricingModelOneOf {
96
116
  }
97
117
  /** An object specifying how often and for how long payments recur (may be forever). */
98
118
  export interface Recurrence {
99
- /** Length of one payment cycle. */
119
+ /** 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. */
100
120
  cycleDuration?: Duration;
101
121
  /**
102
- * Amount of payment cycles this subscription is valid for.
122
+ * Amount of payment cycles the subscription is valid for.
103
123
  *
104
- * `0` for unlimited or until-canceled.
124
+ * `0` for unlimited plans or for plans that are valid until canceled.
105
125
  */
106
126
  cycleCount?: number | null;
107
127
  }
108
128
  /** A duration expressed in number of time units. */
109
129
  export interface Duration {
130
+ /** Number of days days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
131
+ count?: number | null;
110
132
  /**
111
- * The amount of a duration `unit` in a single payment cycle.
133
+ * Unit of time for the cycle duration.
134
+ *
135
+ * Supported values: `"DAY"`, `"WEEK"`, `"MONTH"`, `"YEAR"`.
112
136
  *
113
- * Currently limited to support only `1`.
114
137
  */
115
- count?: number | null;
116
- /** Unit of time for the cycle duration. */
117
138
  unit?: PeriodUnit;
118
139
  }
119
140
  export declare enum PeriodUnit {
@@ -124,26 +145,37 @@ export declare enum PeriodUnit {
124
145
  YEAR = "YEAR"
125
146
  }
126
147
  export interface Money {
127
- /** Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). */
148
+ /** Monetary amount. Decimal string with a period as a decimal separator. For example, `'3.99'`. Cannot be a negative value. */
128
149
  value?: string;
129
- /** Currency code. Must be valid ISO 4217 currency code (e.g., USD). */
150
+ /**
151
+ * Currency code. Three-letter currency code in
152
+ * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `'USD'`.
153
+ */
130
154
  currency?: string;
131
155
  }
132
156
  export interface BuyerCanCancelUpdated {
133
157
  plan?: Plan;
134
158
  }
135
159
  export interface ListPublicPlansRequest {
136
- /** Number of items to list. Defaults to 75. See [Pagination](https://dev.wix.com/api/rest/getting-started/pagination). */
160
+ /**
161
+ * Number of pricing plans to list.
162
+ *
163
+ * Default: `75`.
164
+ */
137
165
  limit?: number | null;
138
- /** Number of items to skip. Defaults to 0. See [Pagination](https://dev.wix.com/api/rest/getting-started/pagination). */
166
+ /**
167
+ * Number of pricing plans to skip.
168
+ *
169
+ * Default: `0`.
170
+ */
139
171
  offset?: number | null;
140
- /** IDs of plans to list. Non-existent IDs will be ignored and won't cause errors. You can pass a maximum of 100 IDs. */
172
+ /** 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](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
141
173
  planIds?: string[];
142
174
  }
143
175
  export interface ListPublicPlansResponse {
144
176
  /** List of public pricing plans. */
145
177
  plans?: PublicPlan[];
146
- /** Object containing paging-related data (number of plans returned, offset). */
178
+ /** Details on the paged set of public pricing plans returned. */
147
179
  pagingMetadata?: PagingMetadataV2;
148
180
  }
149
181
  /** Public plan entity containing information about the pricing plan. Can be read by any site member or visitor. */
@@ -234,19 +266,40 @@ export interface GetPlanRequest {
234
266
  _id: string;
235
267
  }
236
268
  export interface GetPlanResponse {
237
- /** Pricing plan. */
269
+ /** Pricing plan info. */
238
270
  plan?: Plan;
239
271
  }
240
272
  export interface ListPlansRequest {
241
- /** Archived filter. Defaults to ACTIVE (not archived) only. */
273
+ /**
274
+ * Archived filter.
275
+ *
276
+ * Supported values: `"ACTIVE"`, `"ARCHIVED"`, `"ARCHIVED_AND_ACTIVE"`.
277
+ *
278
+ * Default: `"ACTIVE"` (not archived).
279
+ */
242
280
  archived?: ArchivedFilter;
243
- /** Visibility filter. Defaults to PUBLIC_AND_HIDDEN (meaning, both are listed). */
281
+ /**
282
+ * Visibility filter.
283
+ *
284
+ * Supported values: `"PUBLIC_AND_HIDDEN"`, `"PUBLIC"`, `"HIDDEN"`.
285
+ *
286
+ * Default: `"PUBLIC_AND_HIDDEN"` (meaning, both public and hidden plans are listed).
287
+ *
288
+ */
244
289
  public?: PublicFilter;
245
- /** Number of pricing plans to list. Defaults to 75. */
290
+ /**
291
+ * Number of pricing plans to list.
292
+ *
293
+ * Default: `75`.
294
+ */
246
295
  limit?: number | null;
247
- /** Number of pricing plans to skip. Defaults to 0. */
296
+ /**
297
+ * Number of pricing plans to skip.
298
+ *
299
+ * Default: `0`.
300
+ */
248
301
  offset?: number | null;
249
- /** Plan ID filter. Non-existent IDs are ignored, and won't cause errors. You can pass a maximum of 100 IDs. */
302
+ /** 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](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
250
303
  planIds?: string[];
251
304
  }
252
305
  export declare enum ArchivedFilter {
@@ -268,7 +321,7 @@ export declare enum PublicFilter {
268
321
  export interface ListPlansResponse {
269
322
  /** List of all public and hidden pricing plans. */
270
323
  plans?: Plan[];
271
- /** Object containing paging-related data (number of plans returned, offset). */
324
+ /** Details on the paged set of pricing plans returned. */
272
325
  pagingMetadata?: PagingMetadataV2;
273
326
  }
274
327
  export interface GetPlanStatsRequest {
@@ -278,29 +331,38 @@ export interface GetPlanStatsResponse {
278
331
  totalPlans?: number;
279
332
  }
280
333
  export interface CreatePlanRequest {
334
+ /** Information for the plan being created. */
281
335
  plan: Plan;
282
336
  }
283
337
  export interface CreatePlanResponse {
338
+ /** Plan info. */
284
339
  plan?: Plan;
285
340
  }
286
341
  export interface UpdatePlanRequest {
342
+ /** Plan info to update. */
287
343
  plan?: Plan;
288
344
  fieldMask?: string[];
289
345
  }
290
346
  export interface UpdatePlanResponse {
347
+ /** Updated plan info. */
291
348
  plan?: Plan;
292
349
  }
293
350
  export interface SetPlanVisibilityRequest {
351
+ /** The ID of the plan to either display or hide on the site page. */
294
352
  _id: string;
353
+ /** Whether to set the plan as visible. */
295
354
  visible?: boolean;
296
355
  }
297
356
  export interface SetPlanVisibilityResponse {
357
+ /** Plan info. */
298
358
  plan?: Plan;
299
359
  }
300
360
  export interface MakePlanPrimaryRequest {
361
+ /** ID of the pricing plan to set as the primary plan. */
301
362
  _id: string;
302
363
  }
303
364
  export interface MakePlanPrimaryResponse {
365
+ /** Primary plan info. */
304
366
  plan?: Plan;
305
367
  }
306
368
  export interface ClearPrimaryRequest {
@@ -311,6 +373,7 @@ export interface ArchivePlanRequest {
311
373
  _id: string;
312
374
  }
313
375
  export interface ArchivePlanResponse {
376
+ /** Archived plan info. */
314
377
  plan?: Plan;
315
378
  }
316
379
  export interface PlanArchived {
@@ -357,67 +420,157 @@ export interface BulkActionMetadata {
357
420
  undetailedFailures?: number;
358
421
  }
359
422
  export interface ArrangePlansRequest {
423
+ /** IDs of all non-archived plans in the order you want them arranged. */
360
424
  ids?: string[];
361
425
  }
362
426
  export interface ArrangePlansResponse {
363
427
  }
364
428
  /**
365
- * Retrieves a list of up to 100 public pricing plans.
429
+ * Retrieves a list of public pricing plans.
430
+ *
431
+ *
432
+ * The `listPublicPlans()` function returns a Promise that resolves to a list of up to 100 public pricing plans. Public plans are visible plans that site visitors can see on the site and purchase.
433
+ *
434
+ * You do not need "Manage Pricing Plans" permissions to list public plans.
366
435
  * @public
367
436
  * @documentationMaturity preview
437
+ * @param options - Options for filtering and paging the list of public plans.
438
+ * @returns Fulfilled - List of public pricing plans.
368
439
  */
369
440
  export declare function listPublicPlans(options?: ListPublicPlansOptions): Promise<ListPublicPlansResponse>;
370
441
  export interface ListPublicPlansOptions {
371
- /** Number of items to list. Defaults to 75. See [Pagination](https://dev.wix.com/api/rest/getting-started/pagination). */
442
+ /**
443
+ * Number of pricing plans to list.
444
+ *
445
+ * Default: `75`.
446
+ */
372
447
  limit?: number | null;
373
- /** Number of items to skip. Defaults to 0. See [Pagination](https://dev.wix.com/api/rest/getting-started/pagination). */
448
+ /**
449
+ * Number of pricing plans to skip.
450
+ *
451
+ * Default: `0`.
452
+ */
374
453
  offset?: number | null;
375
- /** IDs of plans to list. Non-existent IDs will be ignored and won't cause errors. You can pass a maximum of 100 IDs. */
454
+ /** 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](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
376
455
  planIds?: string[];
377
456
  }
378
457
  /**
379
- * Retrieves a list of up to 1,000 public pricing plans, given the provided pagination, [sorting, and filtering](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans/filter-and-sort).
458
+ * Creates a query to retrieve a list of public pricing plans.
459
+ *
460
+ *
461
+ * The `queryPublicPlans()` function builds a query to retrieve a list of up to 1,000 public plans and returns a [`PublicPlansQueryBuilder`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansquerybuilder) object.
462
+ *
463
+ * The returned object contains the query definition which is typically used to run the query using the [`find()`]() function.
464
+ *
465
+ * You can refine the query by chaining `PublicPlansQueryBuilder` functions onto the query. `PublicPlansQueryBuilder` functions enable you to sort, filter, and control the results that `queryPublicPlans()` returns.
466
+ *
467
+ * `queryPublicPlans()` runs with the following `PublicPlansQueryBuilder` defaults that you can override:
468
+ * - [`skip`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansquerybuilder/skip): `0`
469
+ * - [`limit`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansquerybuilder/limit): `50`
470
+ *
471
+ * The functions that are chained to `queryPublicPlans()` are applied in the order they are called. For example, if you sort on the `_createdDate` property in ascending order and then on the `_id` property in ascending order, the results are sorted first by the created date of the items and then, if there are multiple results with the same date, the items are sorted by `_id` in ascending order, per created date value.
472
+ *
473
+ * The following `PublicPlansQueryBuilder` functions are supported for the `queryPublicPlans()` function. For a full description of the Plans object, see the object returned for the [`items`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansqueryresult/items) property in [`PublicPlansQueryResult`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansqueryresult).
380
474
  * @public
381
475
  * @documentationMaturity preview
476
+ * @returns Fulfilled - The query definition used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/publicplansquerybuilder/find) function.
382
477
  */
383
478
  export declare function queryPublicPlans(options?: QueryPublicPlansOptions): Promise<QueryPublicPlansResponse>;
384
479
  export interface QueryPublicPlansOptions {
385
480
  query?: QueryV2;
386
481
  }
387
482
  /**
388
- * Retrieves a pricing plan by ID.
483
+ * Retrieves a pricing plan by the specified ID.
484
+ *
485
+ *
486
+ * The `getPlan()` function returns a Promise that resolves to a plan whose ID matched the specified ID.
487
+ *
488
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can get plans.
489
+ *
490
+ * >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
389
491
  * @param _id - Plan ID.
390
492
  * @public
391
493
  * @documentationMaturity preview
392
494
  * @requiredField _id
495
+ * @returns Fulfilled - The retrieved plan's information.
393
496
  */
394
497
  export declare function getPlan(_id: string): Promise<GetPlanResponse>;
395
498
  /**
396
- * Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
499
+ * Retrieves a list of pricing plans.
500
+ *
501
+ *
502
+ * The `listPlans()` function returns a Promise that resolves to a list of up to 100 pricing plans. This includes public, hidden, and archived plans.
503
+ *
504
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can use this function to list plans.
505
+ *
506
+ * >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
397
507
  * @public
398
508
  * @documentationMaturity preview
509
+ * @param options - Options for filtering and paging the list of plans.
510
+ * @returns Fulfilled - List of plans that match the given criteria.
399
511
  */
400
512
  export declare function listPlans(options?: ListPlansOptions): Promise<ListPlansResponse>;
401
513
  export interface ListPlansOptions {
402
- /** Archived filter. Defaults to ACTIVE (not archived) only. */
514
+ /**
515
+ * Archived filter.
516
+ *
517
+ * Supported values: `"ACTIVE"`, `"ARCHIVED"`, `"ARCHIVED_AND_ACTIVE"`.
518
+ *
519
+ * Default: `"ACTIVE"` (not archived).
520
+ */
403
521
  archived?: ArchivedFilter;
404
- /** Visibility filter. Defaults to PUBLIC_AND_HIDDEN (meaning, both are listed). */
522
+ /**
523
+ * Visibility filter.
524
+ *
525
+ * Supported values: `"PUBLIC_AND_HIDDEN"`, `"PUBLIC"`, `"HIDDEN"`.
526
+ *
527
+ * Default: `"PUBLIC_AND_HIDDEN"` (meaning, both public and hidden plans are listed).
528
+ *
529
+ */
405
530
  public?: PublicFilter;
406
- /** Number of pricing plans to list. Defaults to 75. */
531
+ /**
532
+ * Number of pricing plans to list.
533
+ *
534
+ * Default: `75`.
535
+ */
407
536
  limit?: number | null;
408
- /** Number of pricing plans to skip. Defaults to 0. */
537
+ /**
538
+ * Number of pricing plans to skip.
539
+ *
540
+ * Default: `0`.
541
+ */
409
542
  offset?: number | null;
410
- /** Plan ID filter. Non-existent IDs are ignored, and won't cause errors. You can pass a maximum of 100 IDs. */
543
+ /** 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](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/arrangeplans) displayed in the Dashboard. You can pass a maximum of 100 IDs. */
411
544
  planIds?: string[];
412
545
  }
413
546
  /**
414
- * Gets statistics about the pricing plans. Currently providing only the total number of pricing plans.
547
+ * Retrieves statistics about the pricing plans.
548
+ *
549
+ *
550
+ * The `getPlanStats()` function returns a Promise that resolves to statistics about the plan on the site.
551
+ *
552
+ * Currently this function provides only the total number of pricing plans, including archived plans.
553
+ *
554
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can get plan statistics.
415
555
  * @public
416
556
  * @documentationMaturity preview
557
+ * @returns Fulfilled - Overall statistics about the pricing plans.
417
558
  */
418
559
  export declare function getPlanStats(): Promise<GetPlanStatsResponse>;
419
560
  /**
420
561
  * Creates a pricing plan.
562
+ *
563
+ *
564
+ * The `createPlan()` function returns a Promise that resolves to a newly-created pricing plan after is has successfully been created.
565
+ *
566
+ * The passed `plan` object must contain a [pricing model](#link to intro). A pricing model can be one of the following:
567
+ * - **A subscription**: A subscription with recurring payment and how often the plan occurs. Subscriptions can have free trial days.
568
+ * - **A plan that does not renew**: A single payment for a specific duration that doesn't renew.
569
+ * - **An unlimited plan**: A single payment for an unlimited amount of time (until canceled).
570
+ *
571
+ * Pricing plans created by this function are available to the site owner in the Pricing Plans section in the Dashboard.
572
+ *
573
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can create plans.
421
574
  * @public
422
575
  * @documentationMaturity preview
423
576
  * @requiredField plan
@@ -427,21 +580,36 @@ export declare function getPlanStats(): Promise<GetPlanStatsResponse>;
427
580
  * @requiredField plan.pricing.subscription.cycleCount
428
581
  * @requiredField plan.pricing.subscription.cycleDuration
429
582
  * @requiredField plan.pricing.subscription.cycleDuration.count
583
+ * @param plan - Information for the plan being created.
584
+ * @returns Fulfilled - The created plan.
585
+ *
586
+ * Rejected - Error message.
430
587
  */
431
588
  export declare function createPlan(plan: Plan): Promise<CreatePlanResponse>;
432
589
  /**
433
590
  * Updates a pricing plan.
434
- * Updating a plan does not impact existing orders made for the plan. All orders keep the details of the original plan that was active at the time of purchase.
435
- * @param _id - Plan ID.
591
+ *
592
+ *
593
+ * The `updatePlan()` function returns a Promise that resolves to an updated plan.
594
+ *
595
+ * Updating a plan does not impact existing purchases made for the plan. All purchases keep the details of the original plan that was active at the time of the purchase.
596
+ *
597
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can update plans.
436
598
  * @public
437
599
  * @documentationMaturity preview
438
600
  * @requiredField _id
601
+ * @param _id - ID of the plan to update.
602
+ * @param options - Options for updating the plan.
603
+ * @returns Fulfilled - The updated plan.
604
+ *
605
+ * Rejected - Error message.
439
606
  */
440
607
  export declare function updatePlan(_id: string, options?: UpdatePlanOptions): Promise<UpdatePlanResponse>;
441
608
  export interface UpdatePlanOptions {
609
+ /** Plan info to update. */
442
610
  plan: {
443
611
  /**
444
- * Plan ID.
612
+ * ID of the plan to update.
445
613
  * @readonly
446
614
  */
447
615
  _id?: string;
@@ -449,7 +617,7 @@ export interface UpdatePlanOptions {
449
617
  name?: string | null;
450
618
  /** Plan description. */
451
619
  description?: string | null;
452
- /** What is included with this plan (e.g., 1 weekly entrance to a specific class). */
620
+ /** List of text strings that promote the pricing plan. For example, "Plenty of parking" or "Free gift on your birthday". */
453
621
  perks?: StringList;
454
622
  /** Plan price, payment schedule, and expiration. */
455
623
  pricing?: Pricing;
@@ -461,7 +629,9 @@ export interface UpdatePlanOptions {
461
629
  */
462
630
  archived?: boolean;
463
631
  /**
464
- * Whether the plan is marked as primary.
632
+ * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
633
+ *
634
+ * Default: `false`.
465
635
  * @readonly
466
636
  */
467
637
  primary?: boolean;
@@ -491,9 +661,18 @@ export interface UpdatePlanOptions {
491
661
  * - Value of `1`, meaning limited to one purchase per buyer.
492
662
  */
493
663
  maxPurchasesPerBuyer?: number | null;
494
- /** Whether the buyer can start the plan at a later date. Defaults to false. */
664
+ /**
665
+ * Whether the buyer can start the plan at a later date.
666
+ *
667
+ * Default: `false`.
668
+ */
495
669
  allowFutureStartDate?: boolean | null;
496
- /** Whether the buyer is allowed to cancel their plan. Defaults to false. */
670
+ /**
671
+ * Whether the buyer is allowed to cancel their plan.
672
+ *
673
+ * Default: `false`.
674
+ *
675
+ */
497
676
  buyerCanCancel?: boolean | null;
498
677
  /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
499
678
  termsAndConditions?: string | null;
@@ -504,50 +683,106 @@ export interface UpdatePlanOptions {
504
683
  fieldMask?: string[];
505
684
  }
506
685
  /**
507
- * Sets visibility for pricing plans. Visible plans are considered public plans.
508
- * By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors cannot choose them.
509
- * As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and cannot be made active again.)
510
- * Changing a plan’s visibility does not impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.
686
+ * Sets visibility for non-archived pricing plans.
687
+ *
688
+ * The `setPlanVisibility()` functions returns a Promise that resolves to a pricing plan when its visibility has successfully been set.
689
+ *
690
+ * By default, pricing plans are public, meaning they are visible. [Plans can be hidden](https://support.wix.com/en/article/pricing-plans-removing-a-plan-from-your-site#hiding-plans) so that site members and visitors cannot see or choose them.
691
+ *
692
+ * As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible).
693
+ *
694
+ * >**Note:** An archived plan always remains archived and cannot be made active again. When archiving a plan, its `public` property is automatically set to `false` so that it is hidden.
695
+ *
696
+ * Changing a plan's visibility does not impact existing orders for the plan. All orders for hidden plans are still active and keep their terms and payment options.
697
+ *
698
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can change a plans visibility.
511
699
  * @public
512
700
  * @documentationMaturity preview
513
701
  * @requiredField _id
702
+ * @param _id - The ID of the plan to either display or hide on the site page.
703
+ * @param options - Plan visibility options.
704
+ * @returns Fulfilled - The plan's information.
705
+ *
706
+ * Rejected - Error message.
514
707
  */
515
708
  export declare function setPlanVisibility(_id: string, options?: SetPlanVisibilityOptions): Promise<SetPlanVisibilityResponse>;
516
709
  export interface SetPlanVisibilityOptions {
710
+ /** Whether to set the plan as visible. */
517
711
  visible?: boolean;
518
712
  }
519
713
  /**
520
- * Marks a pricing plan as the primary pricing plan. When viewing pricing plans on the site, the primary plan is highlighted with a customizable ribbon.
714
+ * Marks a pricing plan as the primary pricing plan.
715
+ *
716
+ *
717
+ * The `makePlanPrimary()` function returns a Promise that resolves to the now primary pricing plan.
718
+ *
719
+ * Only a single plan can be marked as a primary plan at any given time. If there is an existing plan marked as primary, calling `makePlanPrimary()` causes the existing primary plan to lose its primary status.
720
+ *
721
+ * When viewing pricing plans on the site, the primary plan is highlighted with a customizable ribbon.
722
+ *
723
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can mark a plan as a primary plan.
521
724
  * @public
522
725
  * @documentationMaturity preview
523
726
  * @requiredField _id
727
+ * @param _id - ID of the pricing plan to set as the primary plan.
728
+ * @returns Fulfilled - The primary plan.
524
729
  */
525
730
  export declare function makePlanPrimary(_id: string): Promise<MakePlanPrimaryResponse>;
526
731
  /**
527
- * Sets all pricing plans as not primary. When viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.
732
+ * Sets all pricing plans to no longer be primary.
733
+ *
734
+ * The `clearPrimary()` function returns a Promise that is resolved when there are no pricing plans marked as `primary`.
735
+ *
736
+ * After clearing the primary plan, when viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.
737
+ *
738
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can clear the primary plan.
528
739
  * @public
529
740
  * @documentationMaturity preview
530
741
  */
531
742
  export declare function clearPrimary(): Promise<void>;
532
743
  /**
533
744
  * Archives a single plan.
534
- * When a plan is archived, it is no longer visible as a public plan that can be chosen by site members or visitors. Archived plans cannot be purchased.
535
- * An archived plan cannot be made active again.
536
- * Plan archiving does not impact existing orders made for the plan. All orders for the plan are still active and keep their perks.
537
- * Site owners can see archived plans in the Dashboard under Pricing Plans -> Archived Plans.
745
+ *
746
+ *
747
+ * The `archivePlan()` function returns a Promise that resolves to the newly-archived plan.
748
+ *
749
+ * When a plan is archived, the plan
750
+ * - Is no longer available for display or selection by visitors. This is because the plan's `public` property is automatically set to `false`.
751
+ * - Cannot be purchased.
752
+ * - Cannot be "un-archived", meaning the plan cannot be made active again.
753
+ *
754
+ * Plan archiving does not impact existing purchases made for the plan. All purchases for the plan are still active and keep their payment options and terms.
755
+ *
756
+ * Site owners can see archived plans in the Dashboard under **Pricing Plans -> Archived Plans**.
757
+ *
758
+ * Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can archive plans.
759
+ *
760
+ * >**Note:** An attempt to archive an already-archived plan throws an error.
538
761
  * @public
539
762
  * @documentationMaturity preview
540
763
  * @requiredField _id
764
+ * @param _id - ID of the active plan to archive.
765
+ * @returns Fulfilled - The archived plan.
766
+ *
767
+ * Rejected - Error message.
541
768
  */
542
769
  export declare function archivePlan(_id: string): Promise<ArchivePlanResponse>;
543
770
  /**
544
- * Changes the display order of the plans on the site. To rearrange the order of the plans, provide a list of plan IDs in the desired order.
545
- * Include all public and hidden plans in the list you provide.
546
- * Make sure to provide all non-archived plan IDs to avoid unpredictable results
771
+ * Changes the display order of the pricing plans on the site page and in the Dashboard.
772
+ *
773
+ *
774
+ * The `arrangePlans()` function returns a Promise that resolves when the plans are rearranged on the site page and in the Dashboard.
775
+ *
776
+ * To rearrange the order of the plans, provide a list of the IDs for all non-archived plans in the desired order, including hidden plans.
777
+ *
778
+ * Only users with "Managing Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can arrange plans.
779
+ *
780
+ * >**Note:** Make sure to provide *all* non-archived plan IDs to avoid unpredictable results.
547
781
  * @public
548
782
  * @documentationMaturity preview
549
783
  */
550
784
  export declare function arrangePlans(options?: ArrangePlansOptions): Promise<void>;
551
785
  export interface ArrangePlansOptions {
786
+ /** IDs of all non-archived plans in the order you want them arranged. */
552
787
  ids?: string[];
553
788
  }