Webhooks overview

Use webhooks to integrate, automate and track changes in Bunny

Bunny can send webhooks when various events happen during a customer or subscription lifecycle. For example, when a new subscription is created or cancelled or perhaps when a payment failed.

There are 2 ways that webhooks are configured in Bunny

  • Platform provisioning - When provisioning is enabled on a platform Bunny will send webhooks when a subscription state changes. e.g. Trial to paid or an increase in quantities.

  • Workflows - A webhook action can be used to send default or custom payloads based on workflow conditions.

Platform webhooks

Bunny includes the following webhooks to help with enabling self-service or product-led saas applications using the Bunny customer portal.

  • Tenant provisioning change - This is sends the current subscription state and features that should be enabled on a tenant. It will be sent on creation, cancellation and any other change that happens to the subscription.

  • Checkout validation - This hook is useful if you want to validate that a user can change plan before allowing it via the Bunny customer portal.

Configure a platform webhook

Navigate to the Settings > Platforms section and toggle Provisioning enabled to the on position.

Workflow webhooks

A webhook action can be added to any workflow. By default it will send a JSON payload containing the fields of the object that is the target of the workflow.

For example, when targeting the Invoice model.

Available webhook objects

The following workflow objects can be used to trigger webhooks:

  • Account

  • Bill Run

  • Contact

  • Coupon

  • Deal

  • Email

  • Entity

  • Event

  • Feature Usage

  • Feature

  • Financial Account

  • Invoice

  • Job

  • Journal Entry Line

  • Payment Method

  • Payment

  • Plan

  • Price List Charge

  • Price List

  • Product

  • Quote

  • Revenue Movement

  • Subscription

  • Tenant

  • User

Custom webhook payloads

When configuring a workflow with a webhook action you can customize the JSON payload with templated values based on the workflows target object.

For example, If the object was a Subscription you could extract the state into a custom payload

Set up a webhook endpoint

Webhook endpoints are configured in the Platforms section of Bunny you'll find this under the Products > Platforms menu.

  • Set the url of your applications webhook recieving endpoint.

  • Click the Test webhook action to send a sample webhook request to your endpoint.

If you are developing locally and want to test your webhook endpoint we suggest using Ngrok to expose your endpoint to the internet. Alternatively you could use a free service like RequestBin to setup a temporary webhook endpoint.

Last updated

Was this helpful?