# `GameServer.Payments.Entitlement`
[🔗](https://github.com/appsinacup/game_server/blob/v1.0.26/lib/game_server/payments/entitlement.ex#L1)

Entitlement struct from GameServer.

This is a stub module for SDK type definitions. The actual struct
is provided by GameServer at runtime.

Handed to `after_entitlement_changed/1`.

## Fields

- `id` - Entitlement ID (UUIDv7 string)
- `user_id` - Holder (UUIDv7 string)
- `product_id` - Product that granted it (UUIDv7 string)
- `key` - The entitlement key the game checks (string)
- `status` - `"active"` or `"revoked"` (string)
- `starts_at` - When it became active
- `expires_at` - When it lapses; nil for permanent entitlements
- `revoked_at` - When it was revoked, if it was
- `metadata` - Arbitrary entitlement metadata (map)

# `t`

```elixir
@type t() :: %GameServer.Payments.Entitlement{
  expires_at: DateTime.t() | nil,
  id: String.t(),
  inserted_at: DateTime.t(),
  key: String.t(),
  metadata: map(),
  product_id: String.t(),
  revoked_at: DateTime.t() | nil,
  source_purchase_id: String.t() | nil,
  starts_at: DateTime.t() | nil,
  status: String.t(),
  updated_at: DateTime.t(),
  user_id: String.t()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
