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

# SetPlanVisibility

# Package: pricingPlans

# Namespace: PlansServiceV2

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

## Permission Scopes:
Manage Pricing Plans: SCOPE.DC-PAIDPLANS.MANAGE-PLANS

## Introduction

Sets visibility for pricing plans. Visible plans are considered public plans.
By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors can't choose them.
As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and can't be made active again.)
Changing a plan’s visibility doesn't impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.

---

## REST API

### Schema

```
 Method: setPlanVisibility
 Description: Sets visibility for pricing plans. Visible plans are considered public plans. By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors can't choose them. As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and can't be made active again.) Changing a plan’s visibility doesn't impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.
 URL: https://www.wixapis.com/pricing-plans/v2/plans/{id}/visibility
 Method: PUT
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  visible
 Method parameters: 
   param name: visible | type: visible | description: Whether a plan is visible to members and site visitors. Updates the `public` field. | required: true 
 Return type: SetPlanVisibilityResponse
  - name: plan | type: Plan | description: Pricing plan.  
     - 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

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: set_visibility_not_supported | Description: Cannot change plan's visibility because it is archived.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: plan_not_found | Description: Pricing plan was not found.
   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

### SetPlanVisibility
```curl
~~~cURL
curl -X PATCH \
  https://www.wixapis.com/pricing-plans/v2/plans/890016b7-...-a545-681e7d28fc00/visibility
  --data-binary '{"visible": false}'
  -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.pricingPlans.plans.setPlanVisibility(_id, visible)
 Description: Sets visibility for pricing plans. Visible plans are considered public plans. By default, pricing plans are public, meaning they are visible. Plans can be hidden so that site members and visitors can't choose them. As opposed to archiving, setting visibility can be reversed. This means that a public plan can be hidden, and a hidden plan can be made public (visible). (An archived plan always remains archived and can't be made active again.) Changing a plan’s visibility doesn't impact existing orders for the plan. All orders for hidden plans are still active and keep their perks.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  _id, visible
 Method parameters: 
   param name: _id | type: string | description: The GUID of the plan to either display or hide on the site page.  | required: true | validation: format GUID
   param name: visible | type: boolean | description: Whether a plan is visible to members and site visitors. Updates the `public` field. | required: true 
 Return type: PROMISE<SetPlanVisibilityResponse>
  - name: plan | type: Plan | description: Pricing plan.  
     - 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

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: set_visibility_not_supported | Description: Cannot change plan's visibility because it is archived.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: plan_not_found | Description: Pricing plan was not found.
   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

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

/* Sample _id value: 'cb4a8c57-273a-4567-94e3-cc43d5d339f2'
* 
* Sample visible value: false
*/

const elevatedSetPlanVisibility = auth.elevate(plans.setPlanVisibility);

export async function mySetPlanVisibilityFunction(_id, visible) {
  try {
    const hiddenPlan = elevatedSetPlanVisibility(_id, visible);

    return hiddenPlan;
  } catch(error) {
    console.error(error);
    // Handle the error
  }
}
  
/* Promise resolves to:
 * {
 *   "plan": {
 *     "_createdDate": "2024-01-07T07:10:30.074Z",
 *     "_id": "cb4a8c57-273a-4567-94e3-cc43d5d339f2",
 *     "_updatedDate": "2024-01-14T09:29:12.581Z",
 *     "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"
 *       },
 *       "subscription": {
 *         "cycleCount": 2,
 *         "cycleDuration": {
 *           "count": 1,
 *           "unit": "YEAR"
 *         }
 *       }
 *     },
 *     "public": false,
 *     "slug": "beginners-plan",
 *     "termsAndConditions": ""
 *   }
 * }
 */
```

### Hide a plan
```javascript
import { plans } from '@wix/pricing-plans';

/* Sample _id value: 'cb4a8c57-273a-4567-94e3-cc43d5d339f2'
 * 
 * Sample visible value: false
 */

export async function mySetPlanVisibilityFunction(_id, visible) {
  try {
    const hiddenPlan = plans.setPlanVisibility(_id,visible);

    return hiddenPlan;
  } catch(error) {
    console.error(error);
    // Handle the error
  }
}
  
/* Promise resolves to:
 * {
 *   "plan": {
 *     "_createdDate": "2024-01-07T07:10:30.074Z",
 *     "_id": "cb4a8c57-273a-4567-94e3-cc43d5d339f2",
 *     "_updatedDate": "2024-01-14T09:29:12.581Z",
 *     "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"
 *       },
 *       "subscription": {
 *         "cycleCount": 2,
 *         "cycleDuration": {
 *           "count": 1,
 *           "unit": "YEAR"
 *         }
 *       }
 *     },
 *     "public": false,
 *     "slug": "beginners-plan",
 *     "termsAndConditions": ""
 *   }
 * }
 */ 
```

### setPlanVisibility (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 setPlanVisibility(_id,visible) {
  const response = await myWixClient.plans.setPlanVisibility(_id,visible);
};
```

---