> 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

# CheckEligibility

# Package: arrivals

# Namespace: ArrivalsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/check-eligibility.md

## Permission Scopes:
SCOPE.ARRIVALS.ADMIT: SCOPE.ARRIVALS.ADMIT

## Introduction

Checks whether a contact would be granted entry at an entrance, into the area it belongs to, without recording
or redeeming anything. It takes the same `entranceId` as Create Arrival.

The response is `eligibilityDetails` as Create Arrival would record it, with the `status` Create Arrival would
derive from it, and the contact's `contactDetails` (name and picture) as Contacts holds them now. With
`scheduledEventSearchWindow`, events found only in that window are also listed, with `OUTSIDE_ENTRY_WINDOW`.
Scheduled events are read only while the area's `policy.scheduledEventsPolicy.entryGrantingAppIds` is not
empty. The person is checked for now, the time of the call. When they were let into this area within the last
15 minutes and this entry would spend a credit, the status is `DENIED` with `RECENT_ENTRY`, and `recentArrival`
names that arrival. A `contactId` that is not a contact of the site fails with `CONTACT_NOT_FOUND`, including a contact that was
merged into another, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; an entrance of an archived
area fails with `AREA_ARCHIVED`, and a `scheduledEventSearchWindow` whose `endDate` is not after its `startDate` with
`SEARCH_WINDOW_INVALID`, checked before anything is read. When Pricing Plans or
Contacts can't be reached the call does not fail: the outage is reported in `eligibilityDetails.issues`
(`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE`). The status is then `DENIED`, unless something else admits
the person. Create Arrival, in the same case, fails with `UNAVAILABLE` unless it carries `denialOverride`. Without Contacts,
`contactDetails` has the contact ID alone.
Nothing is stored. To record the entry, call
[Create Arrival](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival.md).

---

## REST API

### Schema

```
 Method: checkEligibility
 Description: Checks whether a contact would be granted entry at an entrance, into the area it belongs to, without recording or redeeming anything. It takes the same `entranceId` as Create Arrival.  The response is `eligibilityDetails` as Create Arrival would record it, with the `status` Create Arrival would derive from it, and the contact's `contactDetails` (name and picture) as Contacts holds them now. With `scheduledEventSearchWindow`, events found only in that window are also listed, with `OUTSIDE_ENTRY_WINDOW`. Scheduled events are read only while the area's `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty. The person is checked for now, the time of the call. When they were let into this area within the last 15 minutes and this entry would spend a credit, the status is `DENIED` with `RECENT_ENTRY`, and `recentArrival` names that arrival. A `contactId` that is not a contact of the site fails with `CONTACT_NOT_FOUND`, including a contact that was merged into another, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; an entrance of an archived area fails with `AREA_ARCHIVED`, and a `scheduledEventSearchWindow` whose `endDate` is not after its `startDate` with `SEARCH_WINDOW_INVALID`, checked before anything is read. When Pricing Plans or Contacts can't be reached the call does not fail: the outage is reported in `eligibilityDetails.issues` (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE`). The status is then `DENIED`, unless something else admits the person. Create Arrival, in the same case, fails with `UNAVAILABLE` unless it carries `denialOverride`. Without Contacts, `contactDetails` has the contact GUID alone. Nothing is stored. To record the entry, call [Create Arrival](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival.md).
 URL: https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contactId, entranceId, scheduledEventSearchWindow.startDate, scheduledEventSearchWindow.endDate
 Method parameters: 
   param name: contactId | type: contactId | description: GUID of the contact whose eligibility to check. | required: true | validation: format GUID
   param name: entranceId | type: entranceId | description: GUID of the entrance to check eligibility at, one of an area's entrances. Eligibility is checked for the area it belongs to. | required: true | validation: format GUID
   param name: scheduledEventSearchWindow | type: ScheduledEventSearchWindow | description: A range of time in which Check Eligibility looks for scheduled events: an event is found when it starts at or after `startDate` and before `endDate`. It decides only which events are found, not when entry opens: entry follows the area's `policy.scheduledEventsPolicy.entryWindow`. At most a year is searched: an event that starts 365 days or more after `startDate` is not found, even when it starts before `endDate`. `endDate` must be after `startDate`, otherwise the call fails with `SEARCH_WINDOW_INVALID`. At most 20 scheduled events are returned (see `eligibilityDetails.scheduledEvents` in the response).  
        - name: startDate | type: string | description: Start of the range: events that start at or after it are found. | required: true | validation: format date-time
        - name: endDate | type: string | description: End of the range: events that start before it are found, if they start less than 365 days after `startDate`. Must be after `startDate`. | required: true | validation: format date-time
 Return type: CheckEligibilityResponse
  - name: contactDetails | type: ContactDetails | description: The contact given: their contact GUID, name and picture as Contacts holds them now. When Contacts did not answer (`CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`), only `contactId` is set. When creating an arrival, send `arrival.contactDetails.contactId`; the server fills in the rest.  
     - name: contactId | type: string | description: GUID of the contact who arrived. The only field of `contactDetails` sent when creating an arrival.  | validation: format GUID
     - name: firstName | type: string | description: The contact's first name at the time of the arrival. Set by the server; personal data. `****` after the contact's personal data is deleted for privacy.  | read-only: true | validation: maxLength 1000
     - name: lastName | type: string | description: The contact's last name at the time of the arrival. Set by the server; personal data. `****` after the contact's personal data is deleted for privacy.  | read-only: true | validation: maxLength 1000
     - name: picture | type: Image | description: The contact's profile picture at the time of the arrival, as Contacts held it. Set by the server; personal data. Absent when the contact has none, and absent after the contact's personal data is deleted for privacy.  | read-only: true 
        - name: id | type: string | description: WixMedia image GUID.  | validation: maxLength 256
        - name: url | type: string | description: Image URL.  | validation: format WEB_URL
        - name: height | type: integer | description: Original image height.  | read-only: true 
        - name: width | type: integer | description: Original image width.  | read-only: true 
        - name: altText | type: string | description: Image alt text.  | validation: maxLength 1000
        - name: filename | type: string | description: Image filename.  | read-only: true | validation: maxLength 256
  - name: status | type: Status | description: The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. Also `DENIED` when Pricing Plans or Contacts did not answer and nothing else admits the contact (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`): the engine could not decide, so show that the check could not be completed, with an option to try again; a site user who decides to let the person in anyway calls Create Arrival with `denialOverride`.  
     - enum:
     -     GRANTED: Access was given: the person entered. Either the engine found no issue that blocks entry, or a site user overrode a denial, afterwards with Override Arrival as Granted or on Create Arrival with `denialOverride`; `eligibilityDetails.issues` then holds what was overridden.
     -     DENIED: Access was not given: the engine found an issue that declines (see `EntryIssue`), and no site user has overridden it. A site user may still override with Override Arrival as Granted, which moves the status to `GRANTED`.
  - name: eligibilityDetails | type: EligibilityDetails | description: What the engine found, the same message Create Arrival records on the arrival: the entry's `issues`, the `missingIntakeForms`, and every plan benefit and scheduled event found, each with its own `issues`. Each issue is in one place. Rendered by your app in its own language. With `scheduledEventSearchWindow`, `scheduledEvents` also lists the events found only in that window, with `OUTSIDE_ENTRY_WINDOW`; Create Arrival never records those.  
     - name: issues | type: array<EntryIssue> | description: The issues of the entry as a whole. The issues decide the status the evaluation gives: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. When a site user lets the person in (afterwards with Override Arrival as Granted, or beforehand with `denialOverride` on Create Arrival), the status is `GRANTED` whatever the issues, and the issues show what was overridden. On an arrival, `PRICING_PLANS_UNAVAILABLE` and `CONTACTS_UNAVAILABLE` are found only that way, with `denialOverride`, since otherwise Create Arrival fails with `UNAVAILABLE`; Check Eligibility reports them without failing. A `DENIED` arrival always has at least one. Empty when nothing stood in the way.  | validation: maxItems 3
         - enum:
         -     NO_ELIGIBLE_GRANT: No grant the person holds admits them into this area now. A grant is what can grant entry: a plan benefit (`planBenefits`) or a scheduled event they are booked on (`scheduledEvents`), the same two kinds an arrival records in `planBenefit` or `scheduledEvent` once granted. Either nothing was found (`planBenefits` and `scheduledEvents` are empty), or everything found has an issue of its own, which says why. A contact whose site member's status (`memberInfo.status` in Contacts) is `BLOCKED`, `DELETED` or `OFFLINE` holds no plans here, so it finds none. Also reported when a credit pack would admit but the person is booked on an event here and now that still waits for approval: no credit is spent while the booking may be approved moments later (the event carries `PENDING_CONFIRMATION`). Declines at creation; site collaborators override, or sell a plan, approve the booking or renew the plan and create a new arrival. Not reported when Pricing Plans or Contacts did not answer: `PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` takes its place.
         -     INTAKE_FORM_MISSING: Not reported yet, since intake forms aren't checked at entry. Once they are, it means the person has no valid submission for at least one intake form the area's policy requires: never submitted, expired, canceled, or pending approval. The forms are listed in `missingIntakeForms`. Declines at creation when a missing form has `blocksEntry`; otherwise grants, with the issue kept on the arrival so site collaborators can chase the paperwork.
         -     RECENT_ENTRY: The person was already granted entry into this area within the last 15 minutes and a credit would be spent again: a retried scan, a re-entry, or a guest on the same credential. The earlier entry counts whatever granted it: a credit, an unlimited plan, a scheduled event or an override, and the 15 minutes count from that arrival's `createdDate`, or for an overridden arrival from its `overriddenDate`, when a site user let the person in. Declines at creation; the override spends a credit. Reported only when this entry would spend a credit: not when an unlimited plan or a scheduled event admits now.
         -     PRICING_PLANS_UNAVAILABLE: Pricing Plans didn't answer (it couldn't be reached, didn't answer in time, or failed on its side; any of these is an outage), so plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a site user's decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing; Override Arrival as Granted does not call Pricing Plans. `planBenefits` is empty, no `planBenefit` is recorded and nothing is redeemed; scheduled events and intake forms are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT`, never with it: plan benefits were not checked, so the person may hold one that admits. An issue a scheduled event has of its own stays on that event in `eligibilityDetails`.
         -     CONTACTS_UNAVAILABLE: Contacts didn't answer (it couldn't be reached, didn't answer in time, or failed on its side; any of these is an outage), so the person's member is unknown and plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a site user's decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing. `planBenefits` is empty, no `planBenefit` is recorded, nothing is redeemed, and `contactDetails` has the contact ID alone, with no name or picture; scheduled events, read by contact, are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT` and `PRICING_PLANS_UNAVAILABLE`, never with them: Pricing Plans is not read without the member.
     - name: missingIntakeForms | type: array<MissingIntakeForm> | description: Every intake form the area's policy requires and the person has no valid submission for, with its `blocksEntry`, so an app can point site collaborators to the right form. Empty unless `issues` contains `INTAKE_FORM_MISSING`, so always empty for now: intake forms aren't checked at entry yet.  | validation: maxItems 20
        - name: formId | type: string | description: GUID of the intake form, from the Intake Forms API, as listed in the area's policy.  | validation: format GUID
        - name: blocksEntry | type: boolean | description: Whether this missing form blocks entry, as configured on the area's policy (`policy.intakeForms[].blocksEntry` in the Areas API). `false`: the arrival is granted and site collaborators are warned. `true`: the arrival is denied until the form is submitted; site collaborators can still override.  
     - name: planBenefits | type: array<PlanBenefitEligibility> | description: The person's Pricing Plans benefits allowed into this area, each a `planBenefit` with its own `issues`: empty means the benefit admits. Listed on a `DENIED` arrival too, admitting ones included, so an override can take one later. The grant picks one by the rule on the arrival's `planBenefit` and records it there. Listed in the order of that rule, so the first is the one a grant takes; at most 20 are listed, the first 20 in that order. Empty when the person holds no benefit for this area, and when the status of the contact's site member (`memberInfo.status` in Contacts) is `BLOCKED`, `DELETED` or `OFFLINE`, since such a member holds no plans here.  | validation: maxItems 20
        - name: planBenefit | type: PlanBenefit | description: The benefit found, as `planBenefit` records it on an arrival.  | read-only: true 
           - name: poolId | type: string | description: GUID of the Pricing Plans benefit pool the member holds: the plan or pack they bought. Read-only to Arrivals.  | read-only: true | validation: format GUID
           - name: benefitKey | type: string | description: Key of the benefit inside the pool, as Pricing Plans defines it; a pool can hold several benefits. Read-only to Arrivals.  | read-only: true | validation: minLength 1, maxLength 64
           - name: displayName | type: string | description: Name to display, in the site's language ("10-Class Pack", "Monthly Unlimited"). The owner's own wording; not translated.  | read-only: true | validation: maxLength 200
           - name: type | type: PlanBenefitType | description: Whether the benefit counts entries: a credit pack spends a credit per entry, an unlimited plan counts nothing. Set by the server from the benefit's configuration in Pricing Plans.  | read-only: true 
                 - enum:
                 -     CREDIT: A credit pack: the benefit carries a credit configuration in Pricing Plans, and redeeming an entry spends one credit from its balance ("10-Class Pack").
                 -     UNLIMITED: An unlimited plan: no credit configuration, nothing is counted ("Monthly Unlimited"). The plan's own usage policy (a fixed interval, a rate limit such as three entries a week) may still apply, and Pricing Plans enforces it. Whether the plan is paid once or by subscription is not what this says.
        - name: issues | type: array<PlanBenefitIssue> | description: Why the benefit does not admit, in Pricing Plans' own words where it has one. Empty: the benefit admits. At most one is reported, since Pricing Plans gives one reason.  | read-only: true | validation: maxItems 1
             - enum:
             -     PLAN_NOT_ACTIVE: The benefit's plan isn't active at the time of the entry (ended, canceled, paused, not started yet, or for a moment while it's being renewed), as Pricing Plans reports. Site collaborators override, or renew the plan and create a new arrival.
             -     NOT_ENOUGH_BALANCE: A credit pack with no credits left, as Pricing Plans reports. Site collaborators override, or sell credits and create a new arrival.
             -     OUTSIDE_ACCESS_HOURS: The plan's usage policy does not allow entry at this hour or on this day, or another rule of the plan refuses entry, as Pricing Plans reports. A used-up limit on its own is `USAGE_LIMIT_REACHED`.
             -     USAGE_LIMIT_REACHED: The plan's usage policy limits how often it can be used, such as three entries a week, and that limit is used up for the current period, as Pricing Plans reports. Site collaborators override, or the client comes back in the next period.
     - name: scheduledEvents | type: array<ScheduledEventEligibility> | description: The scheduled events the person is booked on at this area's location inside the area's entry window, each with its own `issues`: empty means the event admits. Listed on a `DENIED` arrival too, admitting ones included, so an override can take one later. Check Eligibility with a `scheduledEventSearchWindow` also lists the events that start inside that window, with `OUTSIDE_ENTRY_WINDOW`; Create Arrival never does. At most 20 are listed: the events inside the area's window first, then the others by start time, earliest first. Always empty while the area's `scheduledEventsPolicy.entryGrantingAppIds` is empty.  | validation: maxItems 20
        - name: scheduledEvent | type: ScheduledEvent | description: The event found, as `scheduledEvent` records it on an arrival.  | read-only: true 
           - name: eventId | type: string | description: GUID of the scheduled event, as the provider in `appId` knows it. For an event from the Wix Calendar, the GUID in the Wix Calendar Events API.  | read-only: true | validation: minLength 1, maxLength 250
           - name: displayName | type: string | description: Name to display, in the site's language ("Tue 18:00 Reformer"). Not translated.  | read-only: true | validation: maxLength 200
           - name: appId | type: string | description: App GUID of the provider the event came from: the app that owns it on the Wix Calendar, such as Wix Bookings. Scheduled events are read from the Wix Calendar today; a provider of scheduled events of its own may later supply them, and is then identified here.  | read-only: true | validation: format GUID
        - name: issues | type: array<ScheduledEventIssue> | description: Why the event does not admit. Empty: the event admits. At most one is reported: when both apply, `OUTSIDE_ENTRY_WINDOW` wins over `PENDING_CONFIRMATION`, since approving the booking would not help outside the window.  | read-only: true | validation: maxItems 1
             - enum:
             -     PENDING_CONFIRMATION: The person is booked on the event here and now, but the booking still waits for the business's approval. Only an appointment can be pending. A credit pack is not spent instead (`NO_ELIGIBLE_GRANT`), since the booking may be approved moments later; an unlimited plan allowed into the area still admits. Site collaborators approve the booking and create a new arrival, or override.
             -     OUTSIDE_ENTRY_WINDOW: The person is booked on the event, but now is outside the area's entry window for it (`policy.scheduledEventsPolicy.entryWindow` in the Areas API). Only on an event listed by a Check Eligibility with `scheduledEventSearchWindow`; never on an arrival, since Create Arrival does not find events outside the area's window.
  - name: recentArrival | type: RecentArrival | description: Present when `eligibilityDetails.issues` contains `RECENT_ENTRY`: the earlier arrival that granted this person this area within the last 15 minutes, for an app to tell site collaborators "let in 4 minutes ago".  
     - name: arrivalId | type: string | description: GUID of that arrival.  | validation: format GUID
     - name: createdDate | type: string | description: That arrival's `createdDate`, for an app to tell site collaborators "let in 4 minutes ago". For an arrival overridden after it was written, it is the time of the denial; for every overridden arrival the 15 minutes count from its `overriddenDate`: call Get Arrival to show when the person was let in. What granted it is on that arrival: call Get Arrival with `arrivalId` and read its `planBenefit` or `scheduledEvent`.  | validation: format date-time

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SEARCH_WINDOW_INVALID | Description: `scheduledEventSearchWindow.endDate` is not after its `startDate`.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTACT_NOT_FOUND | Description: Couldn't find the contact. `contactId` isn't a contact of the site, including a contact that was merged into another: read the contact again to get the surviving contact's GUID.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ENTRANCE_NOT_FOUND | Description: Couldn't find the entrance. `entranceId` names no entrance of any area of the site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ARCHIVED | Description: The entrance's area is archived.


```

### Examples

### Check Eligibility while Pricing Plans is unavailable
From the contact card, checks a client while Pricing Plans does not answer; the call does not fail, the outage is the entry issue, no plan benefit is listed, and the status is DENIED

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
    "entranceId": "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59"
  }'
```

### Check Eligibility for a client let in minutes ago
From the contact card, checks a client whose credit pack admits them, but who was let into this area 4 minutes ago; another entry would spend a credit, so the answer is DENIED with RECENT_ENTRY and the earlier arrival

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
    "entranceId": "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59"
  }'
```

### Check Eligibility for the classes this evening
From the contact card, lists which of a client's classes this evening they could get in on. The class is found through the search window but is outside the area's entry window now, so it does not admit, and the client's credit pack is empty

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
    "entranceId": "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59",
    "scheduledEventSearchWindow": {
      "startDate": "2026-10-13T14:00:00Z",
      "endDate": "2026-10-13T19:00:00Z"
    }
  }'
```

### Check Eligibility
From the contact card, checks whether a client can enter the main floor right now; an unlimited plan admits them, and their old credit pack is empty

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
    "entranceId": "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.arrivals.arrivals.checkEligibility(contactId, options)
 Description: Checks whether a contact would be granted entry at an entrance, into the area it belongs to, without recording or redeeming anything. It takes the same `entranceId` as Create Arrival.  The response is `eligibilityDetails` as Create Arrival would record it, with the `status` Create Arrival would derive from it, and the contact's `contactDetails` (name and picture) as Contacts holds them now. With `scheduledEventSearchWindow`, events found only in that window are also listed, with `OUTSIDE_ENTRY_WINDOW`. Scheduled events are read only while the area's `policy.scheduledEventsPolicy.entryGrantingAppIds` is not empty. The person is checked for now, the time of the call. When they were let into this area within the last 15 minutes and this entry would spend a credit, the status is `DENIED` with `RECENT_ENTRY`, and `recentArrival` names that arrival. A `contactId` that is not a contact of the site fails with `CONTACT_NOT_FOUND`, including a contact that was merged into another, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; an entrance of an archived area fails with `AREA_ARCHIVED`, and a `scheduledEventSearchWindow` whose `endDate` is not after its `startDate` with `SEARCH_WINDOW_INVALID`, checked before anything is read. When Pricing Plans or Contacts can't be reached the call does not fail: the outage is reported in `eligibilityDetails.issues` (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE`). The status is then `DENIED`, unless something else admits the person. Create Arrival, in the same case, fails with `UNAVAILABLE` unless it carries `denialOverride`. Without Contacts, `contactDetails` has the contact GUID alone. Nothing is stored. To record the entry, call [Create Arrival](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contactId, options.entranceId, options.scheduledEventSearchWindow.startDate, options.scheduledEventSearchWindow.endDate, options
 Method parameters: 
   param name: contactId | type: string | description: GUID of the contact whose eligibility to check. | required: true | validation: format GUID
   param name: options | type: CheckEligibilityOptions  none | required: true 
        - name: entranceId | type: string | description: GUID of the entrance to check eligibility at, one of an area's entrances. Eligibility is checked for the area it belongs to. | required: true | validation: format GUID
        - name: scheduledEventSearchWindow | type: ScheduledEventSearchWindow | description: A range of time to look for the person's scheduled events in, besides the area's `policy.scheduledEventsPolicy.entryWindow`, for a what-if such as "which of this client's classes this evening could they get in on?". Both dates are required when it is set. It changes only which scheduled events are listed: those inside the area's window now, and those that start within this range. An event found only in this range doesn't admit (entry into the area follows the area's window) and is listed with `OUTSIDE_ENTRY_WINDOW`. Everything else is evaluated with the area's window, so `status` and `eligibilityDetails.issues` still say what Create Arrival would find. Not set: only the area's window is used. Always validated (`SEARCH_WINDOW_INVALID`), but finds no events while the area's `scheduledEventsPolicy.entryGrantingAppIds` is empty.  
           - name: startDate | type: Date | description: Start of the range: events that start at or after it are found. | required: true 
           - name: endDate | type: Date | description: End of the range: events that start before it are found, if they start less than 365 days after `startDate`. Must be after `startDate`. | required: true 
 Return type: PROMISE<CheckEligibilityResponse>
  - name: contactDetails | type: ContactDetails | description: The contact given: their contact GUID, name and picture as Contacts holds them now. When Contacts did not answer (`CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`), only `contactId` is set. When creating an arrival, send `arrival.contactDetails.contactId`; the server fills in the rest.  
     - name: contactId | type: string | description: GUID of the contact who arrived. The only field of `contactDetails` sent when creating an arrival.  | validation: format GUID
     - name: firstName | type: string | description: The contact's first name at the time of the arrival. Set by the server; personal data. `****` after the contact's personal data is deleted for privacy.  | read-only: true | validation: maxLength 1000
     - name: lastName | type: string | description: The contact's last name at the time of the arrival. Set by the server; personal data. `****` after the contact's personal data is deleted for privacy.  | read-only: true | validation: maxLength 1000
     - name: picture | type: string | description: The contact's profile picture at the time of the arrival, as Contacts held it. Set by the server; personal data. Absent when the contact has none, and absent after the contact's personal data is deleted for privacy.  | read-only: true 
  - name: status | type: Status | description: The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. Also `DENIED` when Pricing Plans or Contacts did not answer and nothing else admits the contact (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`): the engine could not decide, so show that the check could not be completed, with an option to try again; a site user who decides to let the person in anyway calls Create Arrival with `denialOverride`.  
     - enum:
     -     GRANTED: Access was given: the person entered. Either the engine found no issue that blocks entry, or a site user overrode a denial, afterwards with Override Arrival as Granted or on Create Arrival with `denialOverride`; `eligibilityDetails.issues` then holds what was overridden.
     -     DENIED: Access was not given: the engine found an issue that declines (see `EntryIssue`), and no site user has overridden it. A site user may still override with Override Arrival as Granted, which moves the status to `GRANTED`.
  - name: eligibilityDetails | type: EligibilityDetails | description: What the engine found, the same message Create Arrival records on the arrival: the entry's `issues`, the `missingIntakeForms`, and every plan benefit and scheduled event found, each with its own `issues`. Each issue is in one place. Rendered by your app in its own language. With `scheduledEventSearchWindow`, `scheduledEvents` also lists the events found only in that window, with `OUTSIDE_ENTRY_WINDOW`; Create Arrival never records those.  
     - name: issues | type: array<EntryIssue> | description: The issues of the entry as a whole. The issues decide the status the evaluation gives: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. When a site user lets the person in (afterwards with Override Arrival as Granted, or beforehand with `denialOverride` on Create Arrival), the status is `GRANTED` whatever the issues, and the issues show what was overridden. On an arrival, `PRICING_PLANS_UNAVAILABLE` and `CONTACTS_UNAVAILABLE` are found only that way, with `denialOverride`, since otherwise Create Arrival fails with `UNAVAILABLE`; Check Eligibility reports them without failing. A `DENIED` arrival always has at least one. Empty when nothing stood in the way.  | validation: maxItems 3
         - enum:
         -     NO_ELIGIBLE_GRANT: No grant the person holds admits them into this area now. A grant is what can grant entry: a plan benefit (`planBenefits`) or a scheduled event they are booked on (`scheduledEvents`), the same two kinds an arrival records in `planBenefit` or `scheduledEvent` once granted. Either nothing was found (`planBenefits` and `scheduledEvents` are empty), or everything found has an issue of its own, which says why. A contact whose site member's status (`memberInfo.status` in Contacts) is `BLOCKED`, `DELETED` or `OFFLINE` holds no plans here, so it finds none. Also reported when a credit pack would admit but the person is booked on an event here and now that still waits for approval: no credit is spent while the booking may be approved moments later (the event carries `PENDING_CONFIRMATION`). Declines at creation; site collaborators override, or sell a plan, approve the booking or renew the plan and create a new arrival. Not reported when Pricing Plans or Contacts did not answer: `PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` takes its place.
         -     INTAKE_FORM_MISSING: Not reported yet, since intake forms aren't checked at entry. Once they are, it means the person has no valid submission for at least one intake form the area's policy requires: never submitted, expired, canceled, or pending approval. The forms are listed in `missingIntakeForms`. Declines at creation when a missing form has `blocksEntry`; otherwise grants, with the issue kept on the arrival so site collaborators can chase the paperwork.
         -     RECENT_ENTRY: The person was already granted entry into this area within the last 15 minutes and a credit would be spent again: a retried scan, a re-entry, or a guest on the same credential. The earlier entry counts whatever granted it: a credit, an unlimited plan, a scheduled event or an override, and the 15 minutes count from that arrival's `createdDate`, or for an overridden arrival from its `overriddenDate`, when a site user let the person in. Declines at creation; the override spends a credit. Reported only when this entry would spend a credit: not when an unlimited plan or a scheduled event admits now.
         -     PRICING_PLANS_UNAVAILABLE: Pricing Plans didn't answer (it couldn't be reached, didn't answer in time, or failed on its side; any of these is an outage), so plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a site user's decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing; Override Arrival as Granted does not call Pricing Plans. `planBenefits` is empty, no `planBenefit` is recorded and nothing is redeemed; scheduled events and intake forms are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT`, never with it: plan benefits were not checked, so the person may hold one that admits. An issue a scheduled event has of its own stays on that event in `eligibilityDetails`.
         -     CONTACTS_UNAVAILABLE: Contacts didn't answer (it couldn't be reached, didn't answer in time, or failed on its side; any of these is an outage), so the person's member is unknown and plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a site user's decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing. `planBenefits` is empty, no `planBenefit` is recorded, nothing is redeemed, and `contactDetails` has the contact ID alone, with no name or picture; scheduled events, read by contact, are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT` and `PRICING_PLANS_UNAVAILABLE`, never with them: Pricing Plans is not read without the member.
     - name: missingIntakeForms | type: array<MissingIntakeForm> | description: Every intake form the area's policy requires and the person has no valid submission for, with its `blocksEntry`, so an app can point site collaborators to the right form. Empty unless `issues` contains `INTAKE_FORM_MISSING`, so always empty for now: intake forms aren't checked at entry yet.  | validation: maxItems 20
        - name: formId | type: string | description: GUID of the intake form, from the Intake Forms API, as listed in the area's policy.  | validation: format GUID
        - name: blocksEntry | type: boolean | description: Whether this missing form blocks entry, as configured on the area's policy (`policy.intakeForms[].blocksEntry` in the Areas API). `false`: the arrival is granted and site collaborators are warned. `true`: the arrival is denied until the form is submitted; site collaborators can still override.  
     - name: planBenefits | type: array<PlanBenefitEligibility> | description: The person's Pricing Plans benefits allowed into this area, each a `planBenefit` with its own `issues`: empty means the benefit admits. Listed on a `DENIED` arrival too, admitting ones included, so an override can take one later. The grant picks one by the rule on the arrival's `planBenefit` and records it there. Listed in the order of that rule, so the first is the one a grant takes; at most 20 are listed, the first 20 in that order. Empty when the person holds no benefit for this area, and when the status of the contact's site member (`memberInfo.status` in Contacts) is `BLOCKED`, `DELETED` or `OFFLINE`, since such a member holds no plans here.  | validation: maxItems 20
        - name: planBenefit | type: PlanBenefit | description: The benefit found, as `planBenefit` records it on an arrival.  | read-only: true 
           - name: poolId | type: string | description: GUID of the Pricing Plans benefit pool the member holds: the plan or pack they bought. Read-only to Arrivals.  | read-only: true | validation: format GUID
           - name: benefitKey | type: string | description: Key of the benefit inside the pool, as Pricing Plans defines it; a pool can hold several benefits. Read-only to Arrivals.  | read-only: true | validation: minLength 1, maxLength 64
           - name: displayName | type: string | description: Name to display, in the site's language ("10-Class Pack", "Monthly Unlimited"). The owner's own wording; not translated.  | read-only: true | validation: maxLength 200
           - name: type | type: PlanBenefitType | description: Whether the benefit counts entries: a credit pack spends a credit per entry, an unlimited plan counts nothing. Set by the server from the benefit's configuration in Pricing Plans.  | read-only: true 
                 - enum:
                 -     CREDIT: A credit pack: the benefit carries a credit configuration in Pricing Plans, and redeeming an entry spends one credit from its balance ("10-Class Pack").
                 -     UNLIMITED: An unlimited plan: no credit configuration, nothing is counted ("Monthly Unlimited"). The plan's own usage policy (a fixed interval, a rate limit such as three entries a week) may still apply, and Pricing Plans enforces it. Whether the plan is paid once or by subscription is not what this says.
        - name: issues | type: array<PlanBenefitIssue> | description: Why the benefit does not admit, in Pricing Plans' own words where it has one. Empty: the benefit admits. At most one is reported, since Pricing Plans gives one reason.  | read-only: true | validation: maxItems 1
             - enum:
             -     PLAN_NOT_ACTIVE: The benefit's plan isn't active at the time of the entry (ended, canceled, paused, not started yet, or for a moment while it's being renewed), as Pricing Plans reports. Site collaborators override, or renew the plan and create a new arrival.
             -     NOT_ENOUGH_BALANCE: A credit pack with no credits left, as Pricing Plans reports. Site collaborators override, or sell credits and create a new arrival.
             -     OUTSIDE_ACCESS_HOURS: The plan's usage policy does not allow entry at this hour or on this day, or another rule of the plan refuses entry, as Pricing Plans reports. A used-up limit on its own is `USAGE_LIMIT_REACHED`.
             -     USAGE_LIMIT_REACHED: The plan's usage policy limits how often it can be used, such as three entries a week, and that limit is used up for the current period, as Pricing Plans reports. Site collaborators override, or the client comes back in the next period.
     - name: scheduledEvents | type: array<ScheduledEventEligibility> | description: The scheduled events the person is booked on at this area's location inside the area's entry window, each with its own `issues`: empty means the event admits. Listed on a `DENIED` arrival too, admitting ones included, so an override can take one later. Check Eligibility with a `scheduledEventSearchWindow` also lists the events that start inside that window, with `OUTSIDE_ENTRY_WINDOW`; Create Arrival never does. At most 20 are listed: the events inside the area's window first, then the others by start time, earliest first. Always empty while the area's `scheduledEventsPolicy.entryGrantingAppIds` is empty.  | validation: maxItems 20
        - name: scheduledEvent | type: ScheduledEvent | description: The event found, as `scheduledEvent` records it on an arrival.  | read-only: true 
           - name: eventId | type: string | description: GUID of the scheduled event, as the provider in `appId` knows it. For an event from the Wix Calendar, the GUID in the Wix Calendar Events API.  | read-only: true | validation: minLength 1, maxLength 250
           - name: displayName | type: string | description: Name to display, in the site's language ("Tue 18:00 Reformer"). Not translated.  | read-only: true | validation: maxLength 200
           - name: appId | type: string | description: App GUID of the provider the event came from: the app that owns it on the Wix Calendar, such as Wix Bookings. Scheduled events are read from the Wix Calendar today; a provider of scheduled events of its own may later supply them, and is then identified here.  | read-only: true | validation: format GUID
        - name: issues | type: array<ScheduledEventIssue> | description: Why the event does not admit. Empty: the event admits. At most one is reported: when both apply, `OUTSIDE_ENTRY_WINDOW` wins over `PENDING_CONFIRMATION`, since approving the booking would not help outside the window.  | read-only: true | validation: maxItems 1
             - enum:
             -     PENDING_CONFIRMATION: The person is booked on the event here and now, but the booking still waits for the business's approval. Only an appointment can be pending. A credit pack is not spent instead (`NO_ELIGIBLE_GRANT`), since the booking may be approved moments later; an unlimited plan allowed into the area still admits. Site collaborators approve the booking and create a new arrival, or override.
             -     OUTSIDE_ENTRY_WINDOW: The person is booked on the event, but now is outside the area's entry window for it (`policy.scheduledEventsPolicy.entryWindow` in the Areas API). Only on an event listed by a Check Eligibility with `scheduledEventSearchWindow`; never on an arrival, since Create Arrival does not find events outside the area's window.
  - name: recentArrival | type: RecentArrival | description: Present when `eligibilityDetails.issues` contains `RECENT_ENTRY`: the earlier arrival that granted this person this area within the last 15 minutes, for an app to tell site collaborators "let in 4 minutes ago".  
     - name: arrivalId | type: string | description: GUID of that arrival.  | validation: format GUID
     - name: _createdDate | type: Date | description: That arrival's `createdDate`, for an app to tell site collaborators "let in 4 minutes ago". For an arrival overridden after it was written, it is the time of the denial; for every overridden arrival the 15 minutes count from its `overriddenDate`: call Get Arrival to show when the person was let in. What granted it is on that arrival: call Get Arrival with `arrivalId` and read its `planBenefit` or `scheduledEvent`.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SEARCH_WINDOW_INVALID | Description: `scheduledEventSearchWindow.endDate` is not after its `startDate`.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTACT_NOT_FOUND | Description: Couldn't find the contact. `contactId` isn't a contact of the site, including a contact that was merged into another: read the contact again to get the surviving contact's GUID.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ENTRANCE_NOT_FOUND | Description: Couldn't find the entrance. `entranceId` names no entrance of any area of the site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: AREA_ARCHIVED | Description: The entrance's area is archived.


```

### Examples

### Check whether a client can enter right now
Nothing is recorded or redeemed. An unlimited plan admits the client, and their old credit pack is empty.

```javascript
import { arrivals } from "@wix/arrivals";

async function checkEligibility() {
  const response = await arrivals.checkEligibility(
    "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
    { entranceId: "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59" },
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "contactDetails": {
 *     "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
 *     "firstName": "Noa",
 *     "lastName": "Levi"
 *   },
 *   "status": "GRANTED",
 *   "eligibilityDetails": {
 *     "planBenefits": [
 *       {
 *         "planBenefit": {
 *           "poolId": "8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b",
 *           "benefitKey": "unlimited-access",
 *           "displayName": "Monthly Unlimited",
 *           "type": "UNLIMITED"
 *         }
 *       },
 *       {
 *         "planBenefit": {
 *           "poolId": "2f6e8a1c-3b4d-4e5f-9a0b-1c2d3e4f5a6b",
 *           "benefitKey": "class-credits",
 *           "displayName": "10-Class Pack",
 *           "type": "CREDIT"
 *         },
 *         "issues": ["NOT_ENOUGH_BALANCE"]
 *       }
 *     ]
 *   }
 * }
 */

```

### checkEligibility (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { arrivals } from '@wix/arrivals';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { arrivals },
  // Include the auth strategy and host as relevant
});


async function checkEligibility(contactId,options) {
  const response = await myWixClient.arrivals.checkEligibility(contactId,options);
};
```

---