@wix/pricing-plans 1.0.53 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/build/cjs/context.d.ts +2 -2
  2. package/build/cjs/context.js +2 -2
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +2 -2
  5. package/build/cjs/index.js +2 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +2 -2
  8. package/build/cjs/meta.js +2 -2
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +2 -2
  11. package/build/es/context.js +2 -2
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +2 -2
  14. package/build/es/index.js +2 -2
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +2 -2
  17. package/build/es/meta.js +2 -2
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +12 -9
  20. package/build/cjs/index.typings.d.ts +0 -2
  21. package/build/cjs/index.typings.js +0 -29
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/pricing-plans-v2-order.context.d.ts +0 -15
  24. package/build/cjs/src/pricing-plans-v2-order.context.js +0 -148
  25. package/build/cjs/src/pricing-plans-v2-order.context.js.map +0 -1
  26. package/build/cjs/src/pricing-plans-v2-order.http.d.ts +0 -165
  27. package/build/cjs/src/pricing-plans-v2-order.http.js +0 -818
  28. package/build/cjs/src/pricing-plans-v2-order.http.js.map +0 -1
  29. package/build/cjs/src/pricing-plans-v2-order.meta.d.ts +0 -41
  30. package/build/cjs/src/pricing-plans-v2-order.meta.js +0 -275
  31. package/build/cjs/src/pricing-plans-v2-order.meta.js.map +0 -1
  32. package/build/cjs/src/pricing-plans-v2-order.public.d.ts +0 -103
  33. package/build/cjs/src/pricing-plans-v2-order.public.js +0 -96
  34. package/build/cjs/src/pricing-plans-v2-order.public.js.map +0 -1
  35. package/build/cjs/src/pricing-plans-v2-order.types.d.ts +0 -1801
  36. package/build/cjs/src/pricing-plans-v2-order.types.js +0 -135
  37. package/build/cjs/src/pricing-plans-v2-order.types.js.map +0 -1
  38. package/build/cjs/src/pricing-plans-v2-order.universal.d.ts +0 -2203
  39. package/build/cjs/src/pricing-plans-v2-order.universal.js +0 -1137
  40. package/build/cjs/src/pricing-plans-v2-order.universal.js.map +0 -1
  41. package/build/cjs/src/pricing-plans-v2-plan.context.d.ts +0 -14
  42. package/build/cjs/src/pricing-plans-v2-plan.context.js +0 -137
  43. package/build/cjs/src/pricing-plans-v2-plan.context.js.map +0 -1
  44. package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +0 -134
  45. package/build/cjs/src/pricing-plans-v2-plan.http.js +0 -544
  46. package/build/cjs/src/pricing-plans-v2-plan.http.js.map +0 -1
  47. package/build/cjs/src/pricing-plans-v2-plan.meta.d.ts +0 -34
  48. package/build/cjs/src/pricing-plans-v2-plan.meta.js +0 -256
  49. package/build/cjs/src/pricing-plans-v2-plan.meta.js.map +0 -1
  50. package/build/cjs/src/pricing-plans-v2-plan.public.d.ts +0 -85
  51. package/build/cjs/src/pricing-plans-v2-plan.public.js +0 -84
  52. package/build/cjs/src/pricing-plans-v2-plan.public.js.map +0 -1
  53. package/build/cjs/src/pricing-plans-v2-plan.types.d.ts +0 -732
  54. package/build/cjs/src/pricing-plans-v2-plan.types.js +0 -41
  55. package/build/cjs/src/pricing-plans-v2-plan.types.js.map +0 -1
  56. package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +0 -1163
  57. package/build/cjs/src/pricing-plans-v2-plan.universal.js +0 -908
  58. package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -2
  60. package/build/es/index.typings.js +0 -3
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/src/pricing-plans-v2-order.context.d.ts +0 -15
  63. package/build/es/src/pricing-plans-v2-order.context.js +0 -132
  64. package/build/es/src/pricing-plans-v2-order.context.js.map +0 -1
  65. package/build/es/src/pricing-plans-v2-order.http.d.ts +0 -165
  66. package/build/es/src/pricing-plans-v2-order.http.js +0 -802
  67. package/build/es/src/pricing-plans-v2-order.http.js.map +0 -1
  68. package/build/es/src/pricing-plans-v2-order.meta.d.ts +0 -41
  69. package/build/es/src/pricing-plans-v2-order.meta.js +0 -236
  70. package/build/es/src/pricing-plans-v2-order.meta.js.map +0 -1
  71. package/build/es/src/pricing-plans-v2-order.public.d.ts +0 -103
  72. package/build/es/src/pricing-plans-v2-order.public.js +0 -69
  73. package/build/es/src/pricing-plans-v2-order.public.js.map +0 -1
  74. package/build/es/src/pricing-plans-v2-order.types.d.ts +0 -1801
  75. package/build/es/src/pricing-plans-v2-order.types.js +0 -132
  76. package/build/es/src/pricing-plans-v2-order.types.js.map +0 -1
  77. package/build/es/src/pricing-plans-v2-order.universal.d.ts +0 -2203
  78. package/build/es/src/pricing-plans-v2-order.universal.js +0 -1098
  79. package/build/es/src/pricing-plans-v2-order.universal.js.map +0 -1
  80. package/build/es/src/pricing-plans-v2-plan.context.d.ts +0 -14
  81. package/build/es/src/pricing-plans-v2-plan.context.js +0 -122
  82. package/build/es/src/pricing-plans-v2-plan.context.js.map +0 -1
  83. package/build/es/src/pricing-plans-v2-plan.http.d.ts +0 -134
  84. package/build/es/src/pricing-plans-v2-plan.http.js +0 -529
  85. package/build/es/src/pricing-plans-v2-plan.http.js.map +0 -1
  86. package/build/es/src/pricing-plans-v2-plan.meta.d.ts +0 -34
  87. package/build/es/src/pricing-plans-v2-plan.meta.js +0 -218
  88. package/build/es/src/pricing-plans-v2-plan.meta.js.map +0 -1
  89. package/build/es/src/pricing-plans-v2-plan.public.d.ts +0 -85
  90. package/build/es/src/pricing-plans-v2-plan.public.js +0 -64
  91. package/build/es/src/pricing-plans-v2-plan.public.js.map +0 -1
  92. package/build/es/src/pricing-plans-v2-plan.types.d.ts +0 -732
  93. package/build/es/src/pricing-plans-v2-plan.types.js +0 -38
  94. package/build/es/src/pricing-plans-v2-plan.types.js.map +0 -1
  95. package/build/es/src/pricing-plans-v2-plan.universal.d.ts +0 -1163
  96. package/build/es/src/pricing-plans-v2-plan.universal.js +0 -870
  97. package/build/es/src/pricing-plans-v2-plan.universal.js.map +0 -1
@@ -1,1163 +0,0 @@
1
- /** Information about the pricing plan. */
2
- export interface Plan {
3
- /**
4
- * Plan ID.
5
- * @readonly
6
- */
7
- _id?: string;
8
- /** Plan name. */
9
- name?: string | null;
10
- /** Plan description. */
11
- description?: string | null;
12
- /**
13
- * List of text strings that promote what is included with this plan.
14
- *
15
- * For example, "Plenty of parking" or "Free gift on your birthday".
16
- */
17
- perks?: StringList;
18
- /** Plan price, payment schedule, and expiration. */
19
- pricing?: Pricing;
20
- /** Whether the plan is public (visible to site visitors and members). */
21
- public?: boolean | null;
22
- /**
23
- * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
24
- * @readonly
25
- */
26
- archived?: boolean;
27
- /**
28
- * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
29
- *
30
- * Default: `false`.
31
- * @readonly
32
- */
33
- primary?: boolean;
34
- /**
35
- * Whether the plan has any orders (including pending and unpaid orders).
36
- * @readonly
37
- */
38
- hasOrders?: boolean;
39
- /**
40
- * Date plan was created.
41
- * @readonly
42
- */
43
- _createdDate?: Date;
44
- /**
45
- * Date plan was last updated.
46
- * @readonly
47
- */
48
- _updatedDate?: Date;
49
- /**
50
- * URL-friendly version of plan name. Unique across all plans in the same site.
51
- * @readonly
52
- */
53
- slug?: string | null;
54
- /**
55
- * Number of times the same buyer can purchase the plan. Currently limited to support:
56
- * - Empty value or a value of `0`, meaning no limitation.
57
- * - Value of `1`, meaning limited to one purchase per buyer.
58
- */
59
- maxPurchasesPerBuyer?: number | null;
60
- /**
61
- * Whether the buyer can start the plan at a later date.
62
- *
63
- * Default: `false`.
64
- *
65
- */
66
- allowFutureStartDate?: boolean | null;
67
- /**
68
- * 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.
69
- *
70
- * Default: `true`.
71
- *
72
- */
73
- buyerCanCancel?: boolean | null;
74
- /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
75
- termsAndConditions?: string | null;
76
- /** ID of the form associated with the plan at checkout. */
77
- formId?: string | null;
78
- }
79
- /** This wrapper type exist in order to distinguish an empty string list from no list at all in update requests. */
80
- export interface StringList {
81
- /** List of strings */
82
- values?: string[];
83
- }
84
- /** Plan pricing information. Includes the price of the plan and payment details. */
85
- export interface Pricing extends PricingPricingModelOneOf {
86
- /**
87
- * Pricing model indicating that the plan has recurring payments.
88
- *
89
- * 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.
90
- */
91
- subscription?: Recurrence;
92
- /** 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. */
93
- singlePaymentForDuration?: Duration;
94
- /** Pricing model indicating the plan is paid in one single payment. The plan is valid until canceled. */
95
- singlePaymentUnlimited?: boolean | null;
96
- /** 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. */
97
- price?: Money;
98
- /** 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. */
99
- freeTrialDays?: number | null;
100
- }
101
- /** @oneof */
102
- export interface PricingPricingModelOneOf {
103
- /** Plan has recurring payments. */
104
- subscription?: Recurrence;
105
- /** One time payment, plan is valid for the specified duration. */
106
- singlePaymentForDuration?: Duration;
107
- /** One time payment, plan is valid until it is canceled. */
108
- singlePaymentUnlimited?: boolean | null;
109
- }
110
- /** An object specifying how often and for how long payments recur (may be forever). */
111
- export interface Recurrence {
112
- /** 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. */
113
- cycleDuration?: Duration;
114
- /**
115
- * Amount of payment cycles the subscription is valid for.
116
- *
117
- * `0` for unlimited plans or for plans that are valid until canceled.
118
- */
119
- cycleCount?: number | null;
120
- }
121
- /** A duration expressed in number of time units. */
122
- export interface Duration {
123
- /** Number of days days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`. */
124
- count?: number | null;
125
- /**
126
- * Unit of time for the cycle duration.
127
- *
128
- * Supported values: `"DAY"`, `"WEEK"`, `"MONTH"`, `"YEAR"`.
129
- *
130
- */
131
- unit?: PeriodUnit;
132
- }
133
- export declare enum PeriodUnit {
134
- UNDEFINED = "UNDEFINED",
135
- DAY = "DAY",
136
- WEEK = "WEEK",
137
- MONTH = "MONTH",
138
- YEAR = "YEAR"
139
- }
140
- export interface Money {
141
- /** Monetary amount. Decimal string with a period as a decimal separator. For example, `'3.99'`. Cannot be a negative value. */
142
- value?: string;
143
- /**
144
- * Currency code. Three-letter currency code in
145
- * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `'USD'`.
146
- */
147
- currency?: string;
148
- }
149
- export interface FeeConfig {
150
- fee?: Fee;
151
- /** The time this fee will be charged */
152
- appliedAt?: AppliedAt;
153
- }
154
- export interface Fee {
155
- /** Fee name */
156
- name?: string;
157
- /** Amount of fee to be charged */
158
- amount?: string;
159
- }
160
- export declare enum AppliedAt {
161
- UNKNOWN_CHARGE_EVENT = "UNKNOWN_CHARGE_EVENT",
162
- /** Will charge the fee on first payment. If order has a free trial meaning it will charge after the free trial. */
163
- FIRST_PAYMENT = "FIRST_PAYMENT"
164
- }
165
- export interface ListPublicPlansRequest {
166
- /**
167
- * Number of pricing plans to list.
168
- *
169
- * Default: `75`.
170
- */
171
- limit?: number | null;
172
- /**
173
- * Number of pricing plans to skip.
174
- *
175
- * Default: `0`.
176
- */
177
- offset?: number | null;
178
- /** 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. */
179
- planIds?: string[];
180
- }
181
- export interface ListPublicPlansResponse {
182
- /** List of public pricing plans. */
183
- plans?: PublicPlan[];
184
- /** Details on the paged set of public pricing plans returned. */
185
- pagingMetadata?: PagingMetadataV2;
186
- }
187
- /** Public plan entity containing information about the pricing plan. Can be read by any site member or visitor. */
188
- export interface PublicPlan {
189
- /** Plan ID. */
190
- _id?: string;
191
- /** Plan name. */
192
- name?: string | null;
193
- /** Plan description. */
194
- description?: string | null;
195
- /** What is included with this plan (e.g., 1 weekly entrance to a specific class). */
196
- perks?: StringList;
197
- /** Plan price, payment schedule, and expiration. */
198
- pricing?: Pricing;
199
- /** Whether the plan is marked as primary. */
200
- primary?: boolean;
201
- /** Date plan was created. */
202
- _createdDate?: Date;
203
- /** Date plan was last updated. */
204
- _updatedDate?: Date;
205
- /** URL-friendly version of plan name. Unique across all plans in the same site. */
206
- slug?: string | null;
207
- /** Number of times the same buyer can purchase the plan. An empty value or a value of zero means no limitation. */
208
- maxPurchasesPerBuyer?: number | null;
209
- /** Whether the buyer can start the plan at a later date. Defaults to false. */
210
- allowFutureStartDate?: boolean | null;
211
- /** Whether the buyer is allowed to cancel their plan. Defaults to false. */
212
- buyerCanCancel?: boolean | null;
213
- /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
214
- termsAndConditions?: string | null;
215
- /** ID of the form associated with the plan at checkout. */
216
- formId?: string | null;
217
- }
218
- export interface PagingMetadataV2 {
219
- /** Number of items returned in the response. */
220
- count?: number | null;
221
- /** Offset that was requested. */
222
- offset?: number | null;
223
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
224
- total?: number | null;
225
- /** Flag that indicates the server failed to calculate the `total` field. */
226
- tooManyToCount?: boolean | null;
227
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
228
- cursors?: Cursors;
229
- }
230
- export interface Cursors {
231
- /** Cursor string pointing to the next page in the list of results. */
232
- next?: string | null;
233
- /** Cursor pointing to the previous page in the list of results. */
234
- prev?: string | null;
235
- }
236
- export interface QueryPublicPlansRequest {
237
- query?: QueryV2;
238
- }
239
- export interface QueryV2 {
240
- /** 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) */
241
- filter?: Record<string, any> | null;
242
- /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
243
- sort?: Sorting[];
244
- /** Pointer to page of results using offset. Can not be used together with 'cursorPaging' */
245
- paging?: Paging;
246
- }
247
- export interface Sorting {
248
- /** Name of the field to sort by. */
249
- fieldName?: string;
250
- /** Sort order. */
251
- order?: SortOrder;
252
- }
253
- export declare enum SortOrder {
254
- ASC = "ASC",
255
- DESC = "DESC"
256
- }
257
- export interface Paging {
258
- /** Number of items to load. */
259
- limit?: number | null;
260
- /** Number of items to skip in the current sort order. */
261
- offset?: number | null;
262
- }
263
- export interface QueryPublicPlansResponse {
264
- /** List of public pricing plans that match the specified query. */
265
- plans?: PublicPlan[];
266
- /** Object containing paging-related data (number of plans returned, offset). */
267
- pagingMetadata?: PagingMetadataV2;
268
- }
269
- export interface GetPlanRequest {
270
- /** Plan ID. */
271
- _id: string;
272
- }
273
- export interface GetPlanResponse {
274
- /** Pricing plan info. */
275
- plan?: Plan;
276
- }
277
- export interface ListPlansRequest {
278
- /**
279
- * Archived filter.
280
- *
281
- * Supported values: `"ACTIVE"`, `"ARCHIVED"`, `"ARCHIVED_AND_ACTIVE"`.
282
- *
283
- * Default: `"ACTIVE"` (not archived).
284
- */
285
- archived?: ArchivedFilter;
286
- /**
287
- * Visibility filter.
288
- *
289
- * Supported values: `"PUBLIC_AND_HIDDEN"`, `"PUBLIC"`, `"HIDDEN"`.
290
- *
291
- * Default: `"PUBLIC_AND_HIDDEN"` (meaning, both public and hidden plans are listed).
292
- *
293
- */
294
- public?: PublicFilter;
295
- /**
296
- * Number of pricing plans to list.
297
- *
298
- * Default: `75`.
299
- */
300
- limit?: number | null;
301
- /**
302
- * Number of pricing plans to skip.
303
- *
304
- * Default: `0`.
305
- */
306
- offset?: number | null;
307
- /** 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. */
308
- planIds?: string[];
309
- }
310
- export declare enum ArchivedFilter {
311
- /** Returns all plans that are active. */
312
- ACTIVE = "ACTIVE",
313
- /** Returns all plans that are archived. */
314
- ARCHIVED = "ARCHIVED",
315
- /** Returns all plans that are active and archived. */
316
- ARCHIVED_AND_ACTIVE = "ARCHIVED_AND_ACTIVE"
317
- }
318
- export declare enum PublicFilter {
319
- /** Returns all public and hidden plans. */
320
- PUBLIC_AND_HIDDEN = "PUBLIC_AND_HIDDEN",
321
- /** Returns only public plans. */
322
- PUBLIC = "PUBLIC",
323
- /** Returns only hidden plans. */
324
- HIDDEN = "HIDDEN"
325
- }
326
- export interface ListPlansResponse {
327
- /** List of all public and hidden pricing plans. */
328
- plans?: Plan[];
329
- /** Details on the paged set of pricing plans returned. */
330
- pagingMetadata?: PagingMetadataV2;
331
- }
332
- export interface GetPlanStatsRequest {
333
- }
334
- export interface GetPlanStatsResponse {
335
- /** Total number of plans created, including active plans (both public and hidden) and archived plans. */
336
- totalPlans?: number;
337
- }
338
- export interface CreatePlanRequest {
339
- /** Information for the plan being created. */
340
- plan: Plan;
341
- }
342
- export interface CreatePlanResponse {
343
- /** Plan info. */
344
- plan?: Plan;
345
- }
346
- export interface UpdatePlanRequest {
347
- /** Plan info to update. */
348
- plan: Plan;
349
- }
350
- export interface UpdatePlanResponse {
351
- /** Updated plan info. */
352
- plan?: Plan;
353
- }
354
- export interface BuyerCanCancelUpdated {
355
- plan?: Plan;
356
- }
357
- export interface SetPlanVisibilityRequest {
358
- /** The ID of the plan to either display or hide on the site page. */
359
- _id: string;
360
- /** Whether to set the plan as visible. */
361
- visible: boolean;
362
- }
363
- export interface SetPlanVisibilityResponse {
364
- /** Plan info. */
365
- plan?: Plan;
366
- }
367
- export interface MakePlanPrimaryRequest {
368
- /** ID of the pricing plan to set as the primary plan. */
369
- _id: string;
370
- }
371
- export interface MakePlanPrimaryResponse {
372
- /** Primary plan info. */
373
- plan?: Plan;
374
- }
375
- export interface ClearPrimaryRequest {
376
- }
377
- export interface ClearPrimaryResponse {
378
- }
379
- export interface ArchivePlanRequest {
380
- _id: string;
381
- }
382
- export interface ArchivePlanResponse {
383
- /** Archived plan info. */
384
- plan?: Plan;
385
- }
386
- export interface PlanArchived {
387
- plan?: Plan;
388
- }
389
- export interface BulkArchivePlanRequest {
390
- /** List of Plan IDs. */
391
- ids?: string[];
392
- /** Set to true to return Plan entity in response. */
393
- returnFullEntity?: boolean;
394
- }
395
- export interface BulkArchivePlanResponse {
396
- results?: BulkPlanResult[];
397
- bulkActionMetadata?: BulkActionMetadata;
398
- }
399
- export interface BulkPlanResult {
400
- itemMetadata?: ItemMetadata;
401
- plan?: Plan;
402
- }
403
- export interface ItemMetadata {
404
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
405
- _id?: string | null;
406
- /** Index of the item within the request array. Allows for correlation between request and response items. */
407
- originalIndex?: number;
408
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
409
- success?: boolean;
410
- /** Details about the error in case of failure. */
411
- error?: ApplicationError;
412
- }
413
- export interface ApplicationError {
414
- /** Error code. */
415
- code?: string;
416
- /** Description of the error. */
417
- description?: string;
418
- /** Data related to the error. */
419
- data?: Record<string, any> | null;
420
- }
421
- export interface BulkActionMetadata {
422
- /** Number of items that were successfully processed. */
423
- totalSuccesses?: number;
424
- /** Number of items that couldn't be processed. */
425
- totalFailures?: number;
426
- /** Number of failures without details because detailed failure threshold was exceeded. */
427
- undetailedFailures?: number;
428
- }
429
- export interface ArrangePlansRequest {
430
- /** IDs of all non-archived plans in the order you want them arranged. */
431
- ids: string[];
432
- }
433
- export interface ArrangePlansResponse {
434
- }
435
- export interface DomainEvent extends DomainEventBodyOneOf {
436
- createdEvent?: EntityCreatedEvent;
437
- updatedEvent?: EntityUpdatedEvent;
438
- deletedEvent?: EntityDeletedEvent;
439
- actionEvent?: ActionEvent;
440
- /**
441
- * Unique event ID.
442
- * Allows clients to ignore duplicate webhooks.
443
- */
444
- _id?: string;
445
- /**
446
- * Assumes actions are also always typed to an entity_type
447
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
448
- */
449
- entityFqdn?: string;
450
- /**
451
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
452
- * This is although the created/updated/deleted notion is duplication of the oneof types
453
- * Example: created/updated/deleted/started/completed/email_opened
454
- */
455
- slug?: string;
456
- /** ID of the entity associated with the event. */
457
- entityId?: string;
458
- /** Event timestamp. */
459
- eventTime?: Date;
460
- /**
461
- * Whether the event was triggered as a result of a privacy regulation application
462
- * (for example, GDPR).
463
- */
464
- triggeredByAnonymizeRequest?: boolean | null;
465
- /** If present, indicates the action that triggered the event. */
466
- originatedFrom?: string | null;
467
- /**
468
- * A sequence number defining the order of updates to the underlying entity.
469
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
470
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
471
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
472
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
473
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
474
- */
475
- entityEventSequence?: string | null;
476
- }
477
- /** @oneof */
478
- export interface DomainEventBodyOneOf {
479
- createdEvent?: EntityCreatedEvent;
480
- updatedEvent?: EntityUpdatedEvent;
481
- deletedEvent?: EntityDeletedEvent;
482
- actionEvent?: ActionEvent;
483
- }
484
- export interface EntityCreatedEvent {
485
- entityAsJson?: string;
486
- }
487
- export interface EntityUpdatedEvent {
488
- /**
489
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
490
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
491
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
492
- */
493
- currentEntityAsJson?: string;
494
- }
495
- export interface EntityDeletedEvent {
496
- /** Entity that was deleted */
497
- deletedEntityAsJson?: string | null;
498
- }
499
- export interface ActionEvent {
500
- bodyAsJson?: string;
501
- }
502
- export interface ListPublicPlansResponseNonNullableFields {
503
- plans: {
504
- _id: string;
505
- perks?: {
506
- values: string[];
507
- };
508
- pricing?: {
509
- subscription?: {
510
- cycleDuration?: {
511
- unit: PeriodUnit;
512
- };
513
- };
514
- singlePaymentForDuration?: {
515
- unit: PeriodUnit;
516
- };
517
- price?: {
518
- value: string;
519
- currency: string;
520
- };
521
- };
522
- primary: boolean;
523
- }[];
524
- }
525
- export interface QueryPublicPlansResponseNonNullableFields {
526
- plans: {
527
- _id: string;
528
- perks?: {
529
- values: string[];
530
- };
531
- pricing?: {
532
- subscription?: {
533
- cycleDuration?: {
534
- unit: PeriodUnit;
535
- };
536
- };
537
- singlePaymentForDuration?: {
538
- unit: PeriodUnit;
539
- };
540
- price?: {
541
- value: string;
542
- currency: string;
543
- };
544
- };
545
- primary: boolean;
546
- }[];
547
- }
548
- export interface GetPlanResponseNonNullableFields {
549
- plan?: {
550
- _id: string;
551
- perks?: {
552
- values: string[];
553
- };
554
- pricing?: {
555
- subscription?: {
556
- cycleDuration?: {
557
- unit: PeriodUnit;
558
- };
559
- };
560
- singlePaymentForDuration?: {
561
- unit: PeriodUnit;
562
- };
563
- price?: {
564
- value: string;
565
- currency: string;
566
- };
567
- };
568
- archived: boolean;
569
- primary: boolean;
570
- hasOrders: boolean;
571
- };
572
- }
573
- export interface ListPlansResponseNonNullableFields {
574
- plans: {
575
- _id: string;
576
- perks?: {
577
- values: string[];
578
- };
579
- pricing?: {
580
- subscription?: {
581
- cycleDuration?: {
582
- unit: PeriodUnit;
583
- };
584
- };
585
- singlePaymentForDuration?: {
586
- unit: PeriodUnit;
587
- };
588
- price?: {
589
- value: string;
590
- currency: string;
591
- };
592
- };
593
- archived: boolean;
594
- primary: boolean;
595
- hasOrders: boolean;
596
- }[];
597
- }
598
- export interface GetPlanStatsResponseNonNullableFields {
599
- totalPlans: number;
600
- }
601
- export interface CreatePlanResponseNonNullableFields {
602
- plan?: {
603
- _id: string;
604
- perks?: {
605
- values: string[];
606
- };
607
- pricing?: {
608
- subscription?: {
609
- cycleDuration?: {
610
- unit: PeriodUnit;
611
- };
612
- };
613
- singlePaymentForDuration?: {
614
- unit: PeriodUnit;
615
- };
616
- price?: {
617
- value: string;
618
- currency: string;
619
- };
620
- };
621
- archived: boolean;
622
- primary: boolean;
623
- hasOrders: boolean;
624
- };
625
- }
626
- export interface UpdatePlanResponseNonNullableFields {
627
- plan?: {
628
- _id: string;
629
- perks?: {
630
- values: string[];
631
- };
632
- pricing?: {
633
- subscription?: {
634
- cycleDuration?: {
635
- unit: PeriodUnit;
636
- };
637
- };
638
- singlePaymentForDuration?: {
639
- unit: PeriodUnit;
640
- };
641
- price?: {
642
- value: string;
643
- currency: string;
644
- };
645
- };
646
- archived: boolean;
647
- primary: boolean;
648
- hasOrders: boolean;
649
- };
650
- }
651
- export interface SetPlanVisibilityResponseNonNullableFields {
652
- plan?: {
653
- _id: string;
654
- perks?: {
655
- values: string[];
656
- };
657
- pricing?: {
658
- subscription?: {
659
- cycleDuration?: {
660
- unit: PeriodUnit;
661
- };
662
- };
663
- singlePaymentForDuration?: {
664
- unit: PeriodUnit;
665
- };
666
- price?: {
667
- value: string;
668
- currency: string;
669
- };
670
- };
671
- archived: boolean;
672
- primary: boolean;
673
- hasOrders: boolean;
674
- };
675
- }
676
- export interface MakePlanPrimaryResponseNonNullableFields {
677
- plan?: {
678
- _id: string;
679
- perks?: {
680
- values: string[];
681
- };
682
- pricing?: {
683
- subscription?: {
684
- cycleDuration?: {
685
- unit: PeriodUnit;
686
- };
687
- };
688
- singlePaymentForDuration?: {
689
- unit: PeriodUnit;
690
- };
691
- price?: {
692
- value: string;
693
- currency: string;
694
- };
695
- };
696
- archived: boolean;
697
- primary: boolean;
698
- hasOrders: boolean;
699
- };
700
- }
701
- export interface ArchivePlanResponseNonNullableFields {
702
- plan?: {
703
- _id: string;
704
- perks?: {
705
- values: string[];
706
- };
707
- pricing?: {
708
- subscription?: {
709
- cycleDuration?: {
710
- unit: PeriodUnit;
711
- };
712
- };
713
- singlePaymentForDuration?: {
714
- unit: PeriodUnit;
715
- };
716
- price?: {
717
- value: string;
718
- currency: string;
719
- };
720
- };
721
- archived: boolean;
722
- primary: boolean;
723
- hasOrders: boolean;
724
- };
725
- }
726
- /**
727
- * Retrieves a list of public pricing plans.
728
- *
729
- *
730
- * 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.
731
- * @public
732
- * @param options - Options for filtering and paging the list of public plans.
733
- * @permissionScope Read Pricing Plans
734
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
735
- * @permissionScope Manage Orders
736
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
737
- * @permissionScope Manage Bookings Services and Settings
738
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
739
- * @permissionScope Read Orders
740
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
741
- * @permissionScope Manage Pricing Plans
742
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
743
- * @applicableIdentity APP
744
- * @applicableIdentity MEMBER
745
- * @applicableIdentity VISITOR
746
- * @returns Fulfilled - List of public pricing plans.
747
- */
748
- export declare function listPublicPlans(options?: ListPublicPlansOptions): Promise<ListPublicPlansResponse & ListPublicPlansResponseNonNullableFields>;
749
- export interface ListPublicPlansOptions {
750
- /**
751
- * Number of pricing plans to list.
752
- *
753
- * Default: `75`.
754
- */
755
- limit?: number | null;
756
- /**
757
- * Number of pricing plans to skip.
758
- *
759
- * Default: `0`.
760
- */
761
- offset?: number | null;
762
- /** 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. */
763
- planIds?: string[];
764
- }
765
- /**
766
- * Creates a query to retrieve a list of public pricing plans.
767
- *
768
- *
769
- * The `queryPublicPlans()` function builds a query to retrieve a list of up to 1,000 public plans and returns a [`PublicPlansQueryBuilder`](#plansquerybuilder) object.
770
- *
771
- * The returned object contains the query definition which is typically used to run the query using the [`find()`](#plansquerybuilder/find) function.
772
- *
773
- * 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.
774
- *
775
- * `queryPublicPlans()` runs with the following `PublicPlansQueryBuilder` defaults that you can override:
776
- * - [`skip`](#plansquerybuilder/skip): `0`
777
- * - [`limit`](#plansquerybuilder/limit): `50`
778
- *
779
- * 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.
780
- *
781
- * 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`](#plansqueryresult/items) property in [`PublicPlansQueryResult`](#plansqueryresult).
782
- * @public
783
- * @permissionScope Read Pricing Plans
784
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
785
- * @permissionScope Manage Orders
786
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
787
- * @permissionScope Manage Bookings Services and Settings
788
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
789
- * @permissionScope Read Orders
790
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-ORDERS
791
- * @permissionScope Manage Pricing Plans
792
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
793
- * @applicableIdentity APP
794
- * @applicableIdentity MEMBER
795
- * @applicableIdentity VISITOR
796
- */
797
- export declare function queryPublicPlans(): PlansQueryBuilder;
798
- interface QueryOffsetResult {
799
- currentPage: number | undefined;
800
- totalPages: number | undefined;
801
- totalCount: number | undefined;
802
- hasNext: () => boolean;
803
- hasPrev: () => boolean;
804
- length: number;
805
- pageSize: number;
806
- }
807
- export interface PlansQueryResult extends QueryOffsetResult {
808
- items: PublicPlan[];
809
- query: PlansQueryBuilder;
810
- next: () => Promise<PlansQueryResult>;
811
- prev: () => Promise<PlansQueryResult>;
812
- }
813
- export interface PlansQueryBuilder {
814
- /** @param propertyName - Property whose value is compared with `value`.
815
- * @param value - Value to compare against.
816
- */
817
- eq: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
818
- /** @param propertyName - Property whose value is compared with `value`.
819
- * @param value - Value to compare against.
820
- */
821
- ne: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
822
- /** @param propertyName - Property whose value is compared with `value`.
823
- * @param value - Value to compare against.
824
- */
825
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
826
- /** @param propertyName - Property whose value is compared with `value`.
827
- * @param value - Value to compare against.
828
- */
829
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
830
- /** @param propertyName - Property whose value is compared with `value`.
831
- * @param value - Value to compare against.
832
- */
833
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
834
- /** @param propertyName - Property whose value is compared with `value`.
835
- * @param value - Value to compare against.
836
- */
837
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => PlansQueryBuilder;
838
- /** @param propertyName - Property whose value is compared with `string`.
839
- * @param string - String to compare against. Case-insensitive.
840
- */
841
- startsWith: (propertyName: '_id' | 'slug', value: string) => PlansQueryBuilder;
842
- /** @param propertyName - Property whose value is compared with `values`.
843
- * @param values - List of values to compare against.
844
- */
845
- hasSome: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any[]) => PlansQueryBuilder;
846
- in: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: any) => PlansQueryBuilder;
847
- exists: (propertyName: '_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug', value: boolean) => PlansQueryBuilder;
848
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
849
- ascending: (...propertyNames: Array<'_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug'>) => PlansQueryBuilder;
850
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
851
- descending: (...propertyNames: Array<'_id' | 'primary' | '_createdDate' | '_updatedDate' | 'slug'>) => PlansQueryBuilder;
852
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
853
- limit: (limit: number) => PlansQueryBuilder;
854
- /** @param skip - Number of items to skip in the query results before returning the results. */
855
- skip: (skip: number) => PlansQueryBuilder;
856
- find: () => Promise<PlansQueryResult>;
857
- }
858
- /**
859
- * Retrieves a pricing plan by the specified ID.
860
- *
861
- * The `getPlan()` function returns a Promise that resolves to a plan whose ID matched the specified ID.
862
- * @param _id - Plan ID.
863
- * @public
864
- * @requiredField _id
865
- * @permissionScope Read Pricing Plans
866
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
867
- * @permissionScope Manage Pricing Plans
868
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
869
- * @applicableIdentity APP
870
- * @returns Fulfilled - The retrieved plan's information.
871
- */
872
- export declare function getPlan(_id: string): Promise<Plan & NonNullable<GetPlanResponseNonNullableFields>['plan']>;
873
- /**
874
- * Retrieves a list of pricing plans.
875
- *
876
- * The `listPlans()` function returns a Promise that resolves to a list of up to 100 pricing plans. This includes public, hidden, and archived plans.
877
- * @public
878
- * @documentationMaturity preview
879
- * @param options - Options for filtering and paging the list of plans.
880
- * @permissionScope Read Pricing Plans
881
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
882
- * @permissionScope Manage Pricing Plans
883
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
884
- * @applicableIdentity APP
885
- * @returns Fulfilled - List of plans that match the given criteria.
886
- */
887
- export declare function listPlans(options?: ListPlansOptions): Promise<ListPlansResponse & ListPlansResponseNonNullableFields>;
888
- export interface ListPlansOptions {
889
- /**
890
- * Archived filter.
891
- *
892
- * Supported values: `"ACTIVE"`, `"ARCHIVED"`, `"ARCHIVED_AND_ACTIVE"`.
893
- *
894
- * Default: `"ACTIVE"` (not archived).
895
- */
896
- archived?: ArchivedFilter;
897
- /**
898
- * Visibility filter.
899
- *
900
- * Supported values: `"PUBLIC_AND_HIDDEN"`, `"PUBLIC"`, `"HIDDEN"`.
901
- *
902
- * Default: `"PUBLIC_AND_HIDDEN"` (meaning, both public and hidden plans are listed).
903
- *
904
- */
905
- public?: PublicFilter;
906
- /**
907
- * Number of pricing plans to list.
908
- *
909
- * Default: `75`.
910
- */
911
- limit?: number | null;
912
- /**
913
- * Number of pricing plans to skip.
914
- *
915
- * Default: `0`.
916
- */
917
- offset?: number | null;
918
- /** 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. */
919
- planIds?: string[];
920
- }
921
- /**
922
- * Retrieves statistics about the pricing plans.
923
- *
924
- *
925
- * The `getPlanStats()` function returns a Promise that resolves to statistics about the plan on the site.
926
- *
927
- * Currently this function provides only the total number of pricing plans, including archived plans.
928
- * @public
929
- * @permissionScope Read Pricing Plans
930
- * @permissionScopeId SCOPE.DC-PAIDPLANS.READ-PLANS
931
- * @permissionScope Manage Pricing Plans
932
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
933
- * @applicableIdentity APP
934
- * @returns Fulfilled - Overall statistics about the pricing plans.
935
- */
936
- export declare function getPlanStats(): Promise<GetPlanStatsResponse & GetPlanStatsResponseNonNullableFields>;
937
- /**
938
- * Creates a pricing plan.
939
- *
940
- *
941
- * The `createPlan()` function returns a Promise that resolves to a newly-created pricing plan after is has successfully been created.
942
- *
943
- * The passed `plan` object must contain a [pricing model](https://www.wix.com/velo/reference/wix-pricing-plans-v2/plans/pricing-models). A pricing model can be one of the following:
944
- * - **A subscription**: A subscription with recurring payment and how often the plan occurs. Subscriptions can have free trial days.
945
- * - **A plan that does not renew**: A single payment for a specific duration that doesn't renew.
946
- * - **An unlimited plan**: A single payment for an unlimited amount of time (until canceled).
947
- *
948
- * Pricing plans created by this function are available to the site owner in the Pricing Plans section in the Dashboard.
949
- * @public
950
- * @requiredField plan
951
- * @requiredField plan.name
952
- * @requiredField plan.pricing
953
- * @requiredField plan.pricing.singlePaymentForDuration.count
954
- * @requiredField plan.pricing.subscription.cycleCount
955
- * @requiredField plan.pricing.subscription.cycleDuration
956
- * @requiredField plan.pricing.subscription.cycleDuration.count
957
- * @param plan - Information for the plan being created.
958
- * @permissionScope Manage Pricing Plans
959
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
960
- * @applicableIdentity APP
961
- * @returns Fulfilled - The created plan.
962
- *
963
- * Rejected - Error message.
964
- */
965
- export declare function createPlan(plan: Plan): Promise<Plan & NonNullable<CreatePlanResponseNonNullableFields>['plan']>;
966
- /**
967
- * Updates a pricing plan.
968
- *
969
- *
970
- * The `updatePlan()` function returns a Promise that resolves to an updated plan.
971
- *
972
- * 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.
973
- * @public
974
- * @requiredField _id
975
- * @requiredField plan
976
- * @param _id - ID of the plan to update.
977
- * @param options - Options for updating the plan.
978
- * @permissionScope Manage Pricing Plans
979
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
980
- * @applicableIdentity APP
981
- * @returns Fulfilled - The updated plan.
982
- *
983
- * Rejected - Error message.
984
- */
985
- export declare function updatePlan(_id: string, plan: UpdatePlan): Promise<Plan & NonNullable<UpdatePlanResponseNonNullableFields>['plan']>;
986
- export interface UpdatePlan {
987
- /**
988
- * Plan ID.
989
- * @readonly
990
- */
991
- _id?: string;
992
- /** Plan name. */
993
- name?: string | null;
994
- /** Plan description. */
995
- description?: string | null;
996
- /**
997
- * List of text strings that promote what is included with this plan.
998
- *
999
- * For example, "Plenty of parking" or "Free gift on your birthday".
1000
- */
1001
- perks?: StringList;
1002
- /** Plan price, payment schedule, and expiration. */
1003
- pricing?: Pricing;
1004
- /** Whether the plan is public (visible to site visitors and members). */
1005
- public?: boolean | null;
1006
- /**
1007
- * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
1008
- * @readonly
1009
- */
1010
- archived?: boolean;
1011
- /**
1012
- * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
1013
- *
1014
- * Default: `false`.
1015
- * @readonly
1016
- */
1017
- primary?: boolean;
1018
- /**
1019
- * Whether the plan has any orders (including pending and unpaid orders).
1020
- * @readonly
1021
- */
1022
- hasOrders?: boolean;
1023
- /**
1024
- * Date plan was created.
1025
- * @readonly
1026
- */
1027
- _createdDate?: Date;
1028
- /**
1029
- * Date plan was last updated.
1030
- * @readonly
1031
- */
1032
- _updatedDate?: Date;
1033
- /**
1034
- * URL-friendly version of plan name. Unique across all plans in the same site.
1035
- * @readonly
1036
- */
1037
- slug?: string | null;
1038
- /**
1039
- * Number of times the same buyer can purchase the plan. Currently limited to support:
1040
- * - Empty value or a value of `0`, meaning no limitation.
1041
- * - Value of `1`, meaning limited to one purchase per buyer.
1042
- */
1043
- maxPurchasesPerBuyer?: number | null;
1044
- /**
1045
- * Whether the buyer can start the plan at a later date.
1046
- *
1047
- * Default: `false`.
1048
- *
1049
- */
1050
- allowFutureStartDate?: boolean | null;
1051
- /**
1052
- * 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.
1053
- *
1054
- * Default: `true`.
1055
- *
1056
- */
1057
- buyerCanCancel?: boolean | null;
1058
- /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
1059
- termsAndConditions?: string | null;
1060
- /** ID of the form associated with the plan at checkout. */
1061
- formId?: string | null;
1062
- }
1063
- /**
1064
- * Sets visibility for non-archived pricing plans.
1065
- *
1066
- * The `setPlanVisibility()` functions returns a Promise that resolves to a pricing plan when its visibility has successfully been set.
1067
- *
1068
- * 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.
1069
- *
1070
- * 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).
1071
- *
1072
- * >**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.
1073
- *
1074
- * 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.
1075
- * @param visible - Whether to set the plan as visible.
1076
- * @public
1077
- * @requiredField _id
1078
- * @requiredField visible
1079
- * @param _id - The ID of the plan to either display or hide on the site page.
1080
- * @param options - Plan visibility options.
1081
- * @permissionScope Manage Pricing Plans
1082
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1083
- * @applicableIdentity APP
1084
- * @returns Fulfilled - The plan's information.
1085
- *
1086
- * Rejected - Error message.
1087
- */
1088
- export declare function setPlanVisibility(_id: string, visible: boolean): Promise<SetPlanVisibilityResponse & SetPlanVisibilityResponseNonNullableFields>;
1089
- /**
1090
- * Marks a pricing plan as the primary pricing plan.
1091
- *
1092
- *
1093
- * The `makePlanPrimary()` function returns a Promise that resolves to the now primary pricing plan.
1094
- *
1095
- * 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.
1096
- *
1097
- * When viewing pricing plans on the site, the primary plan is highlighted with a customizable ribbon.
1098
- * @public
1099
- * @requiredField _id
1100
- * @param _id - ID of the pricing plan to set as the primary plan.
1101
- * @permissionScope Manage Pricing Plans
1102
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1103
- * @applicableIdentity APP
1104
- * @returns Fulfilled - The primary plan.
1105
- */
1106
- export declare function makePlanPrimary(_id: string): Promise<MakePlanPrimaryResponse & MakePlanPrimaryResponseNonNullableFields>;
1107
- /**
1108
- * Sets all pricing plans to no longer be primary.
1109
- *
1110
- * The `clearPrimary()` function returns a Promise that is resolved when there are no pricing plans marked as `primary`.
1111
- *
1112
- * After clearing the primary plan, when viewing pricing plans on the site, no plan is highlighted with a customizable ribbon.
1113
- * @public
1114
- * @permissionScope Manage Pricing Plans
1115
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1116
- * @applicableIdentity APP
1117
- */
1118
- export declare function clearPrimary(): Promise<void>;
1119
- /**
1120
- * Archives a single plan.
1121
- *
1122
- *
1123
- * The `archivePlan()` function returns a Promise that resolves to the newly-archived plan.
1124
- *
1125
- * When a plan is archived, the plan
1126
- * - Is no longer available for display or selection by visitors. This is because the plan's `public` property is automatically set to `false`.
1127
- * - Cannot be purchased.
1128
- * - Cannot be "un-archived", meaning the plan cannot be made active again.
1129
- *
1130
- * 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.
1131
- *
1132
- * Site owners can see archived plans in the Dashboard under **Pricing Plans -> Archived Plans**.
1133
- *
1134
- * >**Note:** An attempt to archive an already-archived plan throws an error.
1135
- * @public
1136
- * @requiredField _id
1137
- * @param _id - ID of the active plan to archive.
1138
- * @permissionScope Manage Pricing Plans
1139
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1140
- * @applicableIdentity APP
1141
- * @returns Fulfilled - The archived plan.
1142
- *
1143
- * Rejected - Error message.
1144
- */
1145
- export declare function archivePlan(_id: string): Promise<ArchivePlanResponse & ArchivePlanResponseNonNullableFields>;
1146
- /**
1147
- * Changes the display order of the pricing plans on the site page and in the Dashboard.
1148
- *
1149
- *
1150
- * The `arrangePlans()` function returns a Promise that resolves when the plans are rearranged on the site page and in the Dashboard.
1151
- *
1152
- * 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.
1153
- *
1154
- * >**Note:** Make sure to provide *all* non-archived plan IDs to avoid unpredictable results.
1155
- * @param ids - IDs of all non-archived plans in the order you want them arranged.
1156
- * @public
1157
- * @requiredField ids
1158
- * @permissionScope Manage Pricing Plans
1159
- * @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-PLANS
1160
- * @applicableIdentity APP
1161
- */
1162
- export declare function arrangePlans(ids: string[]): Promise<void>;
1163
- export {};