> 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: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/introduction.md

## Article Content:

# About the Areas API

The Areas API lets a business define the parts of it that Wix Arrivals controls access to (the main
floor, the pool, a cycle studio) and the entrances clients pass through to get in. Plans are connected
to areas: an area is the item a pricing plan grants entry into, so which plans are allowed into an area
is configured on the plans' benefits. Site collaborators pick the entrance they are standing at on the scanner, and
every arrival is recorded against the area and that entrance.

With the Areas API, you can:

- Create, rename, and archive the areas of a business, and delete an area that was created by mistake.
- Add, rename, and remove the entrances of an area, and mark the one the scanner preselects.
- Set an area's entry policy: whether a booked scheduled event admits a client, with its entry window. The policy
  can also list intake forms, which are stored but aren't checked at entry yet.
- List the active areas with their entrances to build the scanner's picker.

## Default entrances

The default entrance is the entrance a scanner at a location preselects. It's a hint for client apps only: every
arrival names its entrance, whichever was preselected.

- At most one per location: a location has at most one default entrance across its areas, and can have none.
  An archived area's entrances are never the default.
- Marking one: mark an entrance `defaultEntrance` with Create Area or Update Area. It becomes its location's
  default, and the entrance that held it is cleared. When that entrance is in another area, that area's
  `revision` increments and an Area Updated event fires for it. Marking more than one entrance in one request
  fails with `MULTIPLE_DEFAULT_ENTRANCES`.
- When none is marked: an area created, unarchived, or updated with its `entrances` gets the default on its
  first entrance only when its location has none. An area that held the default keeps it on its first entrance
  when an update sends a list that marks none.
- Archiving or deleting the holder: the default moves to the first entrance of the oldest other active area
  at that location, whose `revision` increments and which gets an Area Updated event. With no other active area
  there, the location has no default.
- Moving an area: changing `locationId` takes the default away from an area that held its old location's
  default, and the old location has none until a later write sets one. At the new location, the area keeps or
  gets the default only when that location has none, unless the request marks one of its entrances.
- Simultaneous changes: rarely, two changes at one location at the same time leave two entrances marked until
  a default is next marked. Preselect the first one you find.

## Related APIs

- [Locations](https://dev.wix.com/docs/api-reference/business-management/locations.md): an area belongs to a
  business location (`locationId`).
- Intake Forms: an area's policy can list intake forms. They're stored, but they aren't checked at entry yet.
- Pricing Plans: which plans are allowed into an area is configured on the plans' benefits, in the plan
  editor of the Pricing Plans dashboard. Plans show an area's current name, read from Arrivals by the area's ID,
  so a renamed area needs no update on its plans.
- [Benefit Programs](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs.md): the API behind
  plan benefits. An area is a benefit item whose item ID is the area's `id`. Use it to connect areas to a plan's
  benefit programmatically. Sites using it must have the Pricing Plans app installed.
- [Arrivals](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival.md): each arrival
  is recorded against an area and one of its entrances, and keeps their IDs and names after the area or entrance
  changes.

## Closing an area

An area is closed in one of two ways:

- Archive Area takes it out of use. An archived area keeps resolving in history but disappears from setup and the
  scanner, and can't be picked in the plan editor. A plan that still holds it shows it in the plan editor by its
  name followed by "(archived)" in the caller's language, as in "Pool (archived)" in English. Unarchive Area makes
  it active again.
- Delete Area removes it, active or archived, even with recorded arrivals. A deleted area can't be restored.

Either way, while Pricing Plans is enabled on the site, the area is removed from every plan benefit that grants
entry into it, and unarchiving doesn't put it back. Past arrivals keep the area's ID and name.

## Entry policy

When a booking admits a client is on the area's `policy`, not on an entrance:
every entrance of an area follows the same rules. The policy is part of the area, not an entity of its own, and
each area is configured on its own.

- Intake forms: the policy can list intake forms, each with `blocksEntry`. They're validated and stored, but they
  aren't checked at entry yet: a client without a submission is evaluated on their plans and scheduled events as
  usual.
- Scheduled events: they admit a client only when `policy.scheduledEventsPolicy.entryGrantingAppIds` names the app
  that provides them, such as Wix Bookings. The list is empty by default, so an area decides entry on pricing plans
  only until the owner turns this on. When the list isn't empty, `entryWindow` is required: there
  is no default window. The window must be open for at least one minute: both values at `0` admit practically no
  one, and fail with `EMPTY_ENTRY_WINDOW`.
- A returned area always has a complete policy. An area created without one lists no form, and its scheduled
  events don't admit.

## Before you begin

It's important to note the following points before starting to code:

- A site that has a default location starts with one area, with one entrance (the location's default entrance),
  created when Arrivals is installed. Both get a default name in the site's language ("Main area" and "Main
  entrance" in English), which the owner can rename. A site gets a default location once its business info has an
  address. A site installed before that has no area, and its first area is created with Create Area after the
  business adds a location. Don't create the first area of a site that already has one.
- An entrance isn't an entity of its own. It's part of its area, and it's managed with Update Area by sending the
  whole `entrances` list. An entrance keeps its `id` while it stays in the list.
- An area's `status` changes only through Archive Area and Unarchive Area. It can't be set with Update Area.
- Don't assume a site or a location has an active area: Query Areas can return none. The site's last active area
  can be neither archived nor deleted (`LAST_ACTIVE_AREA`), but the rule counts the site's active areas, not a
  location's.
- Connecting an area to a pricing plan's benefit with the Benefit Programs API requires the Pricing Plans app on
  the site.

## Use cases

- [Set up a new business](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [Add an entrance to an area](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [Build the scanner's picker](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [List the forms an area will require](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [Let booked clients in on their class](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [Retire an area without losing its history](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)
- [Remove an area created by mistake](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/area/sample-flows.md)

## Terminology

- **Area**: A part of a business that pricing plans grant entry into, with its entrances and its entry policy.
- **Entrance**: A point clients pass through to get into an area (a door, a turnstile, a gate, or a front
  desk), with or without hardware. Part of its area.
- **Default entrance**: The entrance a scanner at a location preselects. At most one per location, across its areas. A client-app
  hint only; every arrival names its entrance.
- **Policy**: What the owner configures about entering an area: whether scheduled events admit, with their
  entry window, and the intake forms it lists. Part of the area.
- **Intake form**: A form listed on the area's policy with `blocksEntry`. Stored, but not checked at entry yet.
- **Entry window**: When a client booked on a scheduled event can enter, relative to the event's start. Used
  only when the area's `scheduledEventsPolicy.entryGrantingAppIds` isn't empty.
- **Archived area**: An area no longer in use. It no longer appears in setup or on the scanner, can't be picked in
  the plan editor, and past arrivals still resolve to it. While Pricing Plans is enabled on the site, archiving removes it from its
  plans, as deleting does.

