> 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: Instagram and Facebook Bookings Plan

## Article: Instagram and Facebook Bookings Plan

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/skills/instagram-and-facebook-bookings-plan.md

## Article Content:

# Instagram and Facebook Bookings Plan

A plan for a bookings business whose clients can already book it from its Instagram profile or Facebook Page. People there find a business through its photos and through friends, so the plan keeps the services in front of them and rewards clients who bring a friend. 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 booking channel.** Nothing here can add a booking button to Instagram or Facebook, or read whether it's there. Take the owner's word that clients can book them there; the site's app list doesn't show it, so don't look for it there.
- **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

- Clients can book the owner from Instagram or Facebook, and the owner asks what to do next, how to get more bookings there, or how to get seen there.
- The owner asks one step on its own ("schedule posts for my services", "set up a referral reward"): run that step only.

Not for:
- **Adding a booking button to Instagram or Facebook.** No public API does it. Say the owner adds it in their dashboard.
- 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 services, as one step of a channel plan.
- A business with no Wix Bookings: say this plan is for bookings businesses and stop.

## 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 and the app list. No Wix Bookings: say this plan is for bookings businesses and stop.
2. **Read once.** Make the four reads in [Reads](#reads): the first three together when a tool can run them in one call, and the analytics read as its own three calls. A failed read leaves out what it feeds and never stops the plan.
3. **Write the note** from those reads ([The note](#the-note)).
4. **Show the plan:** the note, then the three 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 business yet: a step's caveats, such as a referral program that isn't set up, 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 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. The site properties, services and referral program can go in one call when a tool can run them together; the analytics read never joins that call. The fields each read returns are in its last column.

| Read | Call | Fields used |
|---|---|---|
| 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` |
| Services ([Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md)) | `POST https://www.wixapis.com/bookings/v2/services/query` with `{"query": {"paging": {"limit": 100}}}` | Per service: `id`, `name`, `type`, `hidden`, `tagLine`, `urls.bookingPage.url`, `media.mainMedia.image.url` (a file name; the photo is `https://static.wixstatic.com/media/<file name>`) |
| Referral program ([Get Referral Program](https://dev.wix.com/docs/api-reference/business-management/marketing/referral-program/referral-program/get-referral-program.md)) | `GET https://www.wixapis.com/_api/referral-programs/v1/program` | `referralProgram.{status, revision, referredFriendReward, referringCustomerReward, premiumFeatures.referralProgram}`; a `404` with `REFERRALS_NOT_INSTALLED` means there is no program yet |
| Clients by where they booked, last 90 days ([Query Semantic Model Data](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/query-semantic-model-data.md)) | 1. `GET https://www.wixapis.com/analytics/semantic-model/v3/semantic-models` ([List Semantic Models](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/list-semantic-models.md)); 2. `GET https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/<id>` ([Get Semantic Model](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/get-semantic-model.md)); 3. `POST https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/query-data` with the body below, in that order | List: the `id` of the model whose `slug` is `bookings`. Get: its dimensions and measures. Query: one row per booking platform |

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 bookings model, from List Semantic Models>",
  "interval": { "start": "<90 days ago, local midnight, UTC>", "end": "<tomorrow, local midnight, UTC>", "timezone": "<site time zone>" },
  "fields": ["bookings.booking_platform", "bookings.customers_count"],
  "sort": { "fieldName": "bookings.customers_count", "order": "DESC", "nullsLast": true },
  "paging": { "limit": 20 }
}
```

Make List Semantic Models, Get Semantic Model and the query as three separate calls, reading each result before making the next, as [Query Site Analytics](https://dev.wix.com/docs/api-reference/business-management/analytics/skills/query-site-analytics.md) requires; never chain them in one script. Find the model first: [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 `bookings`, 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 `bookings.booking_platform` and `bookings.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 clients. With no `bookings` model, a missing field or a failed read, the note uses no number. Each row's `bookings.booking_platform` is a value such as `booking_platform_web` or `booking_platform_dashboard`; the Instagram and Facebook rows are the ones whose value contains `instagram` or `facebook`.

## 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 business, not like a report.

- Talk about the business: what it offers, who books, what it looks like. Take this from `properties.description` and the visible services' names and tag lines.
- Tie one true thing about it to why Instagram and Facebook fit (people see a service in photos, and book where a friend sent them), and end with where to start, in the owner's terms: name a visible service.
- Use at most one number: clients who booked through Instagram or Facebook, when those rows add up to at least 5 ("9 clients booked you from Instagram in the last three months"). Below 5, or when the read failed, use no number.
- Never list problems (a missing referral program: that's a step), 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 before-and-after colour work is exactly what people stop scrolling for, and most new clients come because a friend sent them. Now they can book you right from your profile. I'd start with posts for the balayage appointment."

## The plan

| # | The line the owner reads | What happens |
|---|---|---|
| 1 | Schedule 2 weeks of Instagram and Facebook posts that point people to book | [Step 1](#step-1-schedule-two-weeks-of-posts) |
| 2 | Give clients a reward for referring a friend | [Step 2](#step-2-set-up-a-referral-reward) |
| 3 | Run a booking ad with Facebook & Instagram Ads with Wix | [Step 3](#step-3-open-facebook--instagram-ads-with-wix) |

The ad comes last: people who tap an ad look at the profile next, so the posts pay it off.

### Step 1: 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 post, with the plan answering its first questions: the channels are `INSTAGRAM` and `FACEBOOK`, the subject is a service, the text is generated from that service as a site asset (`BOOKINGS_SERVICE`, with the service's `id`), and the image is the service's main photo.

- Take up to four visible services that have a photo. With none, ask the owner for photos of their work, which they upload in the Media Manager, and stop.
- Plan two posts a week for two weeks, one service each, on both channels: eight items. Spread them on different weekdays at 10:00 in the site's time zone, starting tomorrow.
- Each caption ends by pointing to booking: on Facebook, with the service's `urls.bookingPage.url`; on Instagram, where captions don't carry links, with how to book ("Book from the button on our profile").
- Check the plan before writing any post (STEP 5 of that recipe). 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 2: Set up a referral reward

A client shares their referral link; the friend gets a reward when they sign up, and the client gets one when the friend books and pays for a session.

1. **No program yet** (the read returned `REFERRALS_NOT_INSTALLED`): the owner starts the program from its dashboard page, and it needs a Business plan or higher. Give the link, `https://manage.wix.com/dashboard/<siteId>/referrals/` (the page Wix's Help Center links to in [Adding and setting up your referral program](https://support.wix.com/en/article/wix-referral-program-adding-and-setting-up-your-referral-program)), say "Open Referral Program and choose Start Now", propose the rewards of point 3 so the owner knows what comes next, and stop the step there. Don't install an app for it: the Wix Referral Program has no public app ID, and the referral apps in the App Market are other companies' products. Continue from point 2 only when the owner says the program is started.
2. **A program exists and `premiumFeatures.referralProgram` is `false`:** say the referral program needs a Business plan or higher, and stop.
3. **Propose the rewards** in one message, even when the owner asked to "set up a reward": that request isn't a yes to these rewards. the friend gets 10% off their first booking, the client gets 10% off their next booking once the friend has booked and paid, and Wix emails clients who've booked an invitation to refer a friend. Ask the owner to approve it or change it.
4. **Save it** with the program's current `revision` ([Update Referral Program](https://dev.wix.com/docs/api-reference/business-management/marketing/referral-program/referral-program/update-referral-program.md)):

   ```json
   PATCH https://www.wixapis.com/_api/referral-programs/v1/program
   {
     "referralProgram": {
       "revision": "<revision>",
       "referredFriendReward": { "type": "COUPON", "couponOptions": { "name": "Friend's first visit", "discountType": "PERCENTAGE", "percentageOptions": { "percentage": 10 }, "scope": { "namespace": "bookings" } } },
       "referringCustomerReward": { "type": "COUPON", "couponOptions": { "name": "Thanks for the referral", "discountType": "PERCENTAGE", "percentageOptions": { "percentage": 10 }, "scope": { "namespace": "bookings" } } },
       "successfulReferralActions": ["SESSION_BOOKED"],
       "emails": { "encourageToReferFriends": ["BOOKINGS"], "notifyCustomersAboutReward": true }
     }
   }
   ```

5. **Turn it on** when `status` isn't `ACTIVE`, after the owner's yes: `PATCH https://www.wixapis.com/_api/referral-programs/v1/program/activate` with no body ([Activate Referral Program](https://dev.wix.com/docs/api-reference/business-management/marketing/referral-program/referral-program/activate-referral-program.md)).

Say in one line that clients find their referral link on the site's referral pages, which show once the site is published.

### Step 3: 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. Suggest which service to lead with: the visible service with the strongest photo, by name, and its booking page.
2. Give the link to the app's main page, with what to pick there: "Open Facebook & Instagram Ads and choose the goal that brings bookings."

   `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 business 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: Social Media Marketing, Referral Program, Media Manager, Facebook & Instagram Ads. Say "clients", never "users". No API names, field names or error codes.
- **Real names and numbers from this business**: "I'd post the Balayage, the Gloss Treatment and the Bridal Trial."
- **Every approval names the exact change** and gives a way to say no. The posts and the referral rewards each get their own yes.
- **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 install an app for the referral program or search the App Market for one; start it only from the Referral Program page.
- Never invent a photo, a follower count or a result.
- Never send a post 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 (the services, their photos, the business name, the time zone). Ask only for what the owner alone knows: photos, the reward.

## Common mistakes

| Mistake | Fix |
|---|---|
| Trying to add the booking button to Instagram or Facebook, or to read whether it's there | No API exists; take the owner's word |
| Posting a service without a way to book | Facebook captions carry the booking page URL; Instagram captions say how to book |
| Using a service's `media.mainMedia.image.url` as the post image as is | It's a file name: the image is `https://static.wixstatic.com/media/<file name>` |
| Treating `REFERRALS_NOT_INSTALLED` as an error, or installing an app to fix it | It means no program yet; give the Referral Program page link and stop the step |
| Saving rewards because the owner asked to "set up a reward" | Propose the exact rewards first; save them on a yes |
| Updating the referral program without its `revision` | Read the program, then send its `revision` |
| Scheduling posts when `SCHEDULE_POST` is off | Offer to publish one now, and name the plan that schedules |
| Stating the Instagram number as exact | It counts only clients whose booking recorded the platform |