> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/access-groups/sample-flows.md

## Article Content:

# Access Groups: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Show which pricing plans unlock a members-only page

When a site visitor opens a page that's protected by pricing plans, you can show the plans that grant access to the page, so the visitor knows which plan to buy.

To show which pricing plans unlock a members-only page:

1. Retrieve the ID of the members-only page from the site's frontend. Page IDs aren't GUIDs. For example, `"c1dmp"`.
1. Call [List Groups By Resource](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/access-groups/list-groups-by-resource.md) on behalf of the site visitor or member. Specify the page ID as `resourceId` and `"plan"` as `type`. For example, `?type=plan`.
1. Save the `id` of each returned group. For groups of type `"plan"`, the group ID is the pricing plan ID. If `pagingMetadata.hasNext` is `true`, call [List Groups By Resource](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/access-groups/list-groups-by-resource.md) again with `paging.cursor` set to `pagingMetadata.cursors.next` to retrieve the remaining groups.
1. Retrieve the details of these plans, such as their names and prices, from the Pricing Plans API.
1. Display the plans on the page, with a link to purchase each plan.

## Confirm a member's access after a plan purchase

After a site member buys a pricing plan, you can check whether the member belongs to the plan's group before you show the plan's content.

To confirm a member's access after a plan purchase:

1. Save the ID of the pricing plan that the member bought.
1. Call [List Current Member Groups](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/access-groups/list-current-member-groups.md) on behalf of the logged-in site member, with `"plan"` as `type`. For example, `?type=plan`.
1. Check whether the `id` of any returned group matches the plan ID. If none matches and `pagingMetadata.hasNext` is `true`, call [List Current Member Groups](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/access-groups/list-current-member-groups.md) again with `paging.cursor` set to `pagingMetadata.cursors.next`, and check the next page.
1. If a returned group matches the plan ID, show the member the plan's content, for example by reloading the members-only page. If no group on any page matches, show the member a message that their access isn't active.