Notification kinds

The notification kind, returned by calling kind on the notification object, reveals what triggered the webhook. For a Subscription webhook, $webhookNotification->kind will be one of the following:

  • Braintree_WebhookNotification::SUBSCRIPTION_CANCELED
  • Braintree_WebhookNotification::SUBSCRIPTION_CHARGED_SUCCESSFULLY
  • Braintree_WebhookNotification::SUBSCRIPTION_CHARGED_UNSUCCESSFULLY
  • Braintree_WebhookNotification::SUBSCRIPTION_EXPIRED
  • Braintree_WebhookNotification::SUBSCRIPTION_TRIAL_ENDED
  • Braintree_WebhookNotification::SUBSCRIPTION_WENT_ACTIVE
  • Braintree_WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE

The following table describes the conditions that trigger each kind of webhook.

Notification Type Description
subscription_canceled

A subscription is canceled.

subscription_charged_successfully

A subscription successfully moves to the next billing cycle. This will also occur when either a new transaction is created mid-cycle due to proration on an upgrade or a billing cycle is skipped due to the presence of a negative balance that covers the cost of the subscription.

subscription_charged_unsuccessfully

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.

subscription_expired

A subscription reaches the specified number of billing cycles and expires.

subscription_trial_ended

A subscription's trial period ends.

subscription_went_active

A subscription's first authorized transaction is created. Subscriptions with trial periods will never trigger this notification.

subscription_went_past_due

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.

Attributes

kind enum

The kind of webhook notification.

timestamp date

The UTC time at which the webhook was triggered.

subscription

A Braintree_Subscription object.

Contains an array of the 20 most recent transactions associated with the subscription.

Still have questions?

If you can’t find an answer, contact our Support team.