Store the subscription from each subscription.* event, keyed by its id, and decide access from the stored copy:

Handle events idempotently

  • Events can arrive more than once and out of order. Upsert the subscription by id, and ignore an event whose createdAt is older than the copy you stored.
  • Grant access on subscription.created for a trial, and on subscription.created or subscription.renewed for a paid start.
  • Re-evaluate access on every subscription.updated, subscription.past_due and subscription.cancelled.
  • When in doubt, read GET /subscriptions/:id; it is always current.

Which events to store