> 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/e-commerce/purchase-flow/checkout/checkout-templates/sample-flows.md

## Article Content:

# Checkout Templates: Sample Use Case & Flow
This article shares some possible use cases your app could support, as well as an sample flow that could support each
use case. This can be a helpful jumping off point as you plan your app's implementation.

## Run a flash sale through social media
Offer a sale to customers through social media channels that runs for a limited time only. Create the checkout template and pull the URL to automatically redirect anyone that clicks on the link to a checkout page with the offer. When the period for the sale is complete, update the checkout template's `status` to `INACTIVE` to turn it off.

To create and share the offer:

1. Use [Create Checkout Template](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout-templates/create-checkout-template.md) with the product and coupon information for offer.
2. Use the `checkoutTemplateId` to build the URL to share with customers. Build the URL in this format: `https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout?siteId={siteId}`.
3. Post and share the URL to customers.

To turn off the offer at the end of the sale:

1. Use [Update Checkout Template](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout-templates/update-checkout-template.md) to update `checkoutTemplate.status` to `INACTIVE`.

## Limit the number of checkouts for a specific coupon
Offer a sale to the first 100 customers that click on an offer. Create a checkout template, then share your own custom link that will run custom logic before creating a new checkout for the customer.

Create a checkout template and add your own custom logic:

1. Use [Create Checkout Template](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout-templates/create-checkout-template.md) with the product and coupon information for offer.
2. Create a bank of all new checkouts for this sale by collecting the `checkoutId`s of checkouts created from this `checkoutTemplateId`.
3. Before a new checkout is created with the `checkoutTemplateId`, check the bank and count the number of `checkoutId`s being stored.
4. Once the count hits `100` checkouts, use [Update Checkout Template](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/checkout/checkout-templates/update-checkout-template.md) to update `checkoutTemplate.status` to `INACTIVE`.