# `PolarExpress.Events.SubscriptionUpdated`
[🔗](https://github.com/jeffhuen/polar_express/blob/main/lib/polar_express/events/subscription_updated.ex#L2)

Webhook event for `subscription.updated`.

Sent when a subscription is updated. This event fires for all changes to the subscription, including renewals.

If you want more specific events, you can listen to `subscription.active`, `subscription.canceled`, `subscription.past_due`, and `subscription.revoked`.

To listen specifically for renewals, you can listen to `order.created` events and check the `billing_reason` field.

**Discord & Slack support:** On cancellation, past due, and revocation. Renewals are skipped.

The `data` field contains a `PolarExpress.Schemas.Subscription` struct.

# `t`

```elixir
@type t() :: %PolarExpress.Events.SubscriptionUpdated{
  data: PolarExpress.Schemas.Subscription.t(),
  timestamp: String.t(),
  type: String.t()
}
```

* `type` - Always `"subscription.updated"`.
* `data` - The event payload. See `PolarExpress.Schemas.Subscription`.
* `timestamp` - ISO 8601 timestamp of when the event occurred.

# `event_type`

```elixir
@spec event_type() :: String.t()
```

Returns the event type string.

---

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