Chargebee Integration
Connect your Chargebee account to Windback via the custom webhook endpoint to automatically detect cancellations, failed payments, and successful recoveries.Chargebee does not have a native Windback integration. This guide uses a lightweight Node.js relay function that receives Chargebee webhooks and forwards them to Windback’s custom webhook endpoint.
Webhook URL
Your Windback custom webhook URL is:pub_ and is found in Settings > API Keys.
Setup
Deploy the Relay Function
Deploy the Node.js relay function below to your server or a serverless platform (Vercel, AWS Lambda, etc.). This function receives Chargebee webhooks, maps the payload, and forwards it to Windback.
Add the Webhook in Chargebee
- Go to Chargebee Dashboard > Settings > Configure Chargebee > Webhooks
- Click Add Webhook
- Paste the URL of your deployed relay function
- Select the events listed below
- Click Create
Select Webhook Events
Enable the following events in Chargebee:
| Chargebee Event | Windback Event Type | Description |
|---|---|---|
subscription_cancelled | cancellation | Customer canceled their subscription |
payment_failed | payment_failed | Payment attempt failed |
payment_succeeded | payment_recovered | Payment succeeded after a previous failure |
Data Mapping
The relay function maps Chargebee fields to Windback’s custom webhook format:| Chargebee Field | Windback Field | Notes |
|---|---|---|
content.customer.email | customer_email | Customer email address |
content.customer.first_name + last_name | customer_name | Combined full name |
content.subscription.plan_id | plan_name | Chargebee plan identifier |
content.subscription.plan_amount | mrr | Amount in cents |
content.subscription.currency_code | currency | ISO 4217 code (e.g., usd) |
content.subscription.created_at | tenure_days | Calculated from subscription start |
content.subscription.cancel_reason | cancel_reason | Chargebee cancel reason string |
Relay Function
Webhook Resilience
Windback’s custom webhook endpoint always returns HTTP 200 regardless of internal processing status. Your relay function should also always return 200 to Chargebee to prevent webhook retries and eventual deactivation.
Chargebee supports webhook signature verification via the
X-Chargebee-Webhook-Api-Key header. We recommend validating this in your relay function before forwarding to Windback. See Chargebee’s webhook docs for details.