> 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/query-plans.md Planned removal date: 2025-12-31.

# QueryPublicPlans

# Package: pricingPlans

# Namespace: PlansServiceV2

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

## Permission Scopes:
Read Orders: SCOPE.DC-PAIDPLANS.READ-ORDERS

## Introduction

Retrieves a list of up to 1,000 public pricing plans, given the provided pagination, sorting, and filtering.

---

## REST API

### Schema

```
 Method: queryPublicPlans
 Description: Retrieves a list of up to 1,000 public pricing plans, given the provided pagination, sorting, and filtering.
 URL: https://www.wixapis.com/pricing-plans/v2/plans/public/query
 Method: POST
 Method parameters:
   param name: query | type: QueryV2    
        - name: filter | type: object | description: A filter object.  
        - name: sort | type: array<Sorting> | description: Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}].  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
        - name: paging | type: Paging | description: Pointer to page of results using offset. Can't be used together with 'cursorPaging'.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
           - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: slug | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: primary | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryPublicPlansResponse
  - name: plans | type: array<PublicPlan> | description: List of public pricing plans that match the specified query.  
     - name: id | type: string | description: Plan GUID.  | 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: What is included with this plan (for example, 1 weekly entrance to a specific class).  
        - 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: primary | type: boolean | description: Whether the plan is marked as primary.  
     - name: createdDate | type: string | description: Date plan was created.  | validation: format date-time
     - name: updatedDate | type: string | description: Date plan was last updated.  | validation: format date-time
     - name: slug | type: string | description: URL-friendly version of plan name. Unique across all plans in the same site.  | validation: minLength 1
     - name: maxPurchasesPerBuyer | type: integer | description: Number of times the same buyer can purchase the plan. An empty value or a value of 0 means no limitation.  | validation: minimum 0, 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.  
     - name: termsAndConditions | type: string | description: Any terms and conditions that apply to the plan. This information is displayed during checkout.  
     - 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: PAGING_LIMIT_OUT_OF_RANGE | Description: The paging limit cannot exceed 1000.
   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

### QueryPublicPlans
```curl
~~~cURL
curl -X POST \
  https://www.wixapis.com/pricing-plans/v2/plans/public/query
  --data-binary '{
        "query": {
            "paging" : {
                "offset": 0,
                "limit": 1
            },
             "sort": [
                {
                    "fieldName": "createdDate",
                    "order": "DESC"
                 }
             ],
            "filter": {
                "id": {
                    "$ne": "ee187a1b-...-9f7a-936f2cd9d100"
                }
            }
        }
   }'
  -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.pricingPlans.plans.queryPublicPlans(query)
 Description: Retrieves a list of up to 1,000 public pricing plans, given the provided pagination, sorting, and filtering.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: PlanQuery   | required: true 
        - name: filter | type: object | description: A filter object.  
        - name: sort | type: array<Sorting> | description: Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}].  
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
        - name: paging | type: Paging | description: Pointer to page of results using offset. Can't be used together with 'cursorPaging'.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
           - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: slug | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: primary | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryPublicPlansResponse>
  - name: plans | type: array<PublicPlan> | description: List of public pricing plans that match the specified query.  
     - name: _id | type: string | description: Plan GUID.  | 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: What is included with this plan (for example, 1 weekly entrance to a specific class).  
        - 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: primary | type: boolean | description: Whether the plan is marked as primary.  
     - name: _createdDate | type: Date | description: Date plan was created.  
     - name: _updatedDate | type: Date | description: Date plan was last updated.  
     - name: slug | type: string | description: URL-friendly version of plan name. Unique across all plans in the same site.  | validation: minLength 1
     - name: maxPurchasesPerBuyer | type: integer | description: Number of times the same buyer can purchase the plan. An empty value or a value of 0 means no limitation.  | validation: minimum 0, 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.  
     - name: termsAndConditions | type: string | description: Any terms and conditions that apply to the plan. This information is displayed during checkout.  
     - 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: PAGING_LIMIT_OUT_OF_RANGE | Description: The paging limit cannot exceed 1000.
   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

### Build and execute a query for a specific plan ID given its slug
```javascript
import { plans } from '@wix/pricing-plans';

export async function myQueryPublicPlansFunction4() {
  try {
    const results = 
      await plans.queryPublicPlans()
      .eq('slug','basic-plan-monthly-subscription')
      .find();
    const planId = results.items[0]._id;

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

/* Returned item: '7a3375ce-18a9-42cb-8e39-47918ade45ec' */
```

### Build and execute query to retrieve primary plan
```javascript
import { plans } from '@wix/pricing-plans';

export async function myQueryPublicPlansFunction() {
  try {
    const results = 
      await plans.queryPublicPlans()
      .eq('primary', true)
      .find();
    const primaryPlan = results.items[0];

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

/* Returned item:
 * {
 *   "_createdDate": "2024-01-07T07:28:42.863Z",
 *   "_id": "838f2c9d-c8d0-4799-a10a-e2f23849db10",
 *   "_updatedDate": "2024-01-16T12:19:54.617Z",
 *   "allowFutureStartDate": false,
 *   "buyerCanCancel": true,
 *   "description": "Complete with all features. One month free trial.",
 *   "maxPurchasesPerBuyer": 0,
 *   "perks": {
 *     "values": [
 *       "Unlimited video library streaming access",
 *       "File sharing enabled for all channels"
 *     ]
 *   },
 *   "primary": true,
 *   "pricing": {
 *     "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."
 * }
 */
```

### Build and execute a query to find all public plans
```javascript
import { plans } from '@wix/pricing-plans';

export async function myQueryPublicPlansFunction() {
  try {
    const results = await plans.queryPublicPlans().find();
    const items = results.items;
    const firstItem = items[0];
    const length = results.length;
    const currentPage = results.currentPage;

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

/* Returned items:
 * [
 *   {
 *     "_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",
 *     "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"
 *       },
 *       "subscription": {
 *         "cycleCount": 12,
 *         "cycleDuration": {
 *           "count": 1,
 *           "unit": "MONTH"
 *         }
 *       }
 *     },
 *     "slug": "basic-plan-monthly-subscription",
 *     "termsAndConditions": ""
 *   },
 *   {
 *     "_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",
 *     "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"
 *       },
 *       "subscription": {
 *         "cycleCount": 2,
 *         "cycleDuration": {
 *           "count": 1,
 *           "unit": "YEAR"
 *         }
 *       }
 *     },
 *     "slug": "beginners-plan",
 *     "termsAndConditions": ""
 *   },
 *   {
 *     "_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.",
 *     "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: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",
 *     "hasOrders": false,
 *     "maxPurchasesPerBuyer": 0,
 *     "name": "Premium Plan - Lifetime Membership",
 *     "perks": {
 *       "values": [
 *         "Cloud drive and file upload services",
 *         "Unlimited video content access"
 *       ]
 *     },
 *     "primary": false,
 *     "pricing": {
 *       "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-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",
 *     "hasOrders": false,
 *     "maxPurchasesPerBuyer": 1,
 *     "name": "Silver Membership - Monthly",
 *     "perks": {
 *       "values": [
 *         "Full site access",
 *         "Full video access",
 *         "Consultation booking"
 *       ]
 *     },
 *     "primary": false,
 *     "pricing": {
 *       "currency": "EUR",
 *       "value": "100",
 *       "freeTrialDays": 14,
 *       "subscription": {
 *         "cycleCount": 0,
 *         "cycleDuration": {
 *           "count": 1,
 *           "unit": "MONTH"
 *         }
 *       }
 *     },
 *     "slug": "silver-membership-monthly",
 *     "termsAndConditions": ""
 *   }
 * ]
 */
```

### queryPublicPlans (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 queryPublicPlans(query) {
  const response = await myWixClient.plans.queryPublicPlans(query);
};
```

---