Events and Webhooks 

Events 

Any change that happens to the system is captured as an event. These include changes relating to customers, subscriptions, plans, addons and coupons.

Event logs relating to your customers and subscriptions can be found on the UI under Logs > Events. Events related to plans, coupons and addons, on the other hand, are logged in their respective details pages.

You can also refer to the API  for more information on the events.

Webhooks 

For a better integration between Chargebee and your application, Chargebee provides you with webhooks. When configured, a webhook is used to send out an event notification to your service.

Once you've configured the URL, Chargebee will post the event as a JSON to your webhook URL. For example, if a "subscription_activated" event occurs, then a notification is sent to the specified URL. You can configure webhook alerts to keep track of any events relating to your subscriptions, plans, addons and coupons.

Why should I use webhooks? 

When your application needs to know and act upon certain events when they occur in your Chargebee account such as an account being canceled or a payment that failed, you can use webhooks to notify your application. Webhook notifications are usually posted asynchronously and so are not recommended for time-critical applications. When time is critical, it is better to use the Chargebee API  to check for events.

Here's a list of event types  that currently generates webhooks.

Handling Webhooks 

Chargebee needs to get a status code 2XX reply from the configured URL to confirm that the notification sent via HTTP POST has been successfully delivered. If any webhook times out, Chargebee will cancel and retry. Up to 7 retries happen for every webhook that fails and at exponential time intervals.

Information

Chargebee supports multiple API versions. Hence, while creating webhooks, you need to specify the API version used for the webhook. Learn more.

Configuring Webhooks 

To know how to configure your webhooks, click here.

Was this article helpful?
Loading…