Retrieves a list of public pricing plans.
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.
function listPublicPlans(
options: ListPublicPlansOptions,
): Promise<ListPublicPlansResponse>;
Options for filtering and paging the list of public plans.
import { plans } from "wix-pricing-plans.v2";
import { elevate } from "wix-auth";
export async function myListPublicPlansFunction() {
try {
const elevatedListPublicPlans = elevate(plans.listPublicPlans);
const plansList = await elevatedListPublicPlans();
return plansList;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "pagingMetadata": {
* "count": 5,
* "hasNext": false,
* "offset": 0,
* "total": 5
* },
* "plans": [
* {
* "_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"
* ]
* },
* "primary": false,
* "pricing": {
* "freeTrialDays": 14,
* "price": {
* "currency": "EUR",
* "value": "100"
* },
* "slug": "silver-membership-monthly",
* "subscription": {
* "cycleCount": 0,
* "cycleDuration": {
* "count": 1,
* "unit": "MONTH"
* }
* }
* },
* "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"
* ]
* },
* "primary": false,
* "pricing": {
* "price": {
* "currency": "EUR",
* "value": "1000"
* },
* "singlePaymentUnlimited": 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-07T07:28:42.863Z",
* "_id": "838f2c9d-c8d0-4799-a10a-e2f23849db10",
* "_updatedDate": "2024-01-07T08:36:07.520Z",
* "allowFutureStartDate": false,
* "archived": false,
* "buyerCanCancel": true,
* "description": "Complete with all features. One month free trial.",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 0,
* "name": "Premium Plan - annual - 30 day trial",
* "perks": {
* "values": [
* "Unlimited video library streaming access",
* "File sharing enabled for all channels"
* ]
* },
* "primary": false,
* "pricing": {
* "cycleCount": 2,
* "cycleDuration": {
* "count": 1,
* "unit": "YEAR"
* },
* "freeTrialDays": 30,
* "price": {
* "currency": "EUR",
* "value": "500"
* },
* "subscription": {
* "cycleCount": 2,
* "cycleDuration": {
* "count": 1,
* "unit": "YEAR"
* }
* }
* },
* "slug": "premium-plan-annual-30-day-trial-1",
* "termsAndConditions": "Unlimited usage of services, subject to Fair Usage and Code of Conduct policies.",
* },
* {
* "_createdDate": "2024-01-07T07:10:30.074Z",
* "_id": "cb4a8c57-273a-4567-94e3-cc43d5d339f2",
* "_updatedDate": "2024-01-07T07:10:30.074Z",
* "allowFutureStartDate": false,
* "archived": false,
* "buyerCanCancel": true,
* "description": "3 mo free trial with discount for 1 year",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 0,
* "name": "Beginner's Plan",
* "perks": {
* "values": []
* },
* "primary": false,
* "pricing": {
* "cycleCount": 2,
* "cycleDuration": {
* "count": 1,
* "unit": "YEAR"
* },
* "freeTrialDays": 90,
* "price": {
* "currency": "EUR",
* "value": "50"
* }
* },
* "slug": "beginners-plan",
* "termsAndConditions": ""
* },
* {
* "_createdDate": "2024-01-07T08:18:16.411Z",
* "_id": "7a3375ce-18a9-42cb-8e39-47918ade45ec",
* "_updatedDate": "2024-01-07T08:18:16.411Z",
* "allowFutureStartDate": false,
* "archived": false,
* "buyerCanCancel": true,
* "description": "Affordable with great functionality. Expires after 1 year",
* "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
* "hasOrders": false,
* "maxPurchasesPerBuyer": 0,
* "name": "Basic Plan - monthly subscription",
* "perks": {
* "values": [
* "Access to select video channels",
* "Access to rich site content",
* "Access to designated file store"
* ]
* },
* "primary": false,
* "pricing": {
* "cycleCount": 12,
* "cycleDuration": {
* "count": 1,
* "unit": "MONTH"
* },
* "price": {
* "currency": "EUR",
* "value": "5"
* },
* "slug": "basic-plan-monthly-subscription"
* },
* "termsAndConditions": ""
* }
* ],
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.