> 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/benefit-programs/items/sample-flows.md

## Article Content:

# Items API: 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.

## Offer rewards from your app as a benefit

Your app provides rewards that sites can include in their benefit programs. You want beneficiaries to be able to redeem any of a set of your rewards as part of a single benefit.

> **Prerequisite:** The site must have the Pricing Plans app and your app installed.

To offer rewards from your app as a benefit:

1. Call [Create Pool Definition](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definitions/create-pool-definition.md) with a benefit whose `providerAppId` is your app's ID. Save the benefit's `itemSetId` and the pool definition's `namespace` from the response.
1. Call [Bulk Create Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/items/bulk-create-items.md) with one item for each reward. For each item, specify the saved `itemSetId` and `namespace`, `providerAppId` set to your app's ID, and `externalId` set to the reward's ID in your app.

## Remove a discontinued reward from benefits

When your app stops offering a reward, remove it from every benefit that offers it, so beneficiaries can no longer redeem it.

To remove a discontinued reward from benefits:

1. Call [Query Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/items/query-items.md), filtering by the reward's ID in `externalId`, your app's ID in `providerAppId`, and your `namespace`. The response contains the item for each benefit that offers the reward.
1. Call [Bulk Delete Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/items/bulk-delete-items.md) with the IDs of the returned items.

## Keep item display names in sync

When your app renames a reward, update the display name of the items that reference it, so the name stays the same across your benefits.

To keep item display names in sync:

1. Call [Query Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/items/query-items.md), filtering by the reward's ID in `externalId`, your app's ID in `providerAppId`, and your `namespace`. Save each item's `id` and `revision`.
1. Call [Bulk Update Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/items/bulk-update-items.md) with the new `displayName`, and the saved `id` and `revision`, for each item.