> 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: Introduction

## Article: Introduction

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

## Article Content:

# About the Blog Paywall API

A paywall is the content a blog shows to visitors who don't have access to a post,
typically a short message and a call to action in place of the post body.

The API is built from 2 entities:

- **Paywall template**: Reusable paywall content in the site's template library.
  A template is authored once per language and can be used by any number of posts.
- **Post paywall**: The paywall content of a single post. It either references a
  paywall template from the library, or holds rich content of its own that
  applies to that post only.

That distinction decides what happens when a template is edited.
A post that references a template reflects every later edit to it.
A post with content of its own doesn't, because that content is a copy with no further ties
to the template it was based on.

With the Blog Paywall API, your app can:

- Create, update, and delete paywall templates in the site's library.
- Retrieve library templates by ID, or list them by language.
- Point a post at a library template, or give the post paywall content of its own.
- Retrieve the content to show on a post without having to know where it comes from.
- Retrieve the global default template for a language.

## Before you begin

It's important to note the following points before starting to code:

- A post is identified by both `postId` and `postFqdn`, because a draft post
  and the published post it produces share an ID.
  `postFqdn` is `wix.blog.v4.draft_post` for a [draft post](https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/introduction.md)
  and `wix.blog.v4.post` for a [published post](https://dev.wix.com/docs/api-reference/business-solutions/blog/posts/introduction.md),
  and the 2 have separate post paywalls.
- Set and delete a post's paywall on the draft post, with `postFqdn` set to `wix.blog.v4.draft_post`.
  When the post is published, the draft post's paywall is copied to the published post.
  If the draft post has no paywall, the published post's paywall is deleted.
  Changes made directly to a published post's paywall are overwritten the next time the post is published or updated.
- A post paywall has either `paywallTemplateId` or `richContent`.
  Setting one clears the other, so replacing a post's own content with a template
  reference discards that content.
- Each post has at most 1 post paywall, so
  [Upsert Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/upsert-post-paywall.md) creates or replaces it and you
  don't need to check whether one already exists.
- A post with no post paywall shows the global default template for its language.
  Don't point a post at the default template explicitly. It has the same effect,
  and the default isn't part of the site's own data.
  To put a post back on the default, call [Delete Post Paywall](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/post-paywall-v1/delete-post-paywall.md).
- Every library template belongs to exactly 1 language.
  `language` is set when the template is created and can't be changed afterwards.
  To offer a paywall in another language, create another template.
  [List Paywall Templates](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/paywall-template-v1/list-paywall-templates.md)
  matches the language exactly, so `en-US` doesn't return templates saved as `en`.
- Global default templates aren't part of the site's template library.
  They aren't returned by List Paywall Templates and can't be updated or deleted.
  To retrieve one, 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).
- Deleting a template doesn't update the posts that use it.
  Those posts show the global default template for their language until you assign them another template.
- `richContent` uses the [Wix Rich Content](https://dev.wix.com/docs/rest/business-solutions/ricos/rich-content/introduction.md)
  (Ricos) format, the same format the blog post editor produces.
  Paywall content is always a single `LAYOUT` node whose `layoutData.banner.position` is
  `PAYWALL`. What visitors see is the content of that node's `LAYOUT_CELL`,
  typically a heading, a message, and a call-to-action button.
- List methods return up to 100 items per request.
  Use cursor paging to retrieve more.

## Use cases

- [Show a post's paywall to a visitor](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/sample-flows.md#show-a-posts-paywall-to-a-visitor)
- [Let a site owner pick a paywall template for a post](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/sample-flows.md#let-a-site-owner-pick-a-paywall-template-for-a-post)
- [Let a site owner customize the paywall of a single post](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/sample-flows.md#let-a-site-owner-customize-the-paywall-of-a-single-post)
- [Offer a branded paywall in another language](https://dev.wix.com/docs/api-reference/business-solutions/blog/post-paywall/sample-flows.md#offer-a-branded-paywall-in-another-language)

## Terminology

- **Paywall**: The content shown in place of a post body to a visitor without
  access to the post.
- **Paywall template**: Reusable paywall content in the site's library.
  Editing one updates every post that references it.
- **Post paywall**: The paywall content of a single post. Either a reference to a
  paywall template, or content of the post's own.
- **Post FQDN**: Distinguishes a draft post (`wix.blog.v4.draft_post`) from a
  published one (`wix.blog.v4.post`), since they share an ID.
- **Default paywall template**: The global template provided for a language,
  used when a post has no paywall of its own.

