> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/sample-flows.md

## Article Content:

# Blog Paywall: 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 a post's paywall to a visitor

A visitor without access opens a post, and your app needs the paywall content to show in place
of the post body. The post may use a library template, have content of its own, or have no paywall set at all.

To show a post's paywall:

1. Call [Get Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/get-post-paywall.md) with the post's ID, `wix.blog.v4.post` as the post FQDN,
   and the post's language:

    ```
    GET /v1/post-paywalls/wix.blog.v4.post/{postId}?language=en
    ```

2. Render the `richContent` from the response in place of the post body.

## Let a site owner pick a paywall template for a post

When a site owner adds a paywall to a post, they choose from the templates in the site's library.

To let a site owner pick a template:

1. Call [List Paywall Templates](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/paywall-template-v1/list-paywall-templates.md) to retrieve the library templates
   in the post's language:

    ```
    GET /v1/paywall-templates?language=en
    ```

2. Present the returned templates to the site owner.

3. Call [Upsert Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/upsert-post-paywall.md) with the chosen template on the draft post:

    ```json
    {
      "postPaywall": {
        "postId": "<POST_ID>",
        "postFqdn": "wix.blog.v4.draft_post",
        "paywallTemplateId": "<TEMPLATE_ID>"
      }
    }
    ```

    When the post is published, the published post gets the same paywall.
    The post reflects every later edit to the template.

## Let a site owner customize the paywall of a single post

A site owner editing the paywall from inside a post shouldn't change what other posts
using the same template show.

To let a site owner customize a single post's paywall:

1. Call [Get Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/get-post-paywall.md) with `wix.blog.v4.draft_post` as the post FQDN
   to retrieve the content the post currently shows, and open it in your editor.

2. When the site owner saves, call [Upsert Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/upsert-post-paywall.md) on the draft post
   with the edited content instead of a template reference.
   If the content started from a template, specify that template's ID in `basePaywallTemplateId`:

    ```json
    {
      "postPaywall": {
        "postId": "<POST_ID>",
        "postFqdn": "wix.blog.v4.draft_post",
        "richContent": { "nodes": [ "..." ] },
        "basePaywallTemplateId": "<TEMPLATE_ID>"
      }
    }
    ```

    Setting `richContent` clears `paywallTemplateId`, so the post no longer reflects edits to the template.

3. To make the post's content available to other posts, call
   [Create Paywall Template](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/paywall-template-v1/create-paywall-template.md) with it.

4. To return the post to the global default paywall, call [Delete Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/delete-post-paywall.md)
   on the draft post.

## Offer a branded paywall in another language

A multilingual blog shows the global default paywall to readers of posts in a language the site hasn't authored a template for.
The site owner wants a paywall that matches the site's branding instead.

To offer a branded paywall in another language:

1. Call [Get Default Paywall Template](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/paywall-template-v1/get-default-paywall-template.md)
   with the language to use the default content as a starting point:

    ```
    GET /v1/paywall-templates/default/es
    ```

2. Let the site owner edit the returned `richContent` in your editor.

3. Call [Create Paywall Template](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/paywall-template-v1/create-paywall-template.md)
   with the edited content and the language:

    ```json
    {
      "paywallTemplate": {
        "title": "Suscríbete",
        "language": "es",
        "richContent": { "nodes": [ "..." ] }
      }
    }
    ```

4. For each post in that language, call [Upsert Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/upsert-post-paywall.md)
   on the draft post with the new template's ID in `paywallTemplateId`.
   The published posts get the template the next time they're published or updated.