> 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: Meta Catalog Sales Plan

## Article: Meta Catalog Sales Plan

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/stores/skills/meta-catalog-sales-plan.md

## Article Content:

# Meta Catalog Sales Plan

A plan for a store whose products already reach Instagram and Facebook through the Meta Catalog sales channel. It holds only what can be done for the owner through public Wix APIs, plus one link: the ad, which the owner creates on the Facebook & Instagram Ads page.

**Two facts shape the plan.**
- **There is no public API for the sales channel.** Nothing here can connect a store to Meta, read whether it is connected, or read what Meta turned down. Take the owner's word that the store is connected; the site's app list doesn't show it, so don't look for it there. The product check below grades each product against Meta's published rules, on Wix's side. Never tell the owner that Meta approved or rejected a product.
- **Every step is the owner's choice.** Offer the steps, run the one the owner picks, and change nothing until they approve the exact change.

## When to use

- The owner has connected their store to Meta and asks what to do next, how to sell more on Instagram or Facebook, or how to get their products seen there.
- The owner asks one step on its own ("check my products for Instagram", "set up cart reminders for my Instagram shoppers"): run that step only, with the reads it needs from [Reads](#reads), made as written there.

Not for:
- **Connecting the store to Meta.** No public API does it. Give the link to the Meta channel page, `https://manage.wix.com/dashboard/<siteId>/wix-stores/channel/meta`, and say the owner connects it there.
- A single social post with no plan around it: [Create and Publish a Social Media Post](https://dev.wix.com/docs/api-reference/business-management/marketing/skills/create-and-publish-a-social-media-post.md).
- An AI-planned content calendar across topics and content types: [Generate a Marketing Plan and Schedule Its Posts](https://dev.wix.com/docs/api-reference/business-management/marketing/skills/generate-a-marketing-plan-and-schedule-its-posts.md). This plan's posts are a few chosen best sellers, as one step of a channel plan.
- A store on Catalog V1: the product check and the posts read products through the Catalog V3 API, so say they need Catalog V3 and offer steps 3 to 5 only. Step 5 then gives the link without naming products.

## Flow

1. **Context.** [Read Account or Site Context](https://dev.wix.com/docs/api-reference/account-level/sites/skills/read-account-or-site-context.md) for the named site. Take `siteId`, the time zone, the currency and the Wix Stores line of the app list. No Wix Stores: say this plan is for stores and stop. The Wix Stores line shows "Catalog app version: V1" (`installedApps[].catalogVersion` is `V1` when the JSON endpoint was used): drop plan steps 1 and 2, say why, and skip the products read.
2. **Read once.** Make the four reads in [Reads](#reads), together when a tool can run them in one call. A failed read leaves out what it feeds and never stops the plan. A new store can answer the products read with `CATALOG_V3_SITE_PROVISIONING` while its catalog is still being set up: wait about ten seconds and read again, up to three times, before treating the read as failed.
3. **Write the note** from those reads ([The note](#the-note)).
4. **Show the plan:** the note, then the five steps as one numbered list in that order, each in one line, and how to start ("Reply with a number, or 'start' for the first one"). Use each step's line from [The plan](#the-plan) word for word, with nothing under it, and say nothing about whether a step suits the store yet: a step's caveats, such as a store with no past customers, come up only when the owner starts that step.
5. **Run the step the owner picks.** "Start" means step 1. Each step shows its result and asks for approval before any write. After a step, show the plan again and say which step is done.

## Reads

These four calls are verified as written, and each row links its method's reference page, the source to cite for the call. Make them as shown, without searching the docs or reading a method's schema, and in one call when a tool can run them together. The fields each read returns are in its last column. The products query returns every field the product check needs, so never read products one by one.

| Read | Call | Fields used |
|---|---|---|
| Products ([Query Products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/query-products.md)) | `POST https://www.wixapis.com/stores/v3/products/query` with `{"fields": ["PLAIN_DESCRIPTION", "MEDIA_ITEMS_INFO"], "query": {"cursorPaging": {"limit": 100}}}`, every page | `id`, `revision` (Query Products returns it on every product, checked on a Catalog V3 store on 2026-11-23; send it unchanged in that product's update. If a product ever comes back without one, read it with [Get Product](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/get-product.md), `GET https://www.wixapis.com/stores/v3/products/<productId>`, before its update), `name`, `slug`, `visible`, `productType`, `plainDescription` (HTML), `brand.name` (absent when none), `actualPriceRange.minValue.amount` (string), `media.main.image.{url, width, height}`, `media.itemsInfo.items[].{id, image.url, image.width, image.height}` (the first item is the main photo) |
| Orders, last 90 days ([Search Orders](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/search-orders.md)) | `POST https://www.wixapis.com/ecom/v1/orders/search` with `{"search": {"filter": {"purchasedDate": {"$gte": "<90 days ago, local midnight, UTC>"}}, "cursorPaging": {"limit": 100}}}`. While `metadata.hasNext` is `true`, send `{"search": {"cursorPaging": {"limit": 100, "cursor": "<metadata.cursors.next>"}}}`. Skip orders whose `status` is `CANCELED` | `status`; per line item, `lineItems[].catalogReference.catalogItemId` (the product's `id`) and `lineItems[].quantity`, added up per product for units sold; past customers from `buyerInfo.contactId` |
| Business ([Get Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties.md)) | `GET https://www.wixapis.com/site-properties/v4/properties` | `properties.businessName`, `properties.siteDisplayName`, `properties.description` |
| Customers by where they came from, last 90 days ([Query Semantic Model Data](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/query-semantic-model-data.md)) | List and Get the model first, then `POST https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/query-data`, as below | One row per source |

The last read, in the site's time zone (see [Query Site Analytics](https://dev.wix.com/docs/api-reference/business-management/analytics/skills/query-site-analytics.md) for how to set `interval`):

```json
{
  "semanticModelId": "<id of the sales model, from List Semantic Models>",
  "interval": { "start": "<90 days ago, local midnight, UTC>", "end": "<tomorrow, local midnight, UTC>", "timezone": "<site time zone>" },
  "fields": ["sales.referrer_source_name", "sales.customers_count"],
  "sort": { "fieldName": "sales.customers_count", "order": "DESC", "nullsLast": true },
  "paging": { "limit": 20 }
}
```

Find the model first, as [Query Site Analytics](https://dev.wix.com/docs/api-reference/business-management/analytics/skills/query-site-analytics.md) shows: [List Semantic Models](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/list-semantic-models.md) (`GET https://www.wixapis.com/analytics/semantic-model/v3/semantic-models`) and keep the `id` of the model whose `slug` is `sales`, then [Get Semantic Model](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/get-semantic-model.md) (`GET https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/<id>`) and check that `sales.referrer_source_name` and `sales.customers_count` are among its dimensions and measures. Use the ID and field names those calls return. After the query, check that both fields appear in `results[].fields`: a field that is missing was dropped, so the read failed, and it never means zero customers. With no `sales` model, a missing field or a failed read, the note uses no number. `sales.referrer_source_name` holds values such as `Instagram`, `Facebook`, `Google` or a referring domain. A visit counts toward its last source that was not direct, and Instagram's in-app browser sometimes hides the source, so the Instagram row is a floor, never an exact share.

## The note

Three sentences at most, before the steps. It says why Instagram and Facebook suit this business. It reads like someone who knows the shop, not like a report.

- Talk about the business: what it makes, who buys, how people find it. Take this from `properties.description`, the product descriptions and the best sellers.
- **Best sellers** are the products with the most units sold in the orders read. With no orders in the 90 days, use the visible physical products that have a photo, newest first (`createdDate`), and don't call them best sellers or say why they were picked. With no description either, the note says only what the product names show; it never guesses who the customers are.
- Tie one true thing about it to why Instagram and Facebook fit, and end with where to start, in the owner's terms: name a best seller.
- Use at most one number, and only one about the owner's own customers. The customers-by-source read supplies it when the Instagram or Facebook row has at least 5 customers: "40 of your customers in the last three months found you through Instagram." Below 5, or when the read failed, use no number.
- Never list problems or counts of products that fail (those are the steps), never say the store has had no orders, sales or customers ("no orders in the last three months"), never explain how the channel works, never promise results, and say nothing that was not read in this session. No follower counts: no public API returns them.

Example: "Your glazes are the kind of thing people stop scrolling for, and 40 of your customers in the last three months already found you through Instagram. Now they can buy what they see there without going looking for it. I'd start with the speckled mugs, your best seller."

## The plan

| # | The line the owner reads | What happens |
|---|---|---|
| 1 | Check that all your products fit Meta's rules | [Step 1](#step-1-check-the-products-against-metas-rules) |
| 2 | Schedule 2 weeks of Instagram and Facebook posts from your products | [Step 2](#step-2-schedule-two-weeks-of-posts) |
| 3 | Email your customers a discount code for your Instagram shop | [Step 3](#step-3-email-past-customers-a-discount-code) |
| 4 | Turn on cart reminders for customers who leave without buying | [Step 4](#step-4-turn-on-cart-reminders) |
| 5 | Run a sales ad with Facebook & Instagram Ads with Wix | [Step 5](#step-5-open-facebook--instagram-ads-with-wix) |

The ad comes last: an ad on products Meta can't show wastes money. When the owner picks step 5 while step 1 has not run, run step 1's check first and say how many products the ad could show.

### Step 1: Check the products against Meta's rules

Grade every product with `visible: true` from the products read against these rules. They follow [Meta's product data specifications](https://www.facebook.com/business/help/120325381656392).

| Rule | Passes when | When it fails |
|---|---|---|
| Physical product | `productType` is `PHYSICAL` | Leave it out. Meta doesn't take digital products. Nothing to fix; say so in one line |
| Price | `actualPriceRange.minValue.amount` above 0 | Ask the owner for the price. Never invent one |
| Photo | `media.main.image` is set, and its `width` and `height` are both at least 500 px | When another item in `media.itemsInfo.items` is an image of at least 500 by 500 px, move it to the front (the first item is the main photo). Otherwise ask the owner for a photo of the product (a larger one when it has only a small one) |
| Title | `name` has 1 to 200 characters | Shorten it to 200 characters or fewer, keeping the words people search for |
| Description | `plainDescription`, with tags stripped, has at least 20 characters and is not the template's placeholder (text that starts with "I'm a product description" or contains "I'm a great place to add more details") | Write one from the product's name, its options and `properties.description`, two or three sentences, in the store's language. Never copy the placeholder |
| Brand | `brand` is set | Use `properties.businessName`. When it is empty, ask the owner for the brand name, suggesting `properties.siteDisplayName` unless it is a default name such as "My Site 12" |

Report the result before any write: how many products fit, and the fixes as one list, grouped by kind ("7 products need a fix: 4 descriptions, 2 photos, 1 brand"), each with the product's name and the exact change. A fix that applies to most products is one line, not one per product: "No product has a brand. I'll set it to Clay Play on all 15." For descriptions, show the first two written in full and the rest by name, taking products in the order the note uses: best sellers first, or the newest products (`createdDate`) when there are no orders. Missing prices and photos the owner must supply go below the list as questions. Ask once to save the fixes, with a way to say no ("Reply 'save all', the numbers to save, or 'none'"). When the owner's message already names fixes and says to save them ("set the brand to Fern & Clay and save it"), that is the approval for exactly those: run the check, save only those fixes, and ask about the rest.

Apply only the approved fixes, one product at a time, each with the product's current `revision` (a failed update leaves the product as it was; read it again and retry once):

- **Brand.** Get the brand's ID once with [Get Or Create Brand](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/get-or-create-brand.md), `POST https://www.wixapis.com/stores/v3/brands/get-or-create` with `{"brandName": "<business name>"}`, and take `brand.id`. Then, per product:

  ```json
  PATCH https://www.wixapis.com/stores/v3/products/<productId>
  { "product": { "id": "<productId>", "revision": "<revision>", "brand": { "id": "<brandId>" } } }
  ```

- **Description.** Send `plainDescription` as HTML, which replaces the whole description (do this only for products whose description failed the rule):

  ```json
  PATCH https://www.wixapis.com/stores/v3/products/<productId>
  { "product": { "id": "<productId>", "revision": "<revision>", "plainDescription": "<p>Wheel-thrown stoneware mug with a speckled glaze. Holds 350 ml and is dishwasher safe.</p>" } }
  ```

- **Title.** The same call with `"name": "<shortened title>"`.
- **Photo.** Send `media.itemsInfo.items` with every existing item, each by its `id`, the larger photo first. The array replaces the gallery, so an item left out is removed. See Update Media Only in [Update Product with Options](https://dev.wix.com/docs/api-reference/business-solutions/stores/skills/update-product-with-options-catalog-v3.md).

A fix changes the product on the site too, so the site and Instagram show the same product. After the writes, say what changed in one line per kind, and that Meta picks up the changes on its next catalog update.

### Step 2: Schedule two weeks of posts

Run [Create and Publish a Social Media Post](https://dev.wix.com/docs/api-reference/business-management/marketing/skills/create-and-publish-a-social-media-post.md) once per product, with both channels in the same run (one post-data call returns a payload for each channel, and the run then makes one item per channel), so four products take four runs and make eight items. The plan answers its first questions: the channels are `INSTAGRAM` and `FACEBOOK`, the subject is a product, the text is generated from that product as a site asset, and the image is the product's main photo.

- Take the four best sellers ([The note](#the-note) says what counts as one) that pass step 1. With fewer than four, use the products that pass. When step 1 hasn't run, grade the candidates first and skip any that fail.
- Plan two posts a week for two weeks, one product each, on both channels: eight items. Spread them on different weekdays at 10:00 in the site's time zone, starting tomorrow.
- Check the plan before writing any post (STEP 5 of that recipe, `GET https://www.wixapis.com/social-publisher/v1/features?featureTypes=PUBLISH_POST&featureTypes=SCHEDULE_POST`). When `SCHEDULE_POST` is off, say scheduling needs a Social Media Marketing plan, and offer to publish the first post now instead. When the remaining quota is below eight, plan only as many posts as it allows.
- Show all the posts with their images, channels and dates in one message, and ask once to schedule them. Then create and schedule each one as that recipe's STEP 6 and STEP 7 show. Every `scheduledDate` must be in the future when it is sent.

Not connected to Instagram or Facebook in Social Media Marketing: follow STEP 4c of that recipe for the one that's missing, then continue.

### Step 3: Email past customers a discount code

1. **Propose the offer** in one message: 10% off the whole store, one use per customer, a short code (for example `IGSHOP10`), ending 30 days from today. Ask the owner to approve it or change it.
2. **Create the coupon** as [Pricing: Create Coupon](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-coupon.md) shows: its Step 1 checks first for a code already in use, then `POST https://www.wixapis.com/stores/v2/coupons` with `percentOffRate`, `scope: {"namespace": "stores"}`, `startTime`, `expirationTime`, `limitPerCustomer: 1` and `active: true`.
3. **Draft the email.** Subject and body in the owner's voice, short: the shop is now on Instagram and Facebook, the code and when it ends, and a button to the store's site. Create it as a draft, which sends nothing:

   ```json
   POST https://www.wixapis.com/email-marketing/v1/campaigns
   {
     "composer": { "composerDataJson": "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Our mugs are on Instagram now. Use IGSHOP10 for 10% off until December 16.</mj-text><mj-button href='<site URL>'>Shop now</mj-button></mj-column></mj-section></mj-body></mjml>\"}" },
     "campaignEditorType": { "value": "MJML" },
     "emailSubject": "We're on Instagram, with 10% off for you"
   }
   ```

   Take `campaign.campaignId`. The `mjml` value is a JSON string inside a JSON string: keep attribute values in single quotes so they need no escaping.
4. **The audience** is the past customers from the orders read: the distinct `buyerInfo.contactId` values. No past customers: say so, keep the coupon and the draft, and stop.
5. **Ask to send**, naming the subject, how many customers it goes to, and when ("now", or a date and time in the site's time zone). Check `GET https://www.wixapis.com/email-marketing/v1/account-details` first: `accountDetails.status` other than `ACTIVE` blocks sending, so give the campaigns link instead. Send only after a yes to that question:

   ```json
   POST https://www.wixapis.com/email-marketing/v1/campaigns/<campaignId>/publish
   { "emailDistributionOptions": { "emailSubject": "We're on Instagram, with 10% off for you", "contactIds": ["<contactId>", "<contactId>"], "activeContactsOnly": true } }
   ```

   Never publish without `emailDistributionOptions`: that turns the campaign into a web page that can never be emailed. A sent email can't be taken back, so say so in the question. More on sending: Step 5 of [Review and Send Email Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/skills/review-and-send-email-campaigns.md).

Orders that use the code later show which sales the Instagram push brought.

### Step 4: Turn on cart reminders

Customers who tap through from Instagram or Facebook buy on the store's own checkout, so a cart they leave is the store's to recover.

1. Find the abandoned-cart automation: `POST https://www.wixapis.com/automations-service/v2/automations/query` with `{"query": {"cursorPaging": {"limit": 100}}}`, and look for `configuration.trigger.triggerKey` equal to `wix_e_commerce-cart_abandonment`. That is the "Checkout abandoned" trigger of Wix eCommerce (`appId` `1380b703-ce81-ff05-f115-39571d94dfcd`), confirmed with Resolve Triggers on a store on 2026-11-23. Before building a new automation, confirm it the same way, as [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations.md) shows; if Resolve Triggers doesn't return it, find the site's checkout-abandoned trigger there instead of using this key.
2. **One exists and its `configuration.status` is `ACTIVE`:** say it's already on, and count the step as done.
3. **One exists and is `INACTIVE`:** ask to turn it on, then follow [Automations Activation Status](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-activation-status.md).
4. **None exists:** ask to create one, then build it as [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations.md) shows, with the trigger confirmed in item 1 and one email to the customer.

A reminder reaches only customers who entered their email at checkout. Say so in one line.

### Step 5: Open Facebook & Instagram Ads with Wix

There is no public API for Facebook & Instagram Ads with Wix, so the owner creates the campaign on its page.

1. Say which products the ad can show: those that passed step 1, by name when there are five or fewer, else the count and the top three best sellers.
2. Give the link to the app's main page, with what to pick there: "Open Facebook & Instagram Ads and choose Get sales."

   `https://manage.wix.com/dashboard/<siteId>/app/4e0b3af1-73a5-4482-b1fb-87ca6c18905c`

   This is the dashboard's app-ID link ([Dashboard Navigation](https://dev.wix.com/docs/api-reference/business-solutions/bookings/skills/dashboard-navigation.md)). The page asks the owner to connect their Facebook account when it isn't connected yet.

The step is done when the owner says the campaign is running. Don't describe the ad's price: the page shows it.

## How to talk to the store owner

- **Calm, short and on their side.** One to three sentences per message outside the plan. No exclamation points, no "please", no "sorry". "I" is only for what you checked or will change.
- **Use the names the owner sees in Wix** for what they will open: Coupons, Automations, Email Marketing, Social Media Marketing, Facebook & Instagram Ads. Say "customers", never "shoppers" or "users". No API names, field names or error codes.
- **Real names and numbers from this store**: "4 mugs have no description: Speckled Mug, Moss Cup, Tide Bowl, Ash Plate."
- **Every approval names the exact change** and gives a way to say no. Discounts, emails and posts each get their own yes, even after "save all" in step 1.
- **After each change, say what it was before**, so the owner can ask to put it back.
- **Answer in the language the owner writes in.** Dates, times and money use the site's time zone and currency.

## Guardrails

- Never write without the owner's yes to that change. Reading is free.
- Never invent a price, a product photo, a follower count, or what Meta approved.
- Never send a post, email or campaign whose content changed after the owner approved it: show it again.
- Use only endpoints from this recipe or the recipes it links. Anything else is confirmed in the Wix REST docs first.
- Don't ask for what the reads already hold (best sellers, past customers, the business name, the time zone). Ask only for what the owner alone knows: a price, a photo, the offer.

## Common mistakes

| Mistake | Fix |
|---|---|
| Telling the owner Meta rejected or approved a product | The check grades Meta's rules on Wix's side; no API reads Meta's verdict |
| Trying to connect the channel or read whether it's connected | No API exists; give the Meta channel page link |
| Sending a product update without its current `revision` | Read the product, then send its `revision` |
| Sending `media.itemsInfo.items` with only the new main photo | The array replaces the gallery; send every item, reordered |
| Setting `brand.name` on an existing product | Get Or Create Brand, then set `brand.id` |
| Publishing the campaign with `{}` | Always send `emailDistributionOptions` with the audience |
| Scheduling posts when `SCHEDULE_POST` is off | Offer to publish one now, and name the plan that schedules |
| Stating the Instagram number as an exact share | It's a floor: say "at least" or use it as a count of customers |
| Running step 5 before any product check | Run step 1's check first and say what the ad could show |
| Passing a product whose description is the template's placeholder | "I'm a product description…" counts as no description |
| Setting the brand to a default site name | With no business name, ask; never brand products "My Site 12" |