> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

> **Deprecated.** This method is deprecated. Replacement: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-v3/search-plans.md Planned removal date: 2025-12-31.

# ListPlans

# Package: pricingPlans

# Namespace: PlansServiceV2

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-deprecated/list-plans?apiView=SDK.md

## Permission Scopes:
Read Pricing Plans: SCOPE.DC-PAIDPLANS.READ-PLANS

## Introduction

Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).

---

## REST API

### Schema

```
 Method: listPlans
 Description: Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
 URL: https://www.wixapis.com/pricing-plans/v2/plans
 Method: GET
 Method parameters:
   param name: archived | type: ArchivedFilter    
      - enum:
           ACTIVE - Returns all plans that are active.
           ARCHIVED - Returns all plans that are archived.
           ARCHIVED_AND_ACTIVE - Returns all plans that are active and archived.
   query param name: limit | type: limit | description: Number of pricing plans to list. Defaults to `75`.  | validation: minimum 1, maximum 100, format int32
   query param name: offset | type: offset | description: Number of pricing plans to skip. Defaults to `0`.  | validation: minimum 0, format int32
   query param name: planIds | type: array<planIds> | description: IDs of plans to list. If non-existent GUIDs are specified, they are ignored and don't cause errors. If no GUIDs are specified, all public and hidden plans are listed according to the order displayed in a site's dashboard (which you can set with Arrange Plans). You can specify a maximum of 100 GUIDs.  | validation: maxItems 100, format GUID
   param name: public | type: PublicFilter    
      - enum:
           PUBLIC_AND_HIDDEN - Returns all public and hidden plans.
           PUBLIC - Returns only public plans.
           HIDDEN - Returns only hidden plans.
 Return type: ListPlansResponse
  - name: plans | type: array<Plan> | description: List of all public and hidden pricing plans.  
     - name: id | type: string | description: Plan GUID.  | read-only: true | validation: format GUID
     - name: name | type: string | description: Plan name.  | validation: minLength 1, maxLength 50
     - name: description | type: string | description: Plan description.  | validation: maxLength 450
     - name: perks | type: StringList | description: List of text strings that promote what is included with this plan. For example, "Plenty of parking" or "Free gift on your birthday."  
        - name: values | type: array<string> | description:   | validation: maxItems 500, minLength 1, maxLength 1400
     - name: pricing | type: Pricing | description: Plan price, payment schedule, and expiration.  
        - ONE-OF: 
           - name: subscription | type: Recurrence | description: Pricing model indicating that the plan has recurring payments. 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.  
              - name: cycleDuration | type: Duration | description: Number of payment cycles the subscription is valid for. `0` for unlimited plans or for plans that are valid until canceled.  
                 - name: count | type: integer | description: Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`.  | validation: minimum 1, format int32
                 - name: unit | type: PeriodUnit | description: Unit of time for the cycle duration.  
                         - enum:
                         -     UNDEFINED: Not defined.
                         -     DAY: Time unit is a day.
                         -     WEEK: Time unit is a week.
                         -     MONTH: Time unit is a month.
                         -     YEAR: Time unit is a year.
              - name: cycleCount | type: integer | description: Length of a 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.  | validation: minimum 0, maximum 2000, format int32
           - name: singlePaymentForDuration | type: Duration | description: 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.  
           - name: singlePaymentUnlimited | type: boolean | description: Pricing model indicating the plan is paid in a single payment. The plan is valid until canceled.  
        - name: price | type: Money | description: 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.  
           - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example, `'3.99'`. Can't be negative.  | validation: decimalValue {"lt":"1000000000000","gte":"0.000","maxScale":3}
           - name: currency | type: string | description: Currency code. Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `'USD'`.  | validation: format CURRENCY
        - name: freeTrialDays | type: integer | description: 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.  | validation: minimum 0, maximum 999, format int32
     - name: public | type: boolean | description: Whether the plan is public (visible to site visitors and members).  
     - name: archived | type: boolean | description: Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.  | read-only: true 
     - name: primary | type: boolean | description: Whether the plan is marked as primary.  | read-only: true 
     - name: hasOrders | type: boolean | description: Whether the plan has any orders (including pending and unpaid orders).  | read-only: true 
     - name: createdDate | type: string | description: Date plan was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date plan was last updated.  | read-only: true | validation: format date-time
     - name: slug | type: string | description: URL-friendly version of plan name. Unique across all plans in the same site.  | read-only: true | validation: minLength 1, format URL_SLUG
     - name: maxPurchasesPerBuyer | type: integer | description: Number of times the same buyer can purchase the plan. Currently limited to support: - Empty value or a value of `0`, meaning no limitation. - Value of `1`, meaning limited to 1 purchase per buyer.  | validation: minimum 0, maximum 1, format int32
     - name: allowFutureStartDate | type: boolean | description: Whether the buyer can start the plan at a later date. Defaults to false.  
     - name: buyerCanCancel | type: boolean | description: Whether the buyer is allowed to cancel their plan. Defaults to false. If false, calling Request Cancellation returns an error.  
     - name: termsAndConditions | type: string | description: Any terms and conditions that apply to the plan. This information is displayed during checkout.  | validation: maxLength 3000
     - name: formId | type: string | description: GUID of the form associated with the plan at checkout.  Learn more about [forms](https://support.wix.com/en/article/wix-forms-an-overview).  | validation: format GUID
  - name: pagingMetadata | type: PagingMetadataV2 | description: Object containing paging-related data (such as the number of plans returned, the offset, and so on).  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_VISIBLE_FILTER | Description: VisibleFilter is invalid.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ARCHIVE_FILTER | Description: ArchivedFilter is invalid.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PRICING_PLANS_NOT_INSTALLED | Description: The user does not have the Wix Pricing Plans app installed on the site.


```

### Examples

### ListPlans
```curl
~~~cURL
curl -X GET \
  https://www.wixapis.com/pricing-plans/v2/plans?planIds=e9e1d210-...-b6e8-92e56705b937&planIds=2cb7396c-...-bb2e-cb27ac741d78&offset=1&archived=ACTIVE
  -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.pricingPlans.plans.listPlans(options)
 Description: Retrieves a list of up to 100 pricing plans (including public, hidden, and archived plans).
 Method parameters:
   param name: options | type: ListPlansOptions  none  
        - name: archived | type: ArchivedFilter | description: Archived filter. Defaults to `ACTIVE` (not archived) only.  
             - enum:
             -     ACTIVE: Returns all plans that are active.
             -     ARCHIVED: Returns all plans that are archived.
             -     ARCHIVED_AND_ACTIVE: Returns all plans that are active and archived.
        - name: public | type: PublicFilter | description: Visibility filter. Defaults to `PUBLIC_AND_HIDDEN` (meaning, both are listed).  
             - enum:
             -     PUBLIC_AND_HIDDEN: Returns all public and hidden plans.
             -     PUBLIC: Returns only public plans.
             -     HIDDEN: Returns only hidden plans.
        - name: limit | type: integer | description: Number of pricing plans to list. Defaults to `75`.  | validation: minimum 1, maximum 100, format int32
        - name: offset | type: integer | description: Number of pricing plans to skip. Defaults to `0`.  | validation: minimum 0, format int32
        - name: planIds | type: array<string> | description: IDs of plans to list. If non-existent GUIDs are specified, they are ignored and don't cause errors. If no GUIDs are specified, all public and hidden plans are listed according to the order displayed in a site's dashboard (which you can set with Arrange Plans). You can specify a maximum of 100 GUIDs.  | validation: maxItems 100, format GUID
 Return type: PROMISE<ListPlansResponse>
  - name: plans | type: array<Plan> | description: List of all public and hidden pricing plans.  
     - name: _id | type: string | description: Plan GUID.  | read-only: true | validation: format GUID
     - name: name | type: string | description: Plan name.  | validation: minLength 1, maxLength 50
     - name: description | type: string | description: Plan description.  | validation: maxLength 450
     - name: perks | type: StringList | description: List of text strings that promote what is included with this plan. For example, "Plenty of parking" or "Free gift on your birthday."  
        - name: values | type: array<string> | description:   | validation: maxItems 500, minLength 1, maxLength 1400
     - name: pricing | type: Pricing | description: Plan price, payment schedule, and expiration.  
        - ONE-OF: 
           - name: subscription | type: Recurrence | description: Pricing model indicating that the plan has recurring payments. 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.  
              - name: cycleDuration | type: Duration | description: Number of payment cycles the subscription is valid for. `0` for unlimited plans or for plans that are valid until canceled.  
                 - name: count | type: integer | description: Number of days, months, weeks, or years in a single payment cycle. Currently limited to support only `1`.  | validation: minimum 1, format int32
                 - name: unit | type: PeriodUnit | description: Unit of time for the cycle duration.  
                         - enum:
                         -     UNDEFINED: Not defined.
                         -     DAY: Time unit is a day.
                         -     WEEK: Time unit is a week.
                         -     MONTH: Time unit is a month.
                         -     YEAR: Time unit is a year.
              - name: cycleCount | type: integer | description: Length of a 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.  | validation: minimum 0, maximum 2000, format int32
           - name: singlePaymentForDuration | type: Duration | description: 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.  
           - name: singlePaymentUnlimited | type: boolean | description: Pricing model indicating the plan is paid in a single payment. The plan is valid until canceled.  
        - name: price | type: Money | description: 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.  
           - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example, `'3.99'`. Can't be negative.  | validation: decimalValue {"lt":"1000000000000","gte":"0.000","maxScale":3}
           - name: currency | type: string | description: Currency code. Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `'USD'`.  | validation: format CURRENCY
        - name: freeTrialDays | type: integer | description: 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.  | validation: minimum 0, maximum 999, format int32
     - name: public | type: boolean | description: Whether the plan is public (visible to site visitors and members).  
     - name: archived | type: boolean | description: Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.  | read-only: true 
     - name: primary | type: boolean | description: Whether the plan is marked as primary.  | read-only: true 
     - name: hasOrders | type: boolean | description: Whether the plan has any orders (including pending and unpaid orders).  | read-only: true 
     - name: _createdDate | type: Date | description: Date plan was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date plan was last updated.  | read-only: true 
     - name: slug | type: string | description: URL-friendly version of plan name. Unique across all plans in the same site.  | read-only: true | validation: minLength 1, format URL_SLUG
     - name: maxPurchasesPerBuyer | type: integer | description: Number of times the same buyer can purchase the plan. Currently limited to support: - Empty value or a value of `0`, meaning no limitation. - Value of `1`, meaning limited to 1 purchase per buyer.  | validation: minimum 0, maximum 1, format int32
     - name: allowFutureStartDate | type: boolean | description: Whether the buyer can start the plan at a later date. Defaults to false.  
     - name: buyerCanCancel | type: boolean | description: Whether the buyer is allowed to cancel their plan. Defaults to false. If false, calling Request Cancellation returns an error.  
     - name: termsAndConditions | type: string | description: Any terms and conditions that apply to the plan. This information is displayed during checkout.  | validation: maxLength 3000
     - name: formId | type: string | description: GUID of the form associated with the plan at checkout.  Learn more about [forms](https://support.wix.com/en/article/wix-forms-an-overview).  | validation: format GUID
  - name: pagingMetadata | type: PagingMetadataV2 | description: Object containing paging-related data (such as the number of plans returned, the offset, and so on).  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_VISIBLE_FILTER | Description: VisibleFilter is invalid.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ARCHIVE_FILTER | Description: ArchivedFilter is invalid.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: PRICING_PLANS_NOT_INSTALLED | Description: The user does not have the Wix Pricing Plans app installed on the site.


```

### Examples

### Duplicate a plan (with $w)
The `populatePlansDropdown` function retrieves all plans and then populates them into the `#plansDropdown`. The `#plansDropdown` and `#clonePlanBtn` are set to `disabled` by default.

```javascript
/*******************************************
 * Backend code - plan-functions.web.js/ts *
 *******************************************/

import { Permissions, webMethod } from '@wix/web-methods';
import { plans } from '@wix/pricing-plans';
import { auth } from '@wix/essentials';

const elevatedListPlans = auth.elevate(plans.listPlans);
const elevatedGetPlan = auth.elevate(plans.getPlan);
const elevatedCreatePlan = auth.elevate(plans.createPlan);

export const listPlans = webMethod(Permissions.Anyone, async () => {
  try {
    const response = await elevatedListPlans();
    const allPlans = response.plans;

    return allPlans;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});

export const getPlan = webMethod(Permissions.Anyone, async (planId) => {
  try {
    const selectedPlan = await elevatedGetPlan(planId);

    return selectedPlan;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});

export const createPlan = webMethod(Permissions.Anyone, async (plan) => {
  try {
    const newPlan = await elevatedCreatePlan(plan);

    return newPlan;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
});

/*************
 * Page code *
 *************/

import { listPlans, getPlan, createPlan } from 'backend/plan-functions.web';
$w.onReady(async function () {
  $w('#plansDropdown').disable();
  $w('#clonePlanBtn').disable();
  populatePlansDropdown();

  let selectedPlan;

  $w('#plansDropdown').onChange(async () => {
    const planId = $w('#plansDropdown').value;
    selectedPlan = await getPlan(planId);

    // Set default value for the new plan name
    $w('#planName').value = `${selectedPlan.name}-duplicate`
    $w('#clonePlanBtn').enable();
  });
  
  $w('#clonePlanBtn').onClick(async () => {
    const newPlan = selectedPlan;
    // Use inputs to set the new plan name and price
    newPlan.name = $w('#planName').value;
    newPlan.pricing.price.value = $w('#price').value;

    await createPlan(newPlan);
  });
});

async function populatePlansDropdown() {
  const plans = await listPlans();
  $w('#plansDropdown').options = plans.map((plan) => {
    return {
      label: plan.name,
      value: plan._id
    }
  });
  $w('#plansDropdown').enable();
}

```

### List plans with options (with elevated permissions)
```javascript
import { plans } from '@wix/pricing-plans';
import { auth } from '@wix/essentials';

/* Sample options value:
 * {
 *   public: 'HIDDEN',
 *   archived: 'ARCHIVED_AND_ACTIVE'
 * }
 */

export async function myListPlansFunction(options) {
  try {
    const elevatedListPlans = auth.elevate(plans.listPlans);
    const plansList = await elevatedListPlans(options);

    return plansList;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "pagingMetadata": {
 *     "count": 4,
 *     "offset": 0,
 *     "total": 4
 *   },
 *   "plans": [
 *     {
 *       "_createdDate": "2023-12-31T11:23:01.664Z",
 *       "_id": "1421abaa-44c7-42ae-8a75-960fe7a8aa55",
 *       "_updatedDate": "2024-01-08T11:24:18.561Z",
 *       "allowFutureStartDate": false,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "Free Plan",
 *       "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 0,
 *       "name": "Basic",
 *       "perks": {
 *         "values": []
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "EUR",
 *           "value": "0"
 *         },
 *         "singlePaymentForDuration": {
 *           "count": 3,
 *           "unit": "MONTH"
 *         }
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "basic",
 *       "termsAndConditions": "After 90 day free trial ends, your plan will end and you will need to purchase a paid plan."
 *     },
 *     {
 *       "_createdDate": "2024-01-04T12:28:21.004Z",
 *       "_id": "97033d3e-b0ad-47d7-932c-197371aab9ec",
 *       "_updatedDate": "2024-01-04T14:11:39.860Z",
 *       "allowFutureStartDate": true,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "Gold membership to the MyGame World of Online Gaming",
 *       "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 1,
 *       "name": "Gold",
 *       "perks": {
 *         "values": [
 *           "Multiplayer",
 *           "Multiple devices",
 *           "No ads",
 *           "Unlimited access"
 *         ]
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "USD",
 *           "value": "10.00"
 *         },
 *         "singlePaymentUnlimited": true
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "gold",
 *       "termsAndConditions": "No sharing access with others!"
 *     },
 *     {
 *       "_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",
 *       "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!"
 *     },
 *     {
 *       "_createdDate": "2024-01-07T07:13:04.076Z",
 *       "_id": "0b9a1993-c1ff-4952-9575-915b48d1a5e0",
 *       "_updatedDate": "2024-01-09T12:32:26.807Z",
 *       "allowFutureStartDate": false,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "For new users just getting the feel of the product",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 0,
 *       "name": "Simple Plan",
 *       "perks": {
 *         "values": [
 *           "Login member access",
 *           "Access to real-time articles",
 *           "Included in mailing list"
 *         ]
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "USD",
 *           "value": "3"
 *         },
 *         "singlePaymentForDuration": {
 *           "count": 12,
 *           "unit": "MONTH"
 *         }
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "simple-plan",
 *       "termsAndConditions": "I agree to refrain from sharing any of the exclusive content with non-members"
 *     }
 *   ]
 * }
 */
```

### List plans with options
```javascript
import { plans } from '@wix/pricing-plans';

/* Sample options value:
 * {
 *   public: 'HIDDEN',
 *   archived: 'ARCHIVED_AND_ACTIVE'
 * }
 */

export async function myListPlansFunction(options) {
  try {
    const plansList = await plans.listPlans(options);

    return plansList;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "pagingMetadata": {
 *     "count": 4,
 *     "offset": 0,
 *     "total": 4
 *   },
 *   "plans": [
 *     {
 *       "_createdDate": "2023-12-31T11:23:01.664Z",
 *       "_id": "1421abaa-44c7-42ae-8a75-960fe7a8aa55",
 *       "_updatedDate": "2024-01-08T11:24:18.561Z",
 *       "allowFutureStartDate": false,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "Free Plan",
 *       "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 0,
 *       "name": "Basic",
 *       "perks": {
 *         "values": []
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "EUR",
 *           "value": "0"
 *         },
 *         "singlePaymentForDuration": {
 *           "count": 3,
 *           "unit": "MONTH"
 *         }
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "basic",
 *       "termsAndConditions": "After 90 day free trial ends, your plan will end and you will need to purchase a paid plan."
 *     },
 *     {
 *       "_createdDate": "2024-01-04T12:28:21.004Z",
 *       "_id": "97033d3e-b0ad-47d7-932c-197371aab9ec",
 *       "_updatedDate": "2024-01-04T14:11:39.860Z",
 *       "allowFutureStartDate": true,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "Gold membership to the MyGame World of Online Gaming",
 *       "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 1,
 *       "name": "Gold",
 *       "perks": {
 *         "values": [
 *           "Multiplayer",
 *           "Multiple devices",
 *           "No ads",
 *           "Unlimited access"
 *         ]
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "USD",
 *           "value": "10.00"
 *         },
 *         "singlePaymentUnlimited": true
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "gold",
 *       "termsAndConditions": "No sharing access with others!"
 *     },
 *     {
 *       "_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",
 *       "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!"
 *     },
 *     {
 *       "_createdDate": "2024-01-07T07:13:04.076Z",
 *       "_id": "0b9a1993-c1ff-4952-9575-915b48d1a5e0",
 *       "_updatedDate": "2024-01-09T12:32:26.807Z",
 *       "allowFutureStartDate": false,
 *       "archived": true,
 *       "buyerCanCancel": true,
 *       "description": "For new users just getting the feel of the product",
 *       "hasOrders": false,
 *       "maxPurchasesPerBuyer": 0,
 *       "name": "Simple Plan",
 *       "perks": {
 *         "values": [
 *           "Login member access",
 *           "Access to real-time articles",
 *           "Included in mailing list"
 *         ]
 *       },
 *       "pricing": {
 *         "price": {
 *           "currency": "USD",
 *           "value": "3"
 *         },
 *         "singlePaymentForDuration": {
 *           "count": 12,
 *           "unit": "MONTH"
 *         }
 *       },
 *       "primary": false,
 *       "public": false,
 *       "slug": "simple-plan",
 *       "termsAndConditions": "I agree to refrain from sharing any of the exclusive content with non-members"
 *     }
 *   ]
 * }
 */
```

### List all plans (with elevated permissions)
```javascript
import { plans } from '@wix/pricing-plans';
import { auth } from '@wix/essentials';

export async function myListPlansFunction() {
  try {
    const elevatedListPlans = auth.elevate(plans.listPlans);
    const plansList = await elevatedListPlans();

    return plansList;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "pagingMetadata": {
 *     "count": 4,
 *     "offset": 0,
 *     "total": 4
 *   },
 *   "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"
 *         ]
 *       },
 *       "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!"
 *     }
 *   ]
 *  }  
 */
```

### List all plans
```javascript
import { plans } from '@wix/pricing-plans';

export async function myListPlansFunction() {
  try {
    const plansList = await plans.listPlans();

    return plansList;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to:
 * {
 *   "pagingMetadata": {
 *     "count": 4,
 *     "offset": 0,
 *     "total": 4
 *   },
 *   "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"
 *         ]
 *       },
 *       "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!"
 *     }
 *   ]
 *  }  
 */
```

### listPlans (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { plans } from '@wix/pricing-plans';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { plans },
  // Include the auth strategy and host as relevant
});


async function listPlans(options) {
  const response = await myWixClient.plans.listPlans(options);
};
```

---