> 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

# CheckEligibilityByCredential

# Package: arrivals

# Namespace: CredentialArrivalsService

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

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

## Introduction

Checks whether the holder of a presented credential would be granted entry at an entrance, into the area it
belongs to, without recording anything or redeeming anything.

This is Check Eligibility in the Arrivals Service with the person identified by what they present instead
of by `contactId`: the token is resolved to its credential and holder, then the same
evaluation runs. A scanner app uses it to show a client their standing without admitting them: their benefits
for this area and their scheduled events, each with its own issue, the forms they are missing, and the
status a scan would get. It takes the same `entranceId` as Create Arrival By Credential, so a scanner checks
and records at the one position it holds. The response has the same fields Check Eligibility returns, always
against the area's own entry window, so that it predicts the Create Arrival that follows the scan. A token that does not
resolve to a live credential fails with `BAD_SIGNATURE` or `TOKEN_REVOKED`, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; when
Pricing Plans or Contacts can't be reached the call does not fail and reports the outage in
`eligibilityDetails.issues`, as Check Eligibility does. To record the entry, call
[Create Arrival By Credential](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival-by-credential.md).

---

## REST API

### Schema

```
 Method: checkEligibilityByCredential
 Description: Checks whether the holder of a presented credential would be granted entry at an entrance, into the area it belongs to, without recording anything or redeeming anything.  This is Check Eligibility in the Arrivals Service with the person identified by what they present instead of by `contactId`: the token is resolved to its credential and holder, then the same evaluation runs. A scanner app uses it to show a client their standing without admitting them: their benefits for this area and their scheduled events, each with its own issue, the forms they are missing, and the status a scan would get. It takes the same `entranceId` as Create Arrival By Credential, so a scanner checks and records at the one position it holds. The response has the same fields Check Eligibility returns, always against the area's own entry window, so that it predicts the Create Arrival that follows the scan. A token that does not resolve to a live credential fails with `BAD_SIGNATURE` or `TOKEN_REVOKED`, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; when Pricing Plans or Contacts can't be reached the call does not fail and reports the outage in `eligibilityDetails.issues`, as Check Eligibility does. To record the entry, call [Create Arrival By Credential](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival-by-credential.md).
 URL: https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility-by-credential
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  entranceId
 Method parameters: 
     - name: token | type: string | description: The presented token: the scanned QR payload, the credential's signed token. Minted by Generate Contact Credential Token in the Contact Credentials API; a QR code's payload is the bare token.  | validation: maxLength 2048
   param name: entranceId | type: entranceId | description: GUID of the entrance the credential is presented at, one of an area's entrances. Eligibility is checked for the area it belongs to. | required: true | validation: format GUID
 Return type: CheckEligibilityByCredentialResponse
  - name: contactDetails | type: ContactDetails | description: The holder of the presented credential: 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.  
     - 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 by contact GUID with `denialOverride`, since Create Arrival By Credential carries no override.  
     - 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. `scheduledEvents` lists only the events inside the area's entry window, so `OUTSIDE_ENTRY_WINDOW` never appears here.  
     - 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: BAD_SIGNATURE | Description: The token's signature doesn't verify.
   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. Reload the scanner's entrances and pick an active one.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOKEN_REVOKED | Description: The token verifies but was revoked: the credential's tokens have since been reset. Ask the client to refresh their pass. Also returned when the credential itself no longer exists (deleted by a CRM contact merge or a privacy deletion) or its holder is no longer a contact of the site.


```

### Examples

### Check Eligibility By Credential
Checks a client's standing without recording anything; their only credit pack for this area has no credits left, so a scan would be denied

```curl
curl -X POST \
  'https://www.wixapis.com/arrivals/v1/arrivals/check-eligibility-by-credential' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "token": "eyJhbGciOiJIUzI1NiJ9.<PAYLOAD>.<SIGNATURE>",
    "entranceId": "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59"
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.arrivals.arrivals.checkEligibilityByCredential(options)
 Description: Checks whether the holder of a presented credential would be granted entry at an entrance, into the area it belongs to, without recording anything or redeeming anything.  This is Check Eligibility in the Arrivals Service with the person identified by what they present instead of by `contactId`: the token is resolved to its credential and holder, then the same evaluation runs. A scanner app uses it to show a client their standing without admitting them: their benefits for this area and their scheduled events, each with its own issue, the forms they are missing, and the status a scan would get. It takes the same `entranceId` as Create Arrival By Credential, so a scanner checks and records at the one position it holds. The response has the same fields Check Eligibility returns, always against the area's own entry window, so that it predicts the Create Arrival that follows the scan. A token that does not resolve to a live credential fails with `BAD_SIGNATURE` or `TOKEN_REVOKED`, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; when Pricing Plans or Contacts can't be reached the call does not fail and reports the outage in `eligibilityDetails.issues`, as Check Eligibility does. To record the entry, call [Create Arrival By Credential](https://dev.wix.com/docs/api-reference/business-solutions/bookings/arrivals/arrival/create-arrival-by-credential.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.entranceId, options
 Method parameters: 
   param name: options | type: CheckEligibilityByCredentialOptions  none | required: true 
     - name: token | type: string | description: The presented token: the scanned QR payload, the credential's signed token. Minted by Generate Contact Credential Token in the Contact Credentials API; a QR code's payload is the bare token.  | validation: maxLength 2048
        - name: entranceId | type: string | description: GUID of the entrance the credential is presented at, one of an area's entrances. Eligibility is checked for the area it belongs to. | required: true | validation: format GUID
 Return type: PROMISE<CheckEligibilityByCredentialResponse>
  - name: contactDetails | type: ContactDetails | description: The holder of the presented credential: 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.  
     - 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 by contact GUID with `denialOverride`, since Create Arrival By Credential carries no override.  
     - 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. `scheduledEvents` lists only the events inside the area's entry window, so `OUTSIDE_ENTRY_WINDOW` never appears here.  
     - 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: BAD_SIGNATURE | Description: The token's signature doesn't verify.
   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. Reload the scanner's entrances and pick an active one.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOKEN_REVOKED | Description: The token verifies but was revoked: the credential's tokens have since been reset. Ask the client to refresh their pass. Also returned when the credential itself no longer exists (deleted by a CRM contact merge or a privacy deletion) or its holder is no longer a contact of the site.


```

### Examples

### Check a client's standing from a scanned pass
Nothing is recorded or redeemed. The client's only credit pack for this area has no credits left, so a scan would be denied.

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

async function checkEligibilityByCredential() {
  const response = await arrivals.checkEligibilityByCredential({
    token: "eyJhbGciOiJIUzI1NiJ9.<PAYLOAD>.<SIGNATURE>",
    entranceId: "1f6d2c3a-9b8e-4d7c-a6f5-0e1d2c3b4a59",
  });

  return response;
}

/* Promise resolves to:
 * {
 *   "contactDetails": {
 *     "contactId": "3c2f9a4e-1b7d-4e8a-9f0c-6d5b2a1e8f47",
 *     "firstName": "Noa",
 *     "lastName": "Levi"
 *   },
 *   "status": "DENIED",
 *   "eligibilityDetails": {
 *     "issues": ["NO_ELIGIBLE_GRANT"],
 *     "planBenefits": [
 *       {
 *         "planBenefit": {
 *           "poolId": "2f6e8a1c-3b4d-4e5f-9a0b-1c2d3e4f5a6b",
 *           "benefitKey": "class-credits",
 *           "displayName": "10-Class Pack",
 *           "type": "CREDIT"
 *         },
 *         "issues": ["NOT_ENOUGH_BALANCE"]
 *       }
 *     ]
 *   }
 * }
 */

```

### checkEligibilityByCredential (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 checkEligibilityByCredential(options) {
  const response = await myWixClient.arrivals.checkEligibilityByCredential(options);
};
```

---