Search.../

listPublicPlans( )

Lists public pricing plans.

Description

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.

You do not need "Manage Pricing Plans" permissions to list public plans.

Syntax

function listPublicPlans([planIds: Array<string>], [options: ListPublicPlanOptions]): Promise<Array<PublicPlans>>

listPublicPlans Parameters

NAME
TYPE
DESCRIPTION
planIds
Optional
Array<string>

IDs of public plans to list. You can pass a maximum of 50 IDs. If not specified, all public plans are listed (up to 50), according to the order displayed in the Dashboard. If non-existent IDs are specified, they are ignored and do not cause errors.

options
Optional
ListPublicPlanOptions

Options to use when getting the list of public plans.

Returns

Fulfilled - List of public pricing plans.

Return Type:

Promise<Array<PublicPlans>>
NAME
TYPE
DESCRIPTION
publicPlans
Array<PublicPlan>

List of public pricing plans.

Was this helpful?

List public plans

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import wixPricingPlansBackend from 'wix-pricing-plans-backend';
3
4export const myListPublicPlansFunction = webMethod(Permissions.Anyone, () => {
5 const planIds = [
6 "001c0674-d7c9-4c77-acb5-b492b427b201",
7 "003d0674-d7c9-4d88-acb5-b492b427b302",
8 "011d0123-d7c9-5e44-acb5-d300a123b321"
9 ];
10 const options = {
11 limit: 10,
12 skip: 1
13 }
14 return wixPricingPlansBackend.listPublicPlans(planIds, options)
15 .then((publicPlans) => {
16 // Array of the specified public pricing plan objects
17 console.log(publicPlans);
18 })
19 .catch((error) => {
20 console.error(error);
21 });
22});