Generated banner for Wix Headless
Generated logo for Wix Headless

Wix Headless

WixOfficialPublished by Wix

  • Skill
  • Tool integration
  • Software development
  • MIT
  • Low risk
  • Has scripts

From the author

Connect Wix business services (Stores, Bookings, Donations, CMS, Blog, Events, Forms, and more) to a Wix Headless frontend — infer the needed capabilities, install the apps, seed backend content, and produce an SDK-integration guide. For managed (Wix-hosted) projects it can also build the frontend: scaffold a new site (create) or wire an existing/brought-in design (connect), then build and release. Works across managed, self-managed, and stripe project types. Triggers: set up a Wix Headless backend, add Wix business features to my app, accept donations, build or host a Wix site, connect/implement this design with Wix.
— the description by Wix

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The wix-headless skill acts as an orchestrator for integrating Wix business services (such as Stores, Bookings, and CMS) into a headless frontend architecture. It handles the end-to-end configuration of the Wix backend, including app installation, content seeding, and the generation of a tailored SDK integration guide. Depending on the project type (managed, self-managed, or stripe), the skill can either provide a comprehensive integration guide for the user to implement or, in managed scenarios, actively scaffold, wire, and deploy the frontend project.

What it does

  • Infers required Wix capabilities based on user intent and project context.
  • Installs necessary Wix apps and seeds backend content automatically.
  • Generates a custom SDK integration guide for calling Wix services from the frontend.
  • Scaffolds or connects existing frontend projects to Wix for managed hosting.
  • Handles project-type-specific authentication and deployment workflows.
  • Provides a mechanism to relay feedback to Wix regarding the headless experience.

When to use it

  • When you need to integrate Wix business services into a custom-built headless frontend.
  • When you want to automate the setup and content seeding of a Wix backend.
  • When you are building a new site on Wix infrastructure and need a scaffolded frontend.
  • When you have an existing frontend design and need to wire it to Wix business capabilities.
  • When working with Stripe Projects and requiring a Wix backend configuration.

Advantages

  • Reduces manual configuration by automating app installation and content seeding.
  • Provides a clear, actionable SDK integration guide tailored to your specific capabilities.
  • Supports multiple project architectures including managed, self-managed, and Stripe-based setups.
  • Ensures consistent backend setup by following verified inline recipes.
  • Simplifies the transition from design to a functional, Wix-powered headless site.

Usage examples

“Set up a Wix Headless backend for a store with products and a blog.”
The skill will install the Stores and Blog apps, seed sample products and posts, and provide an SDK guide for fetching this data in your frontend.
“I have an existing design; connect it to Wix and host it on their managed infrastructure.”
The skill will initialize the project, wire the existing UI to the necessary Wix business services, and prepare it for release on Wix.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/wix/wix-headless/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip wix-headless.zip -d .agents/skills

Documentation by Wix

Wix Headless

This skill connects Wix business services to a Wix Headless frontend. Its core job is to configure the Wix backend: infer the needed capabilities, install the Wix apps, seed the backend content, and produce an SDK-integration guide describing how to call Wix from the frontend.

What happens with the frontend depends on the project type and operation:

  • Backend-only (self-managed, stripe, or a managed "just set up the backend" run) — the skill emits the SDK guide as its final output; the host owns the frontend, build, and hosting.

  • Managed create / connect — the skill also owns the frontend: it scaffolds a new project (create) or attaches Wix to an existing one (connect), wires it to the backend using that same guide, builds, and releases to Wix. (There is no Designer or template library — the frontend is built ad-hoc to intent.)

On a backend-only run the skill does not own the project scaffolding. When the work needs a frontend, scaffold it according to user intent — framework and structure follow the prompt; the skill's job is the Wix backend plus the emitted SDK guide describing how to call Wix from whatever frontend exists, not choosing or generating the app. This is the norm for a stripe run: the project is provisioned via Stripe Projects (credentials land in .env — see stripe/AUTHENTICATION.md), the skill configures the backend and emits the guide, and the live site is finalized per stripe/DEPLOYMENT.md — while the frontend is scaffolded and wired to intent, by the host.

Project types

The skill behaves identically across project types except for authentication and deployment, which are isolated in a per-type folder under references/:

Project typeHostingAuthentication & deployment live in
managedWix infrastructure (maintained by Wix)references/managed/
self-managedthe user's own host (TBD)references/self-managed/
stripethe user's own host, provisioned via Stripe Projectsreferences/stripe/

Everything else — Discovery, Setup, Seed, the SDK handoff — is project-type-agnostic and refers to "the provided authentication mechanism" rather than any specific method.

Resolving the project type

Resolve the type before Discovery, in this order — stop at the first that decides:

  1. Caller-provided. If the host/caller passed a project type (managed | self-managed | stripe), use it. An explicit value always wins.

  2. Detect from project signals (on disk). Check the working directory (read-only):

    • stripe — .env carries WIX_WIX_CLIENT_ID / WIX_WIX_CLIENT_SECRET / WIX_WIX_METASITE_ID (or the plain WIX_* fallback). This is the Stripe-Projects fingerprint.

    • managed — a Wix CLI project: wix.config.json present, or a .wix/ directory, or @wix/cli / @wix/astro in package.json.

    • self-managed — a frontend project on disk (e.g. package.json with a bundler/framework) with neither the Stripe .env fingerprint nor the Wix-CLI markers above.

  3. Detect from user intent. If disk is inconclusive, read the prompt:

    • managed — "managed", "host on Wix", "Wix-hosted", "deploy to Wix", "wix release".

    • stripe — "stripe projects", "I added Wix via Stripe", a Stripe-Projects context.

    • self-managed — "self-hosted", "my own host", names a non-Wix host, "I'll deploy it myself".

  4. Ask. If signals are absent or conflict, ask the user which type applies — don't guess.

Hold the resolved type in scratch; it selects <TYPE_DIR> (see Path resolution). Note self-managed is TBD — once resolved to it, the auth step will stop with a clear "not wired yet" error.

Resolving the operation (managed only)

create/connect/iterate are managed-only. For managed, resolve the operation by intent first, directory second — never let an empty directory override what the user is asking for. Check iterate first (it's decided by an unambiguous on-disk signal):

  • iterate → references/managed/CONNECT.md. The project is already connected to Wix — a wix.config.json (or .wix/) is already present — and the owner wants to add or change capabilities. Same flow as connect, but §1 skips init and reuses the existing wix.config.json; never re-init an already-connected project.

  • connect → references/managed/CONNECT.md. The user brings a design not yet connected to Wix and wants it wired: a frontend project on disk without a wix.config.json, or a brought-in/fetched design (a .zip/folder/file you unzip or read, a design-file URL, a Claude-Design/v0/Lovable export), or language like "connect this / implement this design (… connecting to Wix) / host this on Wix / deploy this to Wix / add Wix Headless to this project". A brought-in or fetched design is connect even when the current directory is empty — the design arrives from elsewhere (zip/fetch/URL), so emptiness at trigger time is not a create signal. (CONNECT.md step 1 places the brought design into CWD, then inits it.)

  • create → references/managed/CREATE.md. The user wants a new site built from a prompt with nothing brought in — "build me a site / store / blog…", no design file, no project on disk.

  • backend-only — the user only wants the backend configured (no frontend work). → the shared spine + emit the SDK handoff.

For self-managed and stripe, the operation is always backend-only (the host owns the frontend). Only when there is genuinely no brought-in design and no connect language does directory emptiness decide: empty → create; an existing frontend on disk → connect.

Preconditions (the host provides these — we read, never create)

  1. The project type — managed | self-managed | stripe — provided by the caller, else detected from project signals / user intent (see Project types § "Resolving the project type"), else asked. It selects <TYPE_DIR> (see Path resolution).

  2. A Wix metasite + a headless OAuth app exist, and credentials are available — obtained via the project type's AUTHENTICATION.md. The skill needs a bearer token authorized for the metasite and the metasite id.

  3. The user intent — free text describing what Wix should power ("add a store", "blog + contact form", "persist my app's data").

  4. (Optional) the project on disk — read-only, to sharpen brand/capability inference.

If the credentials are absent, the Wix backend isn't reachable — stop with a clear error.

What this skill does

Always open DISCOVERY.md first (it's agnostic — capability/brand/intent inference + the imagery gate, no auth). Then route by project type + operation:

Backend-only (self-managed, stripe, or managed backend-only) — the lean spine:

  1. Discovery (references/DISCOVERY.md) — infer capabilities + brand + intent + imagery.

  2. Setup (references/SETUP.md) — install the Wix apps those capabilities need.

  3. Seed (references/SEED.md) — create the backend content (+ entity images if imagery is on).

  4. Handoff (references/SDK_HANDOFF.md) — after Setup and Seed, emit the integration guide: SDK bootstrap, per-capability call shapes, the seeded IDs, and the @wix/* package list.

  5. Finalize deployment (<TYPE_DIR>/DEPLOYMENT.md) — run the project-type's finalize steps.

Throughout any run — if the user asks to send feedback to Wix, complains/gets frustrated, or the run hits any real friction (a confusing error, a doc gap, a tooling dead end, a workaround you had to invent — it doesn't need to repeat), offer to relay it to Wix per references/FEEDBACK.md. Default to offering rather than waiting to be asked. Every flow's finalize step (<TYPE_DIR>/DEPLOYMENT.md / managed/CREATE.md / managed/CONNECT.md) ends with the same checkpoint — treat it as a required self-check, not optional. Send only after an explicit yes — never automatically.

Managed create / connect / iterate — after Discovery, hand the whole run to the managed flow:

  • create → references/managed/CREATE.md (scaffold → Setup → Seed → build the frontend → release).

  • connect → references/managed/CONNECT.md (init → Setup → Seed → wire the existing UI → release).

  • iterate → references/managed/CONNECT.md — the project is already connected, so it reuses the existing wix.config.json (no init). Setup / Seed / wiring are incremental: it may already be set up and seeded from a prior run, so the agent checks current state first (installed apps, already-seeded content, existing wiring) and applies only the delta the new intent needs — never blindly re-installing or re-seeding. Re-release only if the frontend build output changed. These reuse the same SETUP.md/SEED.md/SDK_HANDOFF.md, but apply the SDK guide to build/wire the frontend themselves rather than emitting it, and release via managed/DEPLOYMENT.md.

Each Wix call uses the universal call shape (SETUP.md §1) with $TOKEN/$SITE_ID obtained per <TYPE_DIR>/AUTHENTICATION.md. The skill runs non-interactively except for the one imagery question (and asking the project type if it can't be resolved).

Don't smoke-test the frontend locally unless the user asks to verify. The deliverable is the built-and-released site (managed) or the SDK guide (backend-only) — not a local test report. By default do not start a dev server (wix dev / astro dev / npm run dev) to curl pages, drive the cart / booking / login flow, or launch a headless browser: correctness comes from following the recipes, real errors surface at wix build / wix release, and a headless run can't complete an interactive login or a real payment anyway — so these loops routinely burn minutes of wall for little signal (this is distinct from, and in addition to, the "release once at the very end" rule — that one only bans extra build+release cycles, not dev-server testing). Only spin up a dev server and smoke-test when the user's prompt explicitly asks to verify / test / confirm it works — and then keep it to a single lightweight pass (pages compile and render), not a full purchase/booking/login drive. The one post-release check in <TYPE_DIR>/DEPLOYMENT.md is the sanctioned verification.

Donations exception to the smoke-test policy above: for a build that accepts donations, follow the bounded anonymous API handoff check in references/inline-recipes/how-to-code-donations.md before claiming it works. It does not authorize a payment or campaign mutation, and does not require a dev-server testing loop. That recipe also defines the separate hosted-checkout and payment checks.

Path resolution

Compute <SKILL_ROOT> from this file (<SKILL_ROOT>/SKILL.md — strip /SKILL.md); hold the absolute path in scratch. Then resolve the project type to its folder and hold it too:

<TYPE_DIR> = <SKILL_ROOT>/references/<projectType>/ — one of managed/, self-managed/, stripe/.

WhatPath
Vertical index (intent matching + per-vertical site spec)<SKILL_ROOT>/references/CAPABILITIES.md
Discovery (infer capabilities + brand + intent; existing site → the Dynamic Context call in §1)<SKILL_ROOT>/references/DISCOVERY.md
Setup (install apps)<SKILL_ROOT>/references/SETUP.md
Seed (create backend content)<SKILL_ROOT>/references/SEED.md
SDK-integration handoff (emitted, or applied by create/connect)<SKILL_ROOT>/references/SDK_HANDOFF.md
Image generation (opt-in; agnostic)<SKILL_ROOT>/references/IMAGE_GENERATION.md
Design — fallback visual quality bar for the built frontend, when the user gave no design direction of their own (managed create only)<SKILL_ROOT>/references/DESIGN.md
Content — fallback copy quality bar for the built frontend, when the user gave no copy/voice direction of their own (managed create only)<SKILL_ROOT>/references/CONTENT.md
Experience overlays — a vertical's own design + copy bar on top of DESIGN/CONTENT (optional per vertical; read when that vertical is loaded)<SKILL_ROOT>/references/inline-recipes/experience-<vertical>.md (today: experience-store.md, experience-donations.md)
AI features — text/chat + embeddings (opt-in; agnostic)<SKILL_ROOT>/references/AI_FEATURES.md
Feedback — relay the user's headless-experience feedback to Wix (opt-in; user-approved)<SKILL_ROOT>/references/FEEDBACK.md
Authentication — obtain $TOKEN/$SITE_ID/clientId (project-type-specific)<TYPE_DIR>/AUTHENTICATION.md
Deployment — finalize the live site (project-type-specific)<TYPE_DIR>/DEPLOYMENT.md
Managed create flow (scaffold a new project)<SKILL_ROOT>/references/managed/CREATE.md
Managed connect flow (wire an existing project)<SKILL_ROOT>/references/managed/CONNECT.md
Frontend-axis references (how a frontend wires to Wix)<SKILL_ROOT>/references/astro.md, non-astro.md

Start a run by opening DISCOVERY.md. The flow files (CAPABILITIES, DISCOVERY, SETUP, SEED, SDK_HANDOFF, IMAGE_GENERATION, AI_FEATURES) are project-type-agnostic; the per-type specifics live under <TYPE_DIR>/ (AUTHENTICATION.md, DEPLOYMENT.md, and — managed only — CREATE.md/CONNECT.md).

Where the how comes from

This skill has no skill upstream — the how is read from the live Wix docs at dev.wix.com/docs. Read-priority: a page this skill links is read by curl-ing its .md twin directly (first priority — don't re-discover a curated link with search); the Wix MCP doc/search tools are second priority, for finding pages the skill doesn't link or as a fallback if a fetch fails. (Append .md to any docs URL for raw markdown; menu pages list child links, content pages carry the schema.)

Doc discovery is the shared fallback for both tracks — never the first move. Each track's primary source is its pinned material (below); when that doesn't cover what you need, fall back to references/DOC_DISCOVERY.md — a semantic doc-search + schema lookup that works with or without the Wix MCP.

  • Seed reads each capability's create flow from its inline recipe — a self-contained local inline-recipes/setup-*.md (mapped per capability in SEED.md § "What to seed per capability") that inlines the calls and supersedes the REST doc pages, so read it and seed from it alone. Only a capability with no inline recipe (e.g. coupons) falls back to doc discovery (DOC_DISCOVERY.md).

  • Handoff links the SDK docs for each capability's API shape, and supplies the runtime package set from the inlined map in SDK_HANDOFF.md (the SDK .md pages don't expose @wix/* import strings to navigation, so packages are mapped, not navigated).

Setup carries its app-install call (and the appDefId constants) inline in SETUP.md; CAPABILITIES.md is the vertical index that lets Discovery match intent and declares, per built vertical, the Required site features + Implementation checklist that Seed enables (backend-backed features) and the Handoff carries into the guide (so the host builds a complete site, not a bare data dump). This skill carries the what (which capabilities, how much content, what a finished site includes) and reads the how off the docs.

Files

references/inline-recipes/how-to-code-rentals.md


name: "How to Code Rentals" description: The frontend read/booking contract for a Wix Rentals site — a delta on how-to-code-bookings.md. Covers filtering the catalog to rentals, the two-call hourly availability flow (start slots then end options), the consecutive-day walk for daily rentals, duration-based price preview, and the createBooking → ecom Cart V2 → checkout-or-place sequence with the rentals app id. Specifies the how (modules + exact calls + rentals-specific failure modes); which rentals to render and how the page looks come from the request.

RECIPE: How to Code a Wix Rentals Frontend (Services V2 duration ranges + ecom Cart V2 checkout)

⚠️ Read how-to-code-bookings.md first — this recipe is a DELTA on it, not a replacement. Wix Rentals runs on the Wix Bookings APIs, so the client setup, the schema-driven booking form, the createBooking → ecom Cart V2 → checkout-or-place sequence, and the postFlowUrl HTTPS trap are all identical and are documented there. This file covers only what differs for a rental: finding rentals, duration-range availability, duration-based pricing, and the handful of rentals-specific errors.

⚠️ There is no @wix/rentals package, and that is not a gap. Rentals is @wix/bookings with rentals-specific field values. If a run concludes "Wix Rentals has no headless surface" because npm has no @wix/rentals, that conclusion is wrong — build on @wix/bookings.

Rentals doc set (four pages, where to go beyond this recipe): About Wix Rentals · Rentals and the Bookings APIs (concept → API map) · About Rentals Availability · Sample Flows (the booking sequences below, end to end).

⚠️ Reading rule — always append .md?apiView=SDK to every doc link below. The bare/REST view shows id; the SDK view shows _id, and the SDK is what your frontend calls.


Constants and modules (the delta)

Constants (e.g. src/services/constants.ts):

  • Wix Rentals app id — ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e. Used three times: to filter the catalog to rentals, as the cart's catalogReference.appId, and to filter bookings reads (§Cancellation).

Modules — all on @wix/bookings, alongside the ones how-to-code-bookings.md already lists:

NeedPackageModule
Rental catalog with availability/attribute filters@wix/bookingscatalogSearch (queryServicesByFilters)
Start times for a rental@wix/bookingsavailabilityTimeSlots (listAvailabilityTimeSlots)
End times for an hourly rental@wix/bookingsavailabilityTimeSlots (listAvailabilityTimeSlotEndOptions)
Duration-based price before booking@wix/bookingspricing (previewPrice)
Create the booking / cart / redirect(unchanged)see how-to-code-bookings.md

1 · Find the rentals

⚠️ CRITICAL: always filter by the rentals app id. Rentals share every API with Bookings. On a site that has both, an unfiltered queryServices returns haircuts next to meeting rooms. Every catalog read must carry appId = ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e.

catalogSearch.queryServicesByFilters is the right entry point for a rental catalog: it filters and resolves availability in one call.

const { results, pagingMetadata } = await catalogSearch.queryServicesByFilters({
  query: {
    filter: { appId: RENTALS_APP_ID },
    sort: [{ fieldName: 'name', order: 'ASC' }],
    cursorPaging: { limit: 20 },
  },
  serviceFilters: {
    localStartDate: '2026-09-01T00:00:00',   // omit the window entirely to skip the availability check
    localEndDate:   '2026-09-08T00:00:00',   // exclusive — start of the day AFTER the window
    timeZone: 'America/New_York',
  },
});
  • Each entry in results carries the full service plus an available flag. With a window set and exactMatch left unset, a service comes back when it has at least one bookable slot anywhere in the window.

  • End the window at 00:00:00 of the day after the range you want, not at 23:59:59. The end boundary is exclusive, so a 23:59:59 end silently drops the last minute of the final day. This matches the daily-booking convention in §3, where a rental's endDate is midnight of the day after the last rented day.

  • To grey out rather than hide unavailable rentals, set serviceFilters.includeUnavailable: true — those come back with available: false.

  • Paginate by passing pagingMetadata.cursors.next back unchanged as query.cursorPaging.cursor, until next is absent.

  • Location and attribute filters live in serviceFilters too — locationIds, resourceTypes, and attributes. Within one attribute, values are match-any; across different attributes, match-all.

  • With no date range, no availability check runs and everything returns available: true.

Doc: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/catalog-search/query-services-by-filters.md?apiView=SDK

Read the range off the service to drive the UI — it tells you which of the two flows below applies:

const range = service.schedule?.availabilityConstraints?.durationRange;
const isDaily = range?.unitType === 'DAY';
const min = isDaily ? range.dayOptions.minDurationInDays    : range.hourOptions.minDurationInMinutes;
const max = isDaily ? range.dayOptions.maxDurationInDays    : range.hourOptions.maxDurationInMinutes;

2 · Hourly availability — two calls, start then end

A fixed-duration service has one slot list. A rental has two steps: the customer picks a start, then picks how long.

Step 1 — start times.

const { timeSlots } = await availabilityTimeSlots.listAvailabilityTimeSlots({
  serviceId,
  timeZone,
  fromLocalDate: '2026-09-01T00:00:00',
  toLocalDate:   '2026-09-02T00:00:00',   // exclusive — start of the next day, not 23:59
  includeResourceTypeIds: [resourceTypeId],   // the service's primaryResourceType
  bookable: true,
});

⚠️ Pass includeResourceTypeIds with the service's primaryResourceType, or the slots come back with no resource to book. Each slot then carries its bookable resource in availableResources — carry that forward, createBooking needs it.

Step 2 — end times for the chosen start.

const { endOptions } = await availabilityTimeSlots.listAvailabilityTimeSlotEndOptions(
  serviceId,                                   // ⚠️ POSITIONAL first argument, not part of the options object
  { localStartDate: selected.localStartDate, timeZone, location: selected.location },
);
  • ⚠️ The response field is endOptions, NOT timeSlots. listAvailabilityTimeSlots returns timeSlots; this call returns endOptions. Destructuring timeSlots here yields undefined and no error — the end-time picker just renders empty, which is indistinguishable from "no availability". If your length picker is mysteriously blank, check this first.

  • location is REQUIRED — pass the selected slot's own location straight through. Omitting it fails the call.

  • The service's maximum duration caps the response, so you don't need maxLocalEndDate — the cap defaults to localStartDate plus that maximum. What you actually get back also depends on availability: the options stop earlier if the resource isn't free that long, so the last end option is whichever comes first — the maximum duration, or the end of the free period.

  • Every entry shares the requested localStartDate and differs only in localEndDate — that is the end-time picker.

  • availableResources is always empty on end options, and totalCapacity is always 1. Take the resource from step 1, not from here.

  • ⚠️ END_OPTIONS_NOT_SUPPORTED means you called this for a daily or a fixed-duration service. End options are hourly-only — branch on unitType before calling.

Docs: https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots.md?apiView=SDK · https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slot-end-options.md?apiView=SDK


3 · Daily availability — one call, then walk the days yourself

There is no end-options call for daily rentals. You list days and compute the valid end dates client-side.

⚠️ timeZone must be the site's business timezone — see the rentals availability docs for why. Don't use the visitor's browser timezone.

const { timeSlots } = await availabilityTimeSlots.listAvailabilityTimeSlots({
  serviceId, timeZone,
  fromLocalDate, toLocalDate,
  timeSlotsPerDay: 1,
  includeResourceTypeIds: [resourceTypeId],
  bookable: true,
});

After the customer picks a start date, iterate forward through the returned list and stop at the first gap, or when you hit the service's maxDurationInDays. Those are the selectable end dates. A naive "start + max days" range will offer dates across a gap and then fail at booking time.

How a daily rental is stored depends on the resource's working hours — and it changes which call you make:

ResourceStored asBooking call
24/7 (no working-hours schedule) — the setup-rentals.md defaultone booking spanning the whole rangecreateBooking
Has working hoursa linked group, one booking per working day (2–8)createMultiServiceBooking with multiServiceBookingType: 'SEQUENTIAL_BOOKINGS'

For the 24/7 case, set the boundaries to midnight-to-midnight: startDate = midnight on the first day, endDate = midnight on the day after the last day. A Monday–Wednesday inclusive rental ends at midnight on Thursday. ⚠️ Wix derives allDay itself — do not set it.

For the working-hours case, build one booking per day with that day's own working-period start and end (e.g. 09:00 → 18:00), and send them together. The group is created all or nothing: any unavailable or non-consecutive day fails the whole call.

Docs: https://dev.wix.com/docs/api-reference/business-solutions/rentals/about-wix-rentals-availability.md · https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-multi-service-booking.md?apiView=SDK


4 · Price preview (duration-based)

A rental's price depends on its length, so show the total before booking.

const { priceInfo } = await pricing.previewPrice([{
  serviceId,
  resourceId,                       // required for appointment-based services
  numberOfParticipants: 1,          // always 1 for a rental — see below
  localStartDate: '2026-09-01T09:00:00',
  localEndDate:   '2026-09-01T14:00:00',
  timeZone,                         // required whenever the local dates are sent
}]);
// priceInfo.calculatedPrice

⚠️ numberOfParticipants is required and is always 1 for a rental. Omitting it, or sending 0, fails with NUMBER_OF_PARTICIPANTS_NOT_FOUND. A rental isn't a class: one booking takes one resource, so participant count never drives the price — the duration does. The room's stated capacity ("seats 8") is a resource attribute for display, not a participant count. Same reasoning as defaultCapacity: 1 on the service (setup-rentals.md STEP 4).

⚠️ Omitting localStartDate / localEndDate / timeZone does not error — it silently falls back to participant-based pricing and returns a flat rate that ignores the duration. The customer then sees one price and is charged another. Always send all three.

Hourly is prorated per minute (minutes × base ÷ 60); daily is base × days. Doc: https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/pricing-api/preview-price.md?apiView=SDK


5 · Book and check out

⚠️ LIVE BOOKING PRECONDITION — the site needs a premium plan and a configured payment method. On a free site the visitor flow fails at the last step: createBooking returns PREMIUM_VALIDATION_FAILED, and placeOrder returns SITE_NOT_ACCEPTING_PAYMENTS. That's site provisioning, not a frontend bug — if a booking can't complete, the setup is incomplete, not the code.

Two things make this misleading. The same createBooking succeeds as an admin (WIX_USER), so it reads like a permissions or payload bug when it's neither — always test the visitor path. And switching the service to offline / pay-in-person does not avoid it: placeOrder still requires the site to be accepting payments. Record the precondition and surface it to the owner; don't try to code around it.

Identical to how-to-code-bookings.md § "createBooking → cart → checkout", with four substitutions:

  1. endDate is the customer's chosen end, not a duration added to the start — that is the whole point of a rental.

  2. resource comes from the start slot's availableResources (§2 step 1 / §3). There is no ANY_RESOURCE staff fallback here; rentals are resource-driven.

  3. Map the slot's location to the booking's location — read the id as slot.location.id ?? slot.location._id, and write it under _id.

  4. The cart's catalogReference.appId is the RENTALS app id, not the Bookings one:

const cart = await createCart({
  catalogItems: [{ quantity: 1, catalogReference: { catalogItemId: bookingId, appId: RENTALS_APP_ID } }],
  cart: { source: { channelType: 'WEB' } },
});

Everything downstream — calculateCart, the checkout-vs-placeOrder decision, redirects.createRedirectSession and the HTTPS postFlowUrl rule — is unchanged. Follow how-to-code-bookings.md.

⚠️ One exception: do NOT call getAnonymousActionToken / bookingsGetBookingAnonymously for a rentals booking. how-to-code-bookings.md's confirmation-page step calls these client-side as the visitor. For rentals, getAnonymousActionToken returns 403 (the method requires the Manage Bookings scope, which the visitor doesn't have) — skip that whole step. Drive the confirmation page from what you already hold from createBooking / placeOrder / the redirect return instead; don't add a call to mint or read an anonymous token.


6 · SEO on item pages, and images

⚠️ There is no WIX_APPS.rentals.* and no seoTags.ItemType.RENTAL — a rental detail page is a Bookings service item page, so it uses the bookings accessors:

  • wixMetadata from WIX_APPS.bookings.servicePageMetadata — referenced directly in the export (module scope). Route param slug → identifiers.slug.

  • itemType: seoTags.ItemType.BOOKINGS_SERVICE.

Everything else about the three-step item-page SEO wiring (wixMetadata export → loadSEOTagsServiceConfig(...) → <SEO.Tags>, and running the config load in the same Promise.all with .catch(() => null)) is identical to how-to-code-bookings.md § "SEO on item pages".

Images are the same trap too: service.media.mainMedia.image is a string holding a wix:image://v1/… URI, not an absolute URL. Resolve with media.getImageUrl(...) from @wix/sdk before putting it in <img src>, and guard items with no image.

Mount the slot picker, length picker and book action in a client-only island (Astro) — availability is timezone- and session-specific. SSR only the catalog and detail reads, for SEO.


Rentals-specific failure modes

ErrorCauseHandling
Empty length picker, no errorDestructured timeSlots from end options instead of endOptionsRename the destructure (§2)
END_OPTIONS_NOT_SUPPORTEDEnd options called for a daily or fixed-duration serviceBranch on durationRange.unitType before calling
INVALID_DURATION_PROVIDEDChosen length falls outside the service's rangeThe response carries the allowed range — show it and return the customer to the picker
SLOT_NOT_AVAILABLEThe slot was taken between selection and bookingReturn to the slot picker and refresh availability
Empty availability, no errorThe service's resource type has no resourcesA seed bug, not a frontend one — see setup-rentals.md STEP 2
Rentals mixed with appointmentsA catalog read without the appId filterAdd appId to query.filter (§1)
NUMBER_OF_PARTICIPANTS_NOT_FOUNDnumberOfParticipants missing or 0 on the price previewSend 1 — always 1 for a rental (§4)
Price differs from what was shownPrice preview sent without localStartDate/localEndDate/timeZoneSend all three (§4)
Booking created at the wrong location, or location silently emptyRead only .location._id (undefined)Read both .location.id ?? .location._id (§5)
Hunting for WIX_APPS.rentals.* or seoTags.ItemType.RENTALNeither existsUse the bookings accessors — a rental detail page is a Bookings service page (§6)
.image.url fails tsc, or images render brokenmedia.mainMedia.image is a string holding a wix:image:// URImedia.getImageUrl(...) from @wix/sdk (§6)

Out of scope

Cancellation. A logged-in member can cancel their own rental:

  • A single rental (hourly, or daily on a 24/7 resource) cancels with cancelBooking and its current revision.

  • A multi-day group (daily on a working-hours resource) cancels with cancelMultiServiceBooking and the group's multiServiceBookingInfo.id, read back off any booking in the group.

⚠️ Read the booking back with queryExtendedBookings, filtered on the rentals appId. Without an appId (or createdByAppId) filter of your own, the query applies a default one that covers Bookings but not rentals, and returns 0 results — a rentals booking that exists looks like it doesn't. Naming appId in the filter suppresses that default:

  filter: { appId: RENTALS_APP_ID },

Refunds are the eCommerce Orders API, not Bookings. Also out of scope, as in bookings: waitlists, deposit/payment breakdowns, and multi-item rental carts.

Conclusion

  • Rentals is @wix/bookings — there is no @wix/rentals, and its absence is not a missing capability.

  • Every catalog read filters on the rentals appId, or a mixed site shows the wrong services.

  • Hourly = two availability calls (start → timeSlots, then end options → endOptions, hourly-only, location required, serviceId positional). Daily = one call with timeSlotsPerDay: 1, then walk consecutive days client-side.

  • Daily storage follows the resource: 24/7 → one booking (midnight to midnight-after, never set allDay); working hours → a sequential multi-service group whose id you must persist yourself.

  • Price preview needs both local dates and the time zone, or it silently returns a duration-blind price.

  • Booking, cart, checkout and confirmation are the bookings flow, with the rentals app id on the cart's catalogReference — except the anonymous-token confirmation step, which rentals must skip entirely (§5).

  • The slot's location id must be read defensively as .location.id ?? .location._id — the SDK type says _id, but the field stays .id on the wire.

  • SEO and images are the bookings ones too — WIX_APPS.bookings.servicePageMetadata and seoTags.ItemType.BOOKINGS_SERVICE; there is no rentals-specific accessor to find.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Wix
Publisher
Wix (Official)
Source
wix/skills · skills/wix-headless · commit d168bc2
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Wix.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download wix-headless.zip