Documentation Index
Fetch the complete documentation index at: https://docs.windbackai.com/llms.txt
Use this file to discover all available pages before exploring further.
PayPal Integration
Connect your PayPal subscription billing to Windback via the custom webhook endpoint to detect cancellations, failed payments, and successful recoveries.PayPal does not have a native Windback integration. This guide uses a lightweight Node.js relay function that receives PayPal webhooks, maps the payload, and forwards it 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 PayPal webhooks, verifies the signature, maps the payload, and forwards it to Windback.
Add the Webhook in PayPal
- Go to PayPal Developer Dashboard > My Apps & Credentials
- Select your application
- Scroll to Webhooks and click Add Webhook
- Paste the URL of your deployed relay function
- Select the events listed below
- Click Save
Select Webhook Events
Enable the following events in PayPal:
| PayPal Event | Windback Event Type | Description |
|---|---|---|
BILLING.SUBSCRIPTION.CANCELLED | cancellation | Subscriber canceled the subscription |
PAYMENT.SALE.DENIED | payment_failed | Payment was denied or failed |
PAYMENT.SALE.COMPLETED | payment_recovered | Payment completed successfully |
PayPal uses uppercase event names with dot notation. Make sure you select the exact events above.
Note Your Webhook ID
After creating the webhook, PayPal assigns a Webhook ID. Copy this value — you will need it for signature verification in your relay function.
Data Mapping
The relay function maps PayPal webhook fields to Windback’s custom webhook format:| PayPal Field | Windback Field | Notes |
|---|---|---|
resource.payer.email_address | customer_email | Payer email |
resource.payer.name.given_name + surname | customer_name | Combined payer name |
resource.plan_id | plan_name | PayPal billing plan ID |
resource.amount.total or resource.shipping_amount.value | mrr | Converted to cents |
resource.amount.currency | currency | ISO 4217 code |
resource.start_time or resource.create_time | tenure_days | Calculated from subscription start |
Relay Function
Signature Verification
To verify signatures, you need:- Your Webhook ID (from the PayPal Developer Dashboard)
- The request headers:
paypal-transmission-id,paypal-transmission-time,paypal-transmission-sig,paypal-cert-url - The raw request body
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 PayPal to prevent webhook retries.