> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genlook.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Availability

> Check whether the store can run try-ons before opening the widget.

Check whether your shop can run try-ons right now. Cached for 2 minutes on both client and server.

<Note>
  On JavaScript, the [`@genlook/storefront` SDK](/docs/virtual-tryon/sdk) is the recommended integration: it calls this endpoint for you, along with the rest of the try-on flow.
</Note>

With the SDK:

```javascript SDK theme={null}
const { allowed } = await genlook.checkCredits();
```

## Request

No parameters. The shop is identified by the publishable key.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.genlook.app/storefront/v1/availability" \
    -H "Authorization: Bearer pk_your_key_here" \
    -H "X-Genlook-Anonymous-Id: anon_..."
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.genlook.app/storefront/v1/availability', {
    headers: {
      'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
      'X-Genlook-Anonymous-Id': anonymousId,
    },
  });
  const { allowed, storeId } = await response.json();
  ```
</RequestExample>

## Response

<ResponseField name="allowed" type="boolean" required>
  `true` if try-ons are available, `false` if quota is exhausted.
</ResponseField>

<ResponseField name="storeId" type="string" required>
  The Genlook store ID for the shop.
</ResponseField>

<ResponseExample>
  ```json Available theme={null}
  {
    "allowed": true,
    "storeId": "store_abc123"
  }
  ```

  ```json Unavailable theme={null}
  {
    "allowed": false,
    "storeId": "store_abc123"
  }
  ```
</ResponseExample>

<Note>
  This endpoint fails closed. If the check errors, or if no billing plan can be resolved for the shop, it returns `allowed: false`. Treat `allowed: false` as "do not offer a try-on". The [Create Try-On](/docs/virtual-tryon/endpoints/create-try-on) endpoint performs the definitive quota check and will return `QUOTA_EXCEEDED` if needed.
</Note>

## Current plan

```
GET /storefront/v1/plan
```

Return the shop's current billing plan name. The shop is identified by the publishable key. Cached for 1 hour on the server.

<ResponseField name="plan" type="string" required>
  The plan name for the shop. Defaults to `free` when no paid plan is resolved.
</ResponseField>

<ResponseExample>
  ```json Success theme={null}
  {
    "plan": "free"
  }
  ```
</ResponseExample>
