> 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

# Method name: setPlanVisibility(id: string, visible: boolean)

# Method package: wixPricingPlansBackend

# Method menu location: wixPricingPlansBackend --> setPlanVisibility

# Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-backend/set-plan-visibility.md

# Method Description:

Sets visibility for non-archived pricing plans. Public plans are plans that are set to visible.

The `setPlanVisibility()` function returns a Promise that resolves to a pricing plan when its 
 visibility has successfully been set.

 By default, pricing plans are public, meaning they are visible. [Plans can be hidden](https://support.wix.com/en/article/pricing-plans-removing-a-plan-from-your-site#hiding-plans) 
 so that site members and visitors cannot see or 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). 

 >**Note:** An archived plan always remains archived and cannot be made active again. When archiving 
 > a plan, its `visibility` property is automatically set to `false` so that it is hidden.

 Changing a plan’s visibility does not impact existing orders for the plan. All orders for hidden plans are still active and keep their terms and payment options.

 Only users with "Manage Pricing Plans" [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can change plan visibility.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Hide a plan

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import wixPricingPlansBackend from 'wix-pricing-plans-backend';

export const mySetPlanVisibilityFunction = webMethod(Permissions.Anyone, () => {
    const planId = '3743d382-a4d4-7e15-ada5-340ad4b5d760';
    const visibilityToggle = false;
    return wixPricingPlansBackend.setPlanVisibility(planId, visibilityToggle)
      .then(() => {
        console.log("Plan hidden");  // Plan is visible in the Dashboard
      })
      .catch((error) => {
        console.error(error);
      });
  });
  
/* Full event object:
 * {
 *   "metadata": {
 *     "id": "3743d382-a4d4-7e15-ada5-340ad4b5d760",
 *     "entityId": "c61bbc26-a4d4-7e15-ada5-f99803abce33",
 *     "eventTime": "2020-02-03T10:13:15.194Z",
 *     "triggeredByAnonymizeRequest": false
 *   },
 *   "entity": {
 *     "_id": "c61bbc26-a4d4-7e15-ada5-f99803abce33",
 *     "name": "Full membership",
 *     "description":"Full membership including weekends",
 *     "perks": [
 *        "Free parking",
 *        "Express line"
 *     ],
 *     "pricing": {
 *        "singlePaymentUnlimited": true,
 *        "price": {
 *           "value": "40",
 *           "currency": "USD"
 *        }
 *     },
 *     "public" : true,
 *     "_createdDate": "2020-02-03T10:13:15.194Z",
 *     "_updatedDate": "2020-02-03T10:13:15.194Z",
 *     "slug":"full-membership",
 *     "maxPurchasesPerBuyer": 1,
 *     "allowFutureStartDate": false,
 *     "buyerCanCancel": true,
 *     "termsAndConditions": "Copyright laws apply."
 *   }
 * }
 */
```

---