Webhooks

Subscriptionanchor

Notification kindsanchor

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:

  • Braintree::WebhookNotification::Kind::SubscriptionBillingSkipped
  • Braintree::WebhookNotification::Kind::SubscriptionCanceled
  • Braintree::WebhookNotification::Kind::SubscriptionChargedSuccessfully
  • Braintree::WebhookNotification::Kind::SubscriptionChargedUnsuccessfully
  • Braintree::WebhookNotification::Kind::SubscriptionExpired
  • Braintree::WebhookNotification::Kind::SubscriptionTrialEnded
  • Braintree::WebhookNotification::Kind::SubscriptionWentActive
  • Braintree::WebhookNotification::Kind::SubscriptionWentPastDue

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

Notification Type

Description

subscription_billing_skipped

A subscription's billing cycle is skipped due to the presence of a negative or zero balance that covers the cost of the subscription.

subscription_canceled

A subscription is canceled.

subscription_charged_successfully

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.

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, 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.

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.

Attributesanchor

kindenum

The kind of webhook notification.

timestampdate

The UTC time at which the webhook was triggered.

subscription

A Subscription object.

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