This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of pricing plans.
The listPlans()
function returns a Promise that resolves to a list of up to 100 pricing plans. This includes public, hidden, and archived plans.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function listPlans(options: ListPlansOptions): Promise<ListPlansResponse>;
Options for filtering and paging the list of plans.
import { plans } from "wix-pricing-plans.v2";
import { elevate } from "wix-auth";
const elevatedListPlans = elevate(plans.listPlans);
export async function myListPlansFunction() {
try {
const plansList = await elevatedListPlans();
return plansList;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* [
* {
* "_createdDate": "2024-01-08T14:33:12.209Z",
* "_id": "d2fa5805-0d1a-4cfb-9b43-e683cf5fa990",
* "_updatedDate": "2024-01-08T14:33:12.209Z",
* "allowFutureStartDate": false,
* "archived": false,
* "buyerCanCancel": true,
* "description": "The value plan",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 1,
* "name": "Silver Membership - Monthly",
* "perks": {
* "values": [
* "Full site access",
* "Full video access",
* "Consultation booking"
* ]
* },
* "pricing": {
* "cycleCount": 0,
* "cycleDuration": {
* "count": 1,
* "unit": "MONTH"
* },
* "freeTrialDays": 14,
* "price": {
* "currency": "EUR",
* "value": "100"
* },
* "subscription": {
* "cycleCount": 0,
* "cycleDuration": {
* "count": 1,
* "unit": "MONTH"
* }
* }
* },
* "primary": false,
* "public": true,
* "slug": "silver-membership-monthly",
* "termsAndConditions": ""
* },
* {
* "_createdDate": "2024-01-07T07:33:59.973Z",
* "_id": "b20feb39-a452-453e-96ee-01036adcd04e",
* "_updatedDate": "2024-01-09T09:08:05.665Z",
* "allowFutureStartDate": false,
* "archived": false,
* "buyerCanCancel": true,
* "description": "Full feature enablement - lifetime plan",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 0,
* "name": "Premium Plan - Lifetime Membership",
* "perks": {
* "values": [
* "Cloud drive and file upload services",
* "Unlimited video content access"
* ]
* },
* "pricing": {
* "price": {
* "currency": "EUR",
* "value": "1000"
* },
* "singlePaymentUnlimited": true
* },
* "primary": false,
* "public": true,
* "slug": "premium-plan-lifetime-membership",
* "termsAndConditions": "This plan allows unlimited app and site features usage for all time, subject to our fair usage agreement and basic human decency agreement."
* },
* {
* "_createdDate": "2024-01-04T12:51:42.249Z",
* "_id": "025a0d1f-7076-4e27-9696-4a67075dc2aa",
* "_updatedDate": "2024-01-07T12:53:53.562Z",
* "allowFutureStartDate": true,
* "archived": false,
* "buyerCanCancel": true,
* "description": "Bronze membership to the MyGame World of Online Gaming",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 1,
* "name": "Bronze Plan",
* "perks": {
* "values": [
* "Multiplayer",
* "Multiple devices",
* "No ads",
* "Unlimited access"
* ]
* },
* "pricing": {
* "price": {
* "currency": "USD",
* "value": "10.00"
* },
* "singlePaymentUnlimited": true
* },
* "primary": false,
* "public": false,
* "slug": "bronze-plan-1",
* "termsAndConditions": "No sharing access with others!"
* }
* ]
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.