@wix/pricing-plans 1.0.4 → 1.0.5
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.
- package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +134 -20
- package/build/cjs/src/pricing-plans-v2-plan.http.js +134 -20
- package/build/cjs/src/pricing-plans-v2-plan.http.js.map +1 -1
- package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +293 -62
- package/build/cjs/src/pricing-plans-v2-plan.universal.js +144 -20
- package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +1 -1
- package/build/es/src/pricing-plans-v2-plan.http.d.ts +134 -20
- package/build/es/src/pricing-plans-v2-plan.http.js +134 -20
- package/build/es/src/pricing-plans-v2-plan.http.js.map +1 -1
- package/build/es/src/pricing-plans-v2-plan.universal.d.ts +293 -62
- package/build/es/src/pricing-plans-v2-plan.universal.js +144 -20
- package/build/es/src/pricing-plans-v2-plan.universal.js.map +1 -1
- package/package.json +2 -2
@@ -15,7 +15,11 @@ export interface Plan {
|
|
15
15
|
name?: string | null;
|
16
16
|
/** Plan description. */
|
17
17
|
description?: string | null;
|
18
|
-
/**
|
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
|
-
/**
|
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
|
-
/**
|
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
|
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.
|
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
|
-
/**
|
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
|
-
/**
|
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
|
-
/**
|
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
|
122
|
+
* Amount of payment cycles the subscription is valid for.
|
103
123
|
*
|
104
|
-
* `0` for unlimited or until
|
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
|
-
*
|
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
|
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
|
-
/**
|
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
|
-
/**
|
160
|
+
/**
|
161
|
+
* Number of pricing plans to list.
|
162
|
+
*
|
163
|
+
* Default: `75`.
|
164
|
+
*/
|
137
165
|
limit?: number | null;
|
138
|
-
/**
|
166
|
+
/**
|
167
|
+
* Number of pricing plans to skip.
|
168
|
+
*
|
169
|
+
* Default: `0`.
|
170
|
+
*/
|
139
171
|
offset?: number | null;
|
140
|
-
/** IDs of plans to list.
|
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
|
-
/**
|
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
|
-
/**
|
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
|
-
/**
|
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
|
-
/**
|
290
|
+
/**
|
291
|
+
* Number of pricing plans to list.
|
292
|
+
*
|
293
|
+
* Default: `75`.
|
294
|
+
*/
|
246
295
|
limit?: number | null;
|
247
|
-
/**
|
296
|
+
/**
|
297
|
+
* Number of pricing plans to skip.
|
298
|
+
*
|
299
|
+
* Default: `0`.
|
300
|
+
*/
|
248
301
|
offset?: number | null;
|
249
|
-
/**
|
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
|
-
/**
|
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,153 @@ 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
|
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
|
-
/**
|
442
|
+
/**
|
443
|
+
* Number of pricing plans to list.
|
444
|
+
*
|
445
|
+
* Default: `75`.
|
446
|
+
*/
|
372
447
|
limit?: number | null;
|
373
|
-
/**
|
448
|
+
/**
|
449
|
+
* Number of pricing plans to skip.
|
450
|
+
*
|
451
|
+
* Default: `0`.
|
452
|
+
*/
|
374
453
|
offset?: number | null;
|
375
|
-
/** IDs of plans to list.
|
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
|
-
*
|
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.
|
389
489
|
* @param _id - Plan ID.
|
390
490
|
* @public
|
391
491
|
* @documentationMaturity preview
|
392
492
|
* @requiredField _id
|
493
|
+
* @returns Fulfilled - The retrieved plan's information.
|
393
494
|
*/
|
394
495
|
export declare function getPlan(_id: string): Promise<GetPlanResponse>;
|
395
496
|
/**
|
396
|
-
* Retrieves a list of
|
497
|
+
* Retrieves a list of pricing plans.
|
498
|
+
*
|
499
|
+
*
|
500
|
+
* The `listPlans()` function returns a Promise that resolves to a list of up to 100 pricing plans. This includes public, hidden, and archived plans.
|
501
|
+
*
|
502
|
+
* 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.
|
397
503
|
* @public
|
398
504
|
* @documentationMaturity preview
|
505
|
+
* @param options - Options for filtering and paging the list of plans.
|
506
|
+
* @returns Fulfilled - List of plans that match the given criteria.
|
399
507
|
*/
|
400
508
|
export declare function listPlans(options?: ListPlansOptions): Promise<ListPlansResponse>;
|
401
509
|
export interface ListPlansOptions {
|
402
|
-
/**
|
510
|
+
/**
|
511
|
+
* Archived filter.
|
512
|
+
*
|
513
|
+
* Supported values: `"ACTIVE"`, `"ARCHIVED"`, `"ARCHIVED_AND_ACTIVE"`.
|
514
|
+
*
|
515
|
+
* Default: `"ACTIVE"` (not archived).
|
516
|
+
*/
|
403
517
|
archived?: ArchivedFilter;
|
404
|
-
/**
|
518
|
+
/**
|
519
|
+
* Visibility filter.
|
520
|
+
*
|
521
|
+
* Supported values: `"PUBLIC_AND_HIDDEN"`, `"PUBLIC"`, `"HIDDEN"`.
|
522
|
+
*
|
523
|
+
* Default: `"PUBLIC_AND_HIDDEN"` (meaning, both public and hidden plans are listed).
|
524
|
+
*
|
525
|
+
*/
|
405
526
|
public?: PublicFilter;
|
406
|
-
/**
|
527
|
+
/**
|
528
|
+
* Number of pricing plans to list.
|
529
|
+
*
|
530
|
+
* Default: `75`.
|
531
|
+
*/
|
407
532
|
limit?: number | null;
|
408
|
-
/**
|
533
|
+
/**
|
534
|
+
* Number of pricing plans to skip.
|
535
|
+
*
|
536
|
+
* Default: `0`.
|
537
|
+
*/
|
409
538
|
offset?: number | null;
|
410
|
-
/**
|
539
|
+
/** 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
540
|
planIds?: string[];
|
412
541
|
}
|
413
542
|
/**
|
414
|
-
*
|
543
|
+
* Retrieves statistics about the pricing plans.
|
544
|
+
*
|
545
|
+
*
|
546
|
+
* The `getPlanStats()` function returns a Promise that resolves to statistics about the plan on the site.
|
547
|
+
*
|
548
|
+
* Currently this function provides only the total number of pricing plans, including archived plans.
|
549
|
+
*
|
550
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can get plan statistics.
|
415
551
|
* @public
|
416
552
|
* @documentationMaturity preview
|
553
|
+
* @returns Fulfilled - Overall statistics about the pricing plans.
|
417
554
|
*/
|
418
555
|
export declare function getPlanStats(): Promise<GetPlanStatsResponse>;
|
419
556
|
/**
|
420
557
|
* Creates a pricing plan.
|
558
|
+
*
|
559
|
+
*
|
560
|
+
* The `createPlan()` function returns a Promise that resolves to a newly-created pricing plan after is has successfully been created.
|
561
|
+
*
|
562
|
+
* The passed `plan` object must contain a [pricing model](#link to intro). A pricing model can be one of the following:
|
563
|
+
* - **A subscription**: A subscription with recurring payment and how often the plan occurs. Subscriptions can have free trial days.
|
564
|
+
* - **A plan that does not renew**: A single payment for a specific duration that doesn't renew.
|
565
|
+
* - **An unlimited plan**: A single payment for an unlimited amount of time (until canceled).
|
566
|
+
*
|
567
|
+
* Pricing plans created by this function are available to the site owner in the Pricing Plans section in the Dashboard.
|
568
|
+
*
|
569
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can create plans.
|
421
570
|
* @public
|
422
571
|
* @documentationMaturity preview
|
423
572
|
* @requiredField plan
|
@@ -427,21 +576,36 @@ export declare function getPlanStats(): Promise<GetPlanStatsResponse>;
|
|
427
576
|
* @requiredField plan.pricing.subscription.cycleCount
|
428
577
|
* @requiredField plan.pricing.subscription.cycleDuration
|
429
578
|
* @requiredField plan.pricing.subscription.cycleDuration.count
|
579
|
+
* @param plan - Information for the plan being created.
|
580
|
+
* @returns Fulfilled - The created plan.
|
581
|
+
*
|
582
|
+
* Rejected - Error message.
|
430
583
|
*/
|
431
584
|
export declare function createPlan(plan: Plan): Promise<CreatePlanResponse>;
|
432
585
|
/**
|
433
586
|
* Updates a pricing plan.
|
434
|
-
*
|
435
|
-
*
|
587
|
+
*
|
588
|
+
*
|
589
|
+
* The `updatePlan()` function returns a Promise that resolves to an updated plan.
|
590
|
+
*
|
591
|
+
* 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.
|
592
|
+
*
|
593
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can update plans.
|
436
594
|
* @public
|
437
595
|
* @documentationMaturity preview
|
438
596
|
* @requiredField _id
|
597
|
+
* @param _id - ID of the plan to update.
|
598
|
+
* @param options - Options for updating the plan.
|
599
|
+
* @returns Fulfilled - The updated plan.
|
600
|
+
*
|
601
|
+
* Rejected - Error message.
|
439
602
|
*/
|
440
603
|
export declare function updatePlan(_id: string, options?: UpdatePlanOptions): Promise<UpdatePlanResponse>;
|
441
604
|
export interface UpdatePlanOptions {
|
605
|
+
/** Plan info to update. */
|
442
606
|
plan: {
|
443
607
|
/**
|
444
|
-
*
|
608
|
+
* ID of the plan to update.
|
445
609
|
* @readonly
|
446
610
|
*/
|
447
611
|
_id?: string;
|
@@ -449,7 +613,7 @@ export interface UpdatePlanOptions {
|
|
449
613
|
name?: string | null;
|
450
614
|
/** Plan description. */
|
451
615
|
description?: string | null;
|
452
|
-
/**
|
616
|
+
/** List of text strings that promote the pricing plan. For example, "Plenty of parking" or "Free gift on your birthday". */
|
453
617
|
perks?: StringList;
|
454
618
|
/** Plan price, payment schedule, and expiration. */
|
455
619
|
pricing?: Pricing;
|
@@ -461,7 +625,9 @@ export interface UpdatePlanOptions {
|
|
461
625
|
*/
|
462
626
|
archived?: boolean;
|
463
627
|
/**
|
464
|
-
* Whether the plan is marked as primary.
|
628
|
+
* Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
|
629
|
+
*
|
630
|
+
* Default: `false`.
|
465
631
|
* @readonly
|
466
632
|
*/
|
467
633
|
primary?: boolean;
|
@@ -491,9 +657,18 @@ export interface UpdatePlanOptions {
|
|
491
657
|
* - Value of `1`, meaning limited to one purchase per buyer.
|
492
658
|
*/
|
493
659
|
maxPurchasesPerBuyer?: number | null;
|
494
|
-
/**
|
660
|
+
/**
|
661
|
+
* Whether the buyer can start the plan at a later date.
|
662
|
+
*
|
663
|
+
* Default: `false`.
|
664
|
+
*/
|
495
665
|
allowFutureStartDate?: boolean | null;
|
496
|
-
/**
|
666
|
+
/**
|
667
|
+
* Whether the buyer is allowed to cancel their plan.
|
668
|
+
*
|
669
|
+
* Default: `false`.
|
670
|
+
*
|
671
|
+
*/
|
497
672
|
buyerCanCancel?: boolean | null;
|
498
673
|
/** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
|
499
674
|
termsAndConditions?: string | null;
|
@@ -504,50 +679,106 @@ export interface UpdatePlanOptions {
|
|
504
679
|
fieldMask?: string[];
|
505
680
|
}
|
506
681
|
/**
|
507
|
-
* Sets visibility for pricing plans.
|
508
|
-
*
|
509
|
-
*
|
510
|
-
*
|
682
|
+
* Sets visibility for non-archived pricing plans.
|
683
|
+
*
|
684
|
+
* The `setPlanVisibility()` functions returns a Promise that resolves to a pricing plan when its visibility has successfully been set.
|
685
|
+
*
|
686
|
+
* 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.
|
687
|
+
*
|
688
|
+
* 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).
|
689
|
+
*
|
690
|
+
* >**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.
|
691
|
+
*
|
692
|
+
* 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.
|
693
|
+
*
|
694
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can change a plans visibility.
|
511
695
|
* @public
|
512
696
|
* @documentationMaturity preview
|
513
697
|
* @requiredField _id
|
698
|
+
* @param _id - The ID of the plan to either display or hide on the site page.
|
699
|
+
* @param options - Plan visibility options.
|
700
|
+
* @returns Fulfilled - The plan's information.
|
701
|
+
*
|
702
|
+
* Rejected - Error message.
|
514
703
|
*/
|
515
704
|
export declare function setPlanVisibility(_id: string, options?: SetPlanVisibilityOptions): Promise<SetPlanVisibilityResponse>;
|
516
705
|
export interface SetPlanVisibilityOptions {
|
706
|
+
/** Whether to set the plan as visible. */
|
517
707
|
visible?: boolean;
|
518
708
|
}
|
519
709
|
/**
|
520
|
-
* Marks a pricing plan as the primary pricing plan.
|
710
|
+
* Marks a pricing plan as the primary pricing plan.
|
711
|
+
*
|
712
|
+
*
|
713
|
+
* The `makePlanPrimary()` function returns a Promise that resolves to the now primary pricing plan.
|
714
|
+
*
|
715
|
+
* 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.
|
716
|
+
*
|
717
|
+
* When viewing pricing plans on the site, the primary plan is highlighted with a customizable ribbon.
|
718
|
+
*
|
719
|
+
* 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
720
|
* @public
|
522
721
|
* @documentationMaturity preview
|
523
722
|
* @requiredField _id
|
723
|
+
* @param _id - ID of the pricing plan to set as the primary plan.
|
724
|
+
* @returns Fulfilled - The primary plan.
|
524
725
|
*/
|
525
726
|
export declare function makePlanPrimary(_id: string): Promise<MakePlanPrimaryResponse>;
|
526
727
|
/**
|
527
|
-
* Sets all pricing plans
|
728
|
+
* Sets all pricing plans to no longer be primary.
|
729
|
+
*
|
730
|
+
* The `clearPrimary()` function returns a Promise that is resolved when there are no pricing plans marked as `primary`.
|
731
|
+
*
|
732
|
+
* After clearing the primary plan, when viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.
|
733
|
+
*
|
734
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can clear the primary plan.
|
528
735
|
* @public
|
529
736
|
* @documentationMaturity preview
|
530
737
|
*/
|
531
738
|
export declare function clearPrimary(): Promise<void>;
|
532
739
|
/**
|
533
740
|
* Archives a single plan.
|
534
|
-
*
|
535
|
-
*
|
536
|
-
*
|
537
|
-
*
|
741
|
+
*
|
742
|
+
*
|
743
|
+
* The `archivePlan()` function returns a Promise that resolves to the newly-archived plan.
|
744
|
+
*
|
745
|
+
* When a plan is archived, the plan
|
746
|
+
* - Is no longer available for display or selection by visitors. This is because the plan's `public` property is automatically set to `false`.
|
747
|
+
* - Cannot be purchased.
|
748
|
+
* - Cannot be "un-archived", meaning the plan cannot be made active again.
|
749
|
+
*
|
750
|
+
* 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.
|
751
|
+
*
|
752
|
+
* Site owners can see archived plans in the Dashboard under **Pricing Plans -> Archived Plans**.
|
753
|
+
*
|
754
|
+
* Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can archive plans.
|
755
|
+
*
|
756
|
+
* >**Note:** An attempt to archive an already-archived plan throws an error.
|
538
757
|
* @public
|
539
758
|
* @documentationMaturity preview
|
540
759
|
* @requiredField _id
|
760
|
+
* @param _id - ID of the active plan to archive.
|
761
|
+
* @returns Fulfilled - The archived plan.
|
762
|
+
*
|
763
|
+
* Rejected - Error message.
|
541
764
|
*/
|
542
765
|
export declare function archivePlan(_id: string): Promise<ArchivePlanResponse>;
|
543
766
|
/**
|
544
|
-
* Changes the display order of the plans on the site
|
545
|
-
*
|
546
|
-
*
|
767
|
+
* Changes the display order of the pricing plans on the site page and in the Dashboard.
|
768
|
+
*
|
769
|
+
*
|
770
|
+
* The `arrangePlans()` function returns a Promise that resolves when the plans are rearranged on the site page and in the Dashboard.
|
771
|
+
*
|
772
|
+
* 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.
|
773
|
+
*
|
774
|
+
* Only users with "Managing Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can arrange plans.
|
775
|
+
*
|
776
|
+
* >**Note:** Make sure to provide *all* non-archived plan IDs to avoid unpredictable results.
|
547
777
|
* @public
|
548
778
|
* @documentationMaturity preview
|
549
779
|
*/
|
550
780
|
export declare function arrangePlans(options?: ArrangePlansOptions): Promise<void>;
|
551
781
|
export interface ArrangePlansOptions {
|
782
|
+
/** IDs of all non-archived plans in the order you want them arranged. */
|
552
783
|
ids?: string[];
|
553
784
|
}
|