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