> ## 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.

# Check Credits

> Check whether the store has try-on credits available before opening the widget.

Check whether your shop has credits available to create generations. Cached for 2 minutes on both client and server.

## Request

No parameters. Shop is identified via app proxy authentication.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://your-store.myshopify.com/apps/proxy_genlook-x/public/check-credits"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('/apps/proxy_genlook-x/public/check-credits');
  const { allowed, storeId } = await response.json();
  ```
</RequestExample>

## Response

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

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

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

  ```json No Credits 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 Generation](/docs/virtual-tryon/endpoints/create-generation) endpoint performs the definitive quota check and will return `QUOTA_EXCEEDED` if needed.
</Note>

## Current plan

```
GET /public/current-plan
```

Return the shop's current billing plan name. Shop is identified via app proxy authentication. 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>
