Polar Integration
Connect your Polar account to Windback via the custom webhook endpoint to detect subscription cancellations and changes.Polar does not have a native Windback integration. This guide uses a lightweight Node.js relay function that receives Polar 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 Polar webhooks, maps the payload, and forwards it to Windback.
Add the Webhook in Polar
- Go to Polar Dashboard > Settings > Webhooks
- Click Add Endpoint
- Paste the URL of your deployed relay function
- Select the events listed below
- Save the webhook
Select Webhook Events
Enable the following events in Polar:
| Polar Event | Windback Event Type | Description |
|---|---|---|
subscription.canceled | cancellation | Customer canceled their subscription |
subscription.updated | Conditional | Check the status field — forward as payment_failed if status is past_due, or payment_recovered if status returns to active |
Data Mapping
The relay function maps Polar fields to Windback’s custom webhook format:| Polar Field | Windback Field | Notes |
|---|---|---|
data.user.email | customer_email | Subscriber email address |
data.user.username | customer_name | Polar username |
data.product.name | plan_name | Product name |
data.amount | mrr | Amount in cents |
data.currency | currency | ISO 4217 code |
data.created_at | tenure_days | Calculated from subscription start |
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 Polar to prevent webhook retries.
Polar signs webhook payloads using a shared secret. We recommend verifying the signature in your relay function before forwarding to Windback. See Polar’s webhook documentation for details.