LemonSqueezy Integration
Connect your LemonSqueezy account to Windback via the custom webhook endpoint to detect subscription cancellations, failed payments, and successful recoveries.LemonSqueezy does not have a native Windback integration. This guide uses a lightweight Node.js relay function that receives LemonSqueezy 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 LemonSqueezy webhooks, maps the payload, and forwards it to Windback.
Add the Webhook in LemonSqueezy
- Go to LemonSqueezy Dashboard > Settings > Webhooks
- Click Add Webhook (or the + button)
- Paste the URL of your deployed relay function
- Enter a signing secret and store it securely
- Select the events listed below
- Click Save
Select Webhook Events
Enable the following events in LemonSqueezy:
| LemonSqueezy Event | Windback Event Type | Description |
|---|---|---|
subscription_cancelled | cancellation | Customer canceled their subscription |
subscription_payment_failed | payment_failed | Subscription payment attempt failed |
subscription_payment_success | payment_recovered | Payment succeeded after a previous failure |
Data Mapping
LemonSqueezy webhooks use a nesteddata.attributes format. The relay function maps these fields to Windback’s custom webhook format:
| LemonSqueezy Field | Windback Field | Notes |
|---|---|---|
data.attributes.user_email | customer_email | Subscriber email address |
data.attributes.user_name | customer_name | Subscriber name |
data.attributes.product_name | plan_name | LemonSqueezy product name |
data.attributes.variant_name | plan_name (fallback) | Used if product name is not set |
data.attributes.first_subscription_payment.amount | mrr | Amount in cents |
data.attributes.first_subscription_payment.currency | currency | ISO 4217 code |
data.attributes.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 LemonSqueezy to prevent webhook retries and eventual deactivation.
LemonSqueezy signs webhook payloads using an HMAC signature in the
X-Signature header. We strongly recommend verifying this signature in your relay function before forwarding to Windback. See LemonSqueezy’s webhook docs for details.