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

# Entitlements

> Non-consumable unlocks and time-limited access with PlaytoliaEntitlements

`PlaytoliaEntitlements` tracks what the player has permanently or temporarily unlocked through purchases. Entitlements are granted automatically when a purchase completes.

### Checking entitlements

```c# theme={null}
var all    = PlaytoliaEntitlements.GetAllEntitlements();
var single = PlaytoliaEntitlements.GetEntitlementByGrantId("vip_pass");
var list   = PlaytoliaEntitlements.GetEntitlementsByGrantId("vip_pass");
var byItem = PlaytoliaEntitlements.GetEntitlementByItemId(storeItemId);
```

<Info>`GetEntitlementByGrantId` and `GetEntitlementByItemId` only return **valid, non-expired** entitlements. A `null` result means the player doesn't have a current entitlement — no need to check `IsExpired` yourself.</Info>

### Checking access

```c# theme={null}
var premium = PlaytoliaEntitlements.GetEntitlementByGrantId("premium_pass");
if (premium != null)
    EnablePremiumFeatures();
```

### PlayerEntitlement fields

`Id`, `GrantId`, `Amount`, `CreatedAt`, `ExpiresAt`, `StoreItem`, `IsExpired`

<Warning>If you use `GetAllEntitlements()` and filter manually, check `IsExpired` — the full list includes expired entitlements. The targeted getters do not.</Warning>

### Listening to changes

```c# theme={null}
void Start()    => PlaytoliaEntitlements.AddListener(UpdateAccess);
void OnDestroy() => PlaytoliaEntitlements.RemoveListener(UpdateAccess);
```

<CardGroup cols={2}>
  <Card title="Subscriptions" icon="rotate" href="/for-unity/billing/subscriptions">Recurring access management</Card>
  <Card title="In-game Stores" icon="store" href="/for-unity/billing/in-game-stores">Purchases that grant entitlements</Card>
</CardGroup>
