@wix/pricing-plans 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/pricing-plans-v2-order.http.d.ts +9 -43
- package/build/cjs/src/pricing-plans-v2-order.http.js +9 -43
- package/build/cjs/src/pricing-plans-v2-order.http.js.map +1 -1
- package/build/cjs/src/pricing-plans-v2-order.universal.d.ts +48 -78
- package/build/cjs/src/pricing-plans-v2-order.universal.js +16 -59
- package/build/cjs/src/pricing-plans-v2-order.universal.js.map +1 -1
- package/build/cjs/src/pricing-plans-v2-plan.http.d.ts +5 -27
- package/build/cjs/src/pricing-plans-v2-plan.http.js +5 -27
- package/build/cjs/src/pricing-plans-v2-plan.http.js.map +1 -1
- package/build/cjs/src/pricing-plans-v2-plan.universal.d.ts +18 -70
- package/build/cjs/src/pricing-plans-v2-plan.universal.js +7 -43
- package/build/cjs/src/pricing-plans-v2-plan.universal.js.map +1 -1
- package/build/es/src/pricing-plans-v2-order.http.d.ts +9 -43
- package/build/es/src/pricing-plans-v2-order.http.js +9 -43
- package/build/es/src/pricing-plans-v2-order.http.js.map +1 -1
- package/build/es/src/pricing-plans-v2-order.universal.d.ts +48 -78
- package/build/es/src/pricing-plans-v2-order.universal.js +16 -59
- package/build/es/src/pricing-plans-v2-order.universal.js.map +1 -1
- package/build/es/src/pricing-plans-v2-plan.http.d.ts +5 -27
- package/build/es/src/pricing-plans-v2-plan.http.js +5 -27
- package/build/es/src/pricing-plans-v2-plan.http.js.map +1 -1
- package/build/es/src/pricing-plans-v2-plan.universal.d.ts +18 -70
- package/build/es/src/pricing-plans-v2-plan.universal.js +7 -43
- package/build/es/src/pricing-plans-v2-plan.universal.js.map +1 -1
- package/package.json +2 -2
@@ -18,7 +18,7 @@ export interface Order {
|
|
18
18
|
*/
|
19
19
|
_id?: string;
|
20
20
|
/**
|
21
|
-
* ID of the plan purchased with the order. See [Plans for more information about pricing plans](
|
21
|
+
* ID of the plan purchased with the order. See [Plans for more information about pricing plans](pricing-plans/plans)
|
22
22
|
* @readonly
|
23
23
|
*/
|
24
24
|
planId?: string;
|
@@ -51,9 +51,9 @@ export interface Order {
|
|
51
51
|
*/
|
52
52
|
priceDetails?: PriceDetails;
|
53
53
|
/**
|
54
|
-
*
|
54
|
+
* Pricing model, price, and payment schedule for the order.
|
55
55
|
*
|
56
|
-
* [Learn more about pricing models](
|
56
|
+
* [Learn more about pricing models](pricing-plans/plans)
|
57
57
|
* @readonly
|
58
58
|
*/
|
59
59
|
pricing?: PricingDetails;
|
@@ -69,9 +69,9 @@ export interface Order {
|
|
69
69
|
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
70
70
|
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
71
71
|
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
72
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](
|
72
|
+
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
73
73
|
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
74
|
-
* + `CANCELED`: Order has been [canceled](
|
74
|
+
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
75
75
|
* @readonly
|
76
76
|
*/
|
77
77
|
status?: OrderStatus;
|
@@ -111,8 +111,8 @@ export interface Order {
|
|
111
111
|
/**
|
112
112
|
* Current end date and time for the ordered plan.
|
113
113
|
*
|
114
|
-
* `endDate` may be updated over the course of an order. If the order is [paused](
|
115
|
-
* it will have a later `endDate` once it [resumes](
|
114
|
+
* `endDate` may be updated over the course of an order. If the order is [paused](#pauseorder),
|
115
|
+
* it will have a later `endDate` once it [resumes](#resumeorder). `endDate` may also be [postponed](#postponeenddate).
|
116
116
|
*
|
117
117
|
* Omitted if the order is valid until canceled and still `ACTIVE`.
|
118
118
|
* @readonly
|
@@ -172,12 +172,12 @@ export interface Order {
|
|
172
172
|
}
|
173
173
|
export interface Buyer {
|
174
174
|
/**
|
175
|
-
* Member ID for a buyer.
|
175
|
+
* Member ID for a buyer.
|
176
176
|
* @readonly
|
177
177
|
*/
|
178
178
|
memberId?: string;
|
179
179
|
/**
|
180
|
-
* Contact ID for a buyer.
|
180
|
+
* Contact ID for a buyer.
|
181
181
|
* @readonly
|
182
182
|
*/
|
183
183
|
contactId?: string;
|
@@ -435,8 +435,8 @@ export declare enum PaymentStatus {
|
|
435
435
|
export interface PausePeriod {
|
436
436
|
/**
|
437
437
|
* Status of the pause period. Supported values:
|
438
|
-
* + `ACTIVE`: Status while the order is [paused](
|
439
|
-
* + `ENDED`: Status when the order is [resumed](
|
438
|
+
* + `ACTIVE`: Status while the order is [paused](#pauseorder).
|
439
|
+
* + `ENDED`: Status when the order is [resumed](#resumeorder).
|
440
440
|
*/
|
441
441
|
status?: Status;
|
442
442
|
/** Start date and time of the pause period. */
|
@@ -716,7 +716,7 @@ export interface CreateGuestOnlineOrderResponse {
|
|
716
716
|
order?: Order;
|
717
717
|
}
|
718
718
|
export interface CreateOfflineOrderRequest {
|
719
|
-
/** ID of the plan being ordered. See [Plans for more information about plan IDs](
|
719
|
+
/** ID of the plan being ordered. See [Plans for more information about plan IDs](pricing-plans/plans). */
|
720
720
|
planId: string;
|
721
721
|
/** ID of the member ordering the plan. */
|
722
722
|
memberId: string;
|
@@ -1001,7 +1001,13 @@ export interface OrderEndDatePostponed {
|
|
1001
1001
|
export interface CancelOrderRequest {
|
1002
1002
|
/** Order ID. */
|
1003
1003
|
_id: string;
|
1004
|
-
/**
|
1004
|
+
/**
|
1005
|
+
* When the order is canceled.
|
1006
|
+
*
|
1007
|
+
* One time orders can only be canceled immediately. Supported values:
|
1008
|
+
* - `"IMMEDIATELY"`: The order is canceled immediately.
|
1009
|
+
* - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
|
1010
|
+
*/
|
1005
1011
|
effectiveAt: CancellationEffectiveAt;
|
1006
1012
|
}
|
1007
1013
|
export interface CancelOrderResponse {
|
@@ -1089,10 +1095,9 @@ export interface BulkResumeOrderResponse {
|
|
1089
1095
|
/**
|
1090
1096
|
* Gets an order by ID for the currently logged-in member.
|
1091
1097
|
*
|
1092
|
-
* The `
|
1098
|
+
* The `memberGetOrder()` function returns a Promise that resolves to information about a specified order for the currently logged-in member.
|
1093
1099
|
* @param _id - Order ID.
|
1094
1100
|
* @public
|
1095
|
-
* @documentationMaturity preview
|
1096
1101
|
* @requiredField _id
|
1097
1102
|
* @param options - Options for getting a logged-in member's order.
|
1098
1103
|
*/
|
@@ -1105,7 +1110,6 @@ export interface MemberGetOrderOptions {
|
|
1105
1110
|
*
|
1106
1111
|
* The `memberListOrders()` function returns a Promise that resolves to a list of up to 100 pricing plan orders.
|
1107
1112
|
* @public
|
1108
|
-
* @documentationMaturity preview
|
1109
1113
|
* @param options - Filtering, sorting, and pagination options.
|
1110
1114
|
*/
|
1111
1115
|
export declare function memberListOrders(options?: MemberListOrdersOptions): Promise<MemberListOrdersResponse>;
|
@@ -1119,9 +1123,9 @@ export interface MemberListOrdersOptions {
|
|
1119
1123
|
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
1120
1124
|
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
1121
1125
|
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
1122
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](
|
1126
|
+
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
1123
1127
|
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
1124
|
-
* + `CANCELED`: Order has been [canceled](
|
1128
|
+
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
1125
1129
|
*/
|
1126
1130
|
orderStatuses?: OrderStatus[];
|
1127
1131
|
/**
|
@@ -1177,9 +1181,8 @@ export interface MemberListOrdersOptions {
|
|
1177
1181
|
*
|
1178
1182
|
* For orders with recurring payments, a cancellation can be set to occur either immediately or at the next payment date. For orders with one-time payments, a cancellation occurs immediately after the request is processed.
|
1179
1183
|
*
|
1180
|
-
* Requesting an order cancellation starts the cancellation process.
|
1184
|
+
* Requesting an order cancellation starts the cancellation process. There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
|
1181
1185
|
*
|
1182
|
-
* The [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handler runs when a cancellation is requested. The [`onOrderCanceled()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercanceled) event handler runs when the cancellation is completed.
|
1183
1186
|
* @param _id - Order ID.
|
1184
1187
|
* @param effectiveAt - Whether to cancel the order immediately or at the next payment date.
|
1185
1188
|
* One-time payment orders can only be canceled immediately.
|
@@ -1188,7 +1191,6 @@ export interface MemberListOrdersOptions {
|
|
1188
1191
|
* - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
|
1189
1192
|
* - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
|
1190
1193
|
* @public
|
1191
|
-
* @documentationMaturity preview
|
1192
1194
|
* @requiredField _id
|
1193
1195
|
* @requiredField effectiveAt
|
1194
1196
|
* @param options - Options for requesting a cancellation.
|
@@ -1202,7 +1204,7 @@ export declare function requestCancellation(_id: string, effectiveAt: Cancellati
|
|
1202
1204
|
*
|
1203
1205
|
* Payment of an offline order is handled in 1 of 2 ways.
|
1204
1206
|
* - When creating the order, select `true` in the `paid` request parameter.
|
1205
|
-
* - After creation, with the [`markAsPaid()`](
|
1207
|
+
* - After creation, with the [`markAsPaid()`](#markaspaid) function.
|
1206
1208
|
*
|
1207
1209
|
* When creating a non-free offline order:
|
1208
1210
|
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
@@ -1211,22 +1213,21 @@ export declare function requestCancellation(_id: string, effectiveAt: Cancellati
|
|
1211
1213
|
* When creating a free offline order:
|
1212
1214
|
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
1213
1215
|
* - The order's last payment status is set to `"NOT_APPLICABLE"`.
|
1214
|
-
*
|
1215
|
-
* The [`onOrderCreated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercreated) event handler runs when an offline order is created.
|
1216
|
-
*
|
1217
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can create offline orders.
|
1218
|
-
* @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
|
1219
1216
|
* @public
|
1220
|
-
* @documentationMaturity preview
|
1221
1217
|
* @requiredField options
|
1222
1218
|
* @requiredField options.memberId
|
1223
1219
|
* @requiredField planId
|
1224
1220
|
* @param options - Options for creating an offline order.
|
1221
|
+
* @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](pricing-plans/plans)
|
1225
1222
|
* @returns Fulfilled - The order of the plan.
|
1226
1223
|
*/
|
1227
1224
|
export declare function createOfflineOrder(planId: string, options: CreateOfflineOrderOptions): Promise<CreateOfflineOrderResponse>;
|
1228
1225
|
export interface CreateOfflineOrderOptions {
|
1229
|
-
/**
|
1226
|
+
/**
|
1227
|
+
* ID of the member ordering the plan.
|
1228
|
+
* This field is required when creating an offline order.
|
1229
|
+
*
|
1230
|
+
*/
|
1230
1231
|
memberId: string;
|
1231
1232
|
/**
|
1232
1233
|
* Start date and time for the ordered plan.
|
@@ -1254,21 +1255,21 @@ export interface CreateOfflineOrderOptions {
|
|
1254
1255
|
*
|
1255
1256
|
* If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, `tax` previews as `null`.
|
1256
1257
|
*
|
1257
|
-
* You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](
|
1258
|
-
*
|
1259
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can get offline order previews.
|
1260
|
-
* @param planId - ID of the plan of the previewed order. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
|
1258
|
+
* You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](#getpricepreview) function.
|
1261
1259
|
* @public
|
1262
|
-
* @documentationMaturity preview
|
1263
1260
|
* @requiredField options
|
1264
1261
|
* @requiredField options.memberId
|
1265
1262
|
* @requiredField planId
|
1266
1263
|
* @param options - Options for previewing the offline order.
|
1264
|
+
* @param planId - ID of the plan of the previewed order. See [Plans for more information about plan IDs](pricing-plans/plans)
|
1267
1265
|
* @returns Fulfilled - A preview of the order.
|
1268
1266
|
*/
|
1269
1267
|
export declare function getOfflineOrderPreview(planId: string, options: GetOfflineOrderPreviewOptions): Promise<GetOfflineOrderPreviewResponse>;
|
1270
1268
|
export interface GetOfflineOrderPreviewOptions {
|
1271
|
-
/**
|
1269
|
+
/**
|
1270
|
+
* Member ID for the buyer who might order the plan offline.
|
1271
|
+
* This field is required to get an offline order preview.
|
1272
|
+
*/
|
1272
1273
|
memberId: string;
|
1273
1274
|
/**
|
1274
1275
|
* Start date and time for plan of the previewed order.
|
@@ -1284,12 +1285,11 @@ export interface GetOfflineOrderPreviewOptions {
|
|
1284
1285
|
*
|
1285
1286
|
* The `getPricePreview()` function returns a Promise that resolves to a temporary preview of the order's price.
|
1286
1287
|
*
|
1287
|
-
* The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved. If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection for the site, taxes are applied to the preview. If not, the `tax` previews as `null`.
|
1288
|
+
* The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved. If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, the `tax` previews as `null`.
|
1288
1289
|
*
|
1289
|
-
* Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](
|
1290
|
+
* Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](#getofflineorderpreview).
|
1290
1291
|
* @param planId - ID of plan to preview.
|
1291
1292
|
* @public
|
1292
|
-
* @documentationMaturity preview
|
1293
1293
|
* @requiredField planId
|
1294
1294
|
* @param options - Options for getting a price preview.
|
1295
1295
|
* @returns Fulfilled - A preview of the pricing for the order.
|
@@ -1303,11 +1303,8 @@ export interface GetPricePreviewOptions {
|
|
1303
1303
|
* Retrieves an order by ID.
|
1304
1304
|
*
|
1305
1305
|
* The `managementGetOrder()` function returns a Promise that resolves to information about the specified order.
|
1306
|
-
*
|
1307
|
-
* >**Note:** Only users with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can get orders.
|
1308
1306
|
* @param _id - Order ID.
|
1309
1307
|
* @public
|
1310
|
-
* @documentationMaturity preview
|
1311
1308
|
* @requiredField _id
|
1312
1309
|
* @param options - Options to use when getting an order.
|
1313
1310
|
* @returns Order.
|
@@ -1321,11 +1318,8 @@ export interface ManagementGetOrderOptions {
|
|
1321
1318
|
*
|
1322
1319
|
* The `managementListOrders()` function returns a Promise that resolves to a list of up to 50 pricing plan orders. You can specify options for filtering, sorting, and paginating the results.
|
1323
1320
|
*
|
1324
|
-
* This function returns the orders on the site. To list orders for the currently logged-in member, use [`
|
1325
|
-
*
|
1326
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can list orders.
|
1321
|
+
* This function returns the orders on the site. To list orders for the currently logged-in member, use [`memberListOrders()`](#memberlistorders).
|
1327
1322
|
* @public
|
1328
|
-
* @documentationMaturity preview
|
1329
1323
|
* @param options - Filtering, sorting, and pagination options.
|
1330
1324
|
*/
|
1331
1325
|
export declare function managementListOrders(options?: ManagementListOrdersOptions): Promise<ListOrdersResponse>;
|
@@ -1341,9 +1335,9 @@ export interface ManagementListOrdersOptions {
|
|
1341
1335
|
* + `DRAFT`: Order has been initiated but payment hasn't been processed yet. The plan isn't yet available for use to the buyer.
|
1342
1336
|
* + `PENDING`: Order has been purchased and its start date is set in the future.
|
1343
1337
|
* + `ACTIVE`: Order has been processed. The plan is available for use.
|
1344
|
-
* + `PAUSED`: Order, and use of the plan, is [paused](
|
1338
|
+
* + `PAUSED`: Order, and use of the plan, is [paused](#pauseorder). The order, and use of the plan, can be [resumed](#resumeorder).
|
1345
1339
|
* + `ENDED`: Order has completed its duration and is no longer available for use.
|
1346
|
-
* + `CANCELED`: Order has been [canceled](
|
1340
|
+
* + `CANCELED`: Order has been [canceled](#cancelorder).
|
1347
1341
|
*/
|
1348
1342
|
orderStatuses?: OrderStatus[];
|
1349
1343
|
/**
|
@@ -1386,16 +1380,11 @@ export interface ManagementListOrdersOptions {
|
|
1386
1380
|
*
|
1387
1381
|
* Postponing an order causes the following changes:
|
1388
1382
|
* - The `endDate` for the order is adjusted to the new end date.
|
1389
|
-
* The `onOrderEndDatePostponed()` and `onOrderUpdated()` event handlers run when an order's end date is postponed or made earlier.
|
1390
|
-
*
|
1391
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can postpone the end date of an order.
|
1392
|
-
*
|
1393
1383
|
* @param _id - Order ID.
|
1394
1384
|
* @param endDate - New end date and time.
|
1395
1385
|
*
|
1396
1386
|
* Must be later than the current end date and time.
|
1397
1387
|
* @public
|
1398
|
-
* @documentationMaturity preview
|
1399
1388
|
* @requiredField _id
|
1400
1389
|
* @requiredField endDate
|
1401
1390
|
* @param options - Options for postponing the end date of an order.
|
@@ -1413,7 +1402,6 @@ export declare function postponeEndDate(_id: string, endDate: Date): Promise<voi
|
|
1413
1402
|
* For orders with one-time payments, a cancellation occurs `IMMEDIATELY`.
|
1414
1403
|
*
|
1415
1404
|
* Canceling an order changes the order status to `"CANCELED"`.
|
1416
|
-
* The [`onOrderCanceled()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercanceled) event handler runs when an order is canceled.
|
1417
1405
|
*
|
1418
1406
|
* #### Canceling during the free trial period.
|
1419
1407
|
*
|
@@ -1424,16 +1412,13 @@ export declare function postponeEndDate(_id: string, endDate: Date): Promise<voi
|
|
1424
1412
|
* Canceling `IMMEDIATELY` will end the subscription for the buyer
|
1425
1413
|
* immediately, even during the free trial period and the buyer won't be billed.
|
1426
1414
|
* Canceling at the `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period. Then, the subscription ends and the buyer is not billed.
|
1427
|
-
*
|
1428
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only users with the "Manage Pricing Plans" and "Manage Subscription" permissions can cancel orders.
|
1429
|
-
*
|
1430
|
-
*
|
1431
|
-
*
|
1432
|
-
*
|
1433
1415
|
* @param _id - Order ID.
|
1434
|
-
* @param effectiveAt -
|
1416
|
+
* @param effectiveAt - When the order is canceled.
|
1417
|
+
*
|
1418
|
+
* One time orders can only be canceled immediately. Supported values:
|
1419
|
+
* - `"IMMEDIATELY"`: The order is canceled immediately.
|
1420
|
+
* - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
|
1435
1421
|
* @public
|
1436
|
-
* @documentationMaturity preview
|
1437
1422
|
* @requiredField _id
|
1438
1423
|
* @requiredField effectiveAt
|
1439
1424
|
* @param options - Options for canceling orders.
|
@@ -1456,13 +1441,8 @@ export declare function cancelOrder(_id: string, effectiveAt: CancellationEffect
|
|
1456
1441
|
* An error occurs if you attempt to:
|
1457
1442
|
* - Mark an already-paid, offline order as paid. You cannot make an offline order as paid twice.
|
1458
1443
|
* - Mark an online order as paid. The `markAsPaid()` function is supported for offline orders only.
|
1459
|
-
*
|
1460
|
-
* The [`onOrderMarkedAsPaid()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordermarkedaspaid) and [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handlers run when an offline order is marked as paid.
|
1461
|
-
*
|
1462
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can mark offline orders as paid.
|
1463
1444
|
* @param _id - Order ID.
|
1464
1445
|
* @public
|
1465
|
-
* @documentationMaturity preview
|
1466
1446
|
* @requiredField _id
|
1467
1447
|
* @returns Fulfilled - When the order is marked as paid.
|
1468
1448
|
*/
|
@@ -1480,14 +1460,9 @@ export declare function markAsPaid(_id: string): Promise<void>;
|
|
1480
1460
|
*
|
1481
1461
|
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
1482
1462
|
*
|
1483
|
-
*
|
1484
|
-
*
|
1485
|
-
* Paused orders can be continued with the [`resumeOrder()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/resumeorder) function.
|
1486
|
-
*
|
1487
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can pause orders.
|
1463
|
+
* Paused orders can be continued with the [`resumeOrder()`](#resumeorder) function.
|
1488
1464
|
* @param _id - Order ID.
|
1489
1465
|
* @public
|
1490
|
-
* @documentationMaturity preview
|
1491
1466
|
* @requiredField _id
|
1492
1467
|
* @returns Fulfilled - When the order is paused.
|
1493
1468
|
*/
|
@@ -1503,14 +1478,9 @@ export declare function pauseOrder(_id: string): Promise<void>;
|
|
1503
1478
|
* - The order status changes to `"ACTIVE"`.
|
1504
1479
|
* - The `pausePeriods` array is updated.
|
1505
1480
|
* - The `endDate` for the order is adjusted to include the pause period.
|
1506
|
-
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use.
|
1507
|
-
*
|
1508
|
-
* The [`onOrderResumed()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderresumed) and [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handlers run when an order is resumed.
|
1509
|
-
*
|
1510
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can resume orders.
|
1481
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
1511
1482
|
* @param _id - Order ID.
|
1512
1483
|
* @public
|
1513
|
-
* @documentationMaturity preview
|
1514
1484
|
* @requiredField _id
|
1515
1485
|
* @returns Fulfilled - When the order is resumed.
|
1516
1486
|
*/
|
@@ -204,10 +204,9 @@ const _resumeOrderResponse = {};
|
|
204
204
|
/**
|
205
205
|
* Gets an order by ID for the currently logged-in member.
|
206
206
|
*
|
207
|
-
* The `
|
207
|
+
* The `memberGetOrder()` function returns a Promise that resolves to information about a specified order for the currently logged-in member.
|
208
208
|
* @param _id - Order ID.
|
209
209
|
* @public
|
210
|
-
* @documentationMaturity preview
|
211
210
|
* @requiredField _id
|
212
211
|
* @param options - Options for getting a logged-in member's order.
|
213
212
|
*/
|
@@ -261,7 +260,6 @@ exports.memberGetOrder = memberGetOrder;
|
|
261
260
|
*
|
262
261
|
* The `memberListOrders()` function returns a Promise that resolves to a list of up to 100 pricing plan orders.
|
263
262
|
* @public
|
264
|
-
* @documentationMaturity preview
|
265
263
|
* @param options - Filtering, sorting, and pagination options.
|
266
264
|
*/
|
267
265
|
function memberListOrders(options) {
|
@@ -324,9 +322,8 @@ exports.memberListOrders = memberListOrders;
|
|
324
322
|
*
|
325
323
|
* For orders with recurring payments, a cancellation can be set to occur either immediately or at the next payment date. For orders with one-time payments, a cancellation occurs immediately after the request is processed.
|
326
324
|
*
|
327
|
-
* Requesting an order cancellation starts the cancellation process.
|
325
|
+
* Requesting an order cancellation starts the cancellation process. There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
|
328
326
|
*
|
329
|
-
* The [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handler runs when a cancellation is requested. The [`onOrderCanceled()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercanceled) event handler runs when the cancellation is completed.
|
330
327
|
* @param _id - Order ID.
|
331
328
|
* @param effectiveAt - Whether to cancel the order immediately or at the next payment date.
|
332
329
|
* One-time payment orders can only be canceled immediately.
|
@@ -335,7 +332,6 @@ exports.memberListOrders = memberListOrders;
|
|
335
332
|
* - `"IMMEDIATELY"`: Indicates that the order should be canceled immediately.
|
336
333
|
* - `"NEXT_PAYMENT_DATE"`: Indicates that the order be canceled at the next payment date.
|
337
334
|
* @public
|
338
|
-
* @documentationMaturity preview
|
339
335
|
* @requiredField _id
|
340
336
|
* @requiredField effectiveAt
|
341
337
|
* @param options - Options for requesting a cancellation.
|
@@ -393,7 +389,7 @@ exports.requestCancellation = requestCancellation;
|
|
393
389
|
*
|
394
390
|
* Payment of an offline order is handled in 1 of 2 ways.
|
395
391
|
* - When creating the order, select `true` in the `paid` request parameter.
|
396
|
-
* - After creation, with the [`markAsPaid()`](
|
392
|
+
* - After creation, with the [`markAsPaid()`](#markaspaid) function.
|
397
393
|
*
|
398
394
|
* When creating a non-free offline order:
|
399
395
|
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
@@ -402,17 +398,12 @@ exports.requestCancellation = requestCancellation;
|
|
402
398
|
* When creating a free offline order:
|
403
399
|
* - The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
404
400
|
* - The order's last payment status is set to `"NOT_APPLICABLE"`.
|
405
|
-
*
|
406
|
-
* The [`onOrderCreated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercreated) event handler runs when an offline order is created.
|
407
|
-
*
|
408
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can create offline orders.
|
409
|
-
* @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
|
410
401
|
* @public
|
411
|
-
* @documentationMaturity preview
|
412
402
|
* @requiredField options
|
413
403
|
* @requiredField options.memberId
|
414
404
|
* @requiredField planId
|
415
405
|
* @param options - Options for creating an offline order.
|
406
|
+
* @param planId - ID of the plan being ordered. See [Plans for more information about plan IDs](pricing-plans/plans)
|
416
407
|
* @returns Fulfilled - The order of the plan.
|
417
408
|
*/
|
418
409
|
function createOfflineOrder(planId, options) {
|
@@ -476,16 +467,13 @@ exports.createOfflineOrder = createOfflineOrder;
|
|
476
467
|
*
|
477
468
|
* If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, `tax` previews as `null`.
|
478
469
|
*
|
479
|
-
* You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](
|
480
|
-
*
|
481
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can get offline order previews.
|
482
|
-
* @param planId - ID of the plan of the previewed order. See [Plans for more information about plan IDs](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/plans).
|
470
|
+
* You can preview the order to check purchase limitations, but the limitations are not enforced for the preview. If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview. But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then `purchaseLimitExceeded` will return as `true`. Thus function is not available to the buyer. You specify the member ID for the buyer whose order should be previewed. To get a general price preview for a plan that's not buyer-specific, use the [`getPricePreview()`](#getpricepreview) function.
|
483
471
|
* @public
|
484
|
-
* @documentationMaturity preview
|
485
472
|
* @requiredField options
|
486
473
|
* @requiredField options.memberId
|
487
474
|
* @requiredField planId
|
488
475
|
* @param options - Options for previewing the offline order.
|
476
|
+
* @param planId - ID of the plan of the previewed order. See [Plans for more information about plan IDs](pricing-plans/plans)
|
489
477
|
* @returns Fulfilled - A preview of the order.
|
490
478
|
*/
|
491
479
|
function getOfflineOrderPreview(planId, options) {
|
@@ -543,12 +531,11 @@ exports.getOfflineOrderPreview = getOfflineOrderPreview;
|
|
543
531
|
*
|
544
532
|
* The `getPricePreview()` function returns a Promise that resolves to a temporary preview of the order's price.
|
545
533
|
*
|
546
|
-
* The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved. If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection for the site, taxes are applied to the preview. If not, the `tax` previews as `null`.
|
534
|
+
* The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved. If [taxes are configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection) for the site, taxes are applied to the preview. If not, the `tax` previews as `null`.
|
547
535
|
*
|
548
|
-
* Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](
|
536
|
+
* Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific-buyer, use the [`getOfflineOrderPreview()`](#getofflineorderpreview).
|
549
537
|
* @param planId - ID of plan to preview.
|
550
538
|
* @public
|
551
|
-
* @documentationMaturity preview
|
552
539
|
* @requiredField planId
|
553
540
|
* @param options - Options for getting a price preview.
|
554
541
|
* @returns Fulfilled - A preview of the pricing for the order.
|
@@ -605,11 +592,8 @@ exports.getPricePreview = getPricePreview;
|
|
605
592
|
* Retrieves an order by ID.
|
606
593
|
*
|
607
594
|
* The `managementGetOrder()` function returns a Promise that resolves to information about the specified order.
|
608
|
-
*
|
609
|
-
* >**Note:** Only users with the "Manage Pricing Plans" and "Manage Subscriptions" permissions can get orders.
|
610
595
|
* @param _id - Order ID.
|
611
596
|
* @public
|
612
|
-
* @documentationMaturity preview
|
613
597
|
* @requiredField _id
|
614
598
|
* @param options - Options to use when getting an order.
|
615
599
|
* @returns Order.
|
@@ -664,11 +648,8 @@ exports.managementGetOrder = managementGetOrder;
|
|
664
648
|
*
|
665
649
|
* The `managementListOrders()` function returns a Promise that resolves to a list of up to 50 pricing plan orders. You can specify options for filtering, sorting, and paginating the results.
|
666
650
|
*
|
667
|
-
* This function returns the orders on the site. To list orders for the currently logged-in member, use [`
|
668
|
-
*
|
669
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can list orders.
|
651
|
+
* This function returns the orders on the site. To list orders for the currently logged-in member, use [`memberListOrders()`](#memberlistorders).
|
670
652
|
* @public
|
671
|
-
* @documentationMaturity preview
|
672
653
|
* @param options - Filtering, sorting, and pagination options.
|
673
654
|
*/
|
674
655
|
function managementListOrders(options) {
|
@@ -735,16 +716,11 @@ exports.managementListOrders = managementListOrders;
|
|
735
716
|
*
|
736
717
|
* Postponing an order causes the following changes:
|
737
718
|
* - The `endDate` for the order is adjusted to the new end date.
|
738
|
-
* The `onOrderEndDatePostponed()` and `onOrderUpdated()` event handlers run when an order's end date is postponed or made earlier.
|
739
|
-
*
|
740
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can postpone the end date of an order.
|
741
|
-
*
|
742
719
|
* @param _id - Order ID.
|
743
720
|
* @param endDate - New end date and time.
|
744
721
|
*
|
745
722
|
* Must be later than the current end date and time.
|
746
723
|
* @public
|
747
|
-
* @documentationMaturity preview
|
748
724
|
* @requiredField _id
|
749
725
|
* @requiredField endDate
|
750
726
|
* @param options - Options for postponing the end date of an order.
|
@@ -806,7 +782,6 @@ exports.postponeEndDate = postponeEndDate;
|
|
806
782
|
* For orders with one-time payments, a cancellation occurs `IMMEDIATELY`.
|
807
783
|
*
|
808
784
|
* Canceling an order changes the order status to `"CANCELED"`.
|
809
|
-
* The [`onOrderCanceled()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordercanceled) event handler runs when an order is canceled.
|
810
785
|
*
|
811
786
|
* #### Canceling during the free trial period.
|
812
787
|
*
|
@@ -817,16 +792,13 @@ exports.postponeEndDate = postponeEndDate;
|
|
817
792
|
* Canceling `IMMEDIATELY` will end the subscription for the buyer
|
818
793
|
* immediately, even during the free trial period and the buyer won't be billed.
|
819
794
|
* Canceling at the `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period. Then, the subscription ends and the buyer is not billed.
|
820
|
-
*
|
821
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only users with the "Manage Pricing Plans" and "Manage Subscription" permissions can cancel orders.
|
822
|
-
*
|
823
|
-
*
|
824
|
-
*
|
825
|
-
*
|
826
795
|
* @param _id - Order ID.
|
827
|
-
* @param effectiveAt -
|
796
|
+
* @param effectiveAt - When the order is canceled.
|
797
|
+
*
|
798
|
+
* One time orders can only be canceled immediately. Supported values:
|
799
|
+
* - `"IMMEDIATELY"`: The order is canceled immediately.
|
800
|
+
* - `"NEXT_PAYMENT_DATE"`: The order is canceled at the next payment date.
|
828
801
|
* @public
|
829
|
-
* @documentationMaturity preview
|
830
802
|
* @requiredField _id
|
831
803
|
* @requiredField effectiveAt
|
832
804
|
* @param options - Options for canceling orders.
|
@@ -893,13 +865,8 @@ exports.cancelOrder = cancelOrder;
|
|
893
865
|
* An error occurs if you attempt to:
|
894
866
|
* - Mark an already-paid, offline order as paid. You cannot make an offline order as paid twice.
|
895
867
|
* - Mark an online order as paid. The `markAsPaid()` function is supported for offline orders only.
|
896
|
-
*
|
897
|
-
* The [`onOrderMarkedAsPaid()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onordermarkedaspaid) and [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handlers run when an offline order is marked as paid.
|
898
|
-
*
|
899
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can mark offline orders as paid.
|
900
868
|
* @param _id - Order ID.
|
901
869
|
* @public
|
902
|
-
* @documentationMaturity preview
|
903
870
|
* @requiredField _id
|
904
871
|
* @returns Fulfilled - When the order is marked as paid.
|
905
872
|
*/
|
@@ -960,14 +927,9 @@ exports.markAsPaid = markAsPaid;
|
|
960
927
|
*
|
961
928
|
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
962
929
|
*
|
963
|
-
*
|
964
|
-
*
|
965
|
-
* Paused orders can be continued with the [`resumeOrder()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/resumeorder) function.
|
966
|
-
*
|
967
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can pause orders.
|
930
|
+
* Paused orders can be continued with the [`resumeOrder()`](#resumeorder) function.
|
968
931
|
* @param _id - Order ID.
|
969
932
|
* @public
|
970
|
-
* @documentationMaturity preview
|
971
933
|
* @requiredField _id
|
972
934
|
* @returns Fulfilled - When the order is paused.
|
973
935
|
*/
|
@@ -1026,14 +988,9 @@ exports.pauseOrder = pauseOrder;
|
|
1026
988
|
* - The order status changes to `"ACTIVE"`.
|
1027
989
|
* - The `pausePeriods` array is updated.
|
1028
990
|
* - The `endDate` for the order is adjusted to include the pause period.
|
1029
|
-
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use.
|
1030
|
-
*
|
1031
|
-
* The [`onOrderResumed()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderresumed) and [`onOrderUpdated()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/events/onorderupdated) event handlers run when an order is resumed.
|
1032
|
-
*
|
1033
|
-
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function. If `wix-auth.elevate()` is not used, only those with the “Manage Pricing Plans” and “Manage Subscriptions” permissions can resume orders.
|
991
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
1034
992
|
* @param _id - Order ID.
|
1035
993
|
* @public
|
1036
|
-
* @documentationMaturity preview
|
1037
994
|
* @requiredField _id
|
1038
995
|
* @returns Fulfilled - When the order is resumed.
|
1039
996
|
*/
|