The notification kind, returned by calling kind on the notification object, reveals what triggered the webhook. The webhook_notification.kind for Subscription webhooks will be one of the following:
The following table describes the conditions that trigger each kind of webhook.
A subscription's billing cycle is skipped due to the presence of a negative or zero balance that covers the cost of the subscription.
A subscription is canceled.
A subscription successfully moves to the next billing cycle. This will also occur when a new transaction is created mid-cycle due to proration on an upgrade.
A subscription already exists and fails to create a successful charge. This will not trigger on manual retries or if the attempt to create a subscription fails due to an unsuccessful transaction.
A subscription reaches the specified number of billing cycles and expires.
A subscription's trial period ends.
A subscription's first authorized transaction is created, or a successful transaction moves a subscription from the Past Due status to the Active status. Subscriptions with trial periods will not trigger this notification when they move from the trial period into the first billing cycle.
A subscription has moved from the Active status to the Past Due status. This will only be triggered when the initial transaction in a billing cycle is declined. Once the status moves to past due, it will not be triggered again in that billing cycle.
The kind of webhook notification.
The UTC time at which the webhook was triggered.
Contains an array of the 20 most recent transactions associated with the subscription.