Paddle Integration
Automatically track purchases and calculate commissions with Paddle
Overview
Refgrow integrates with Paddle to automatically track payments and calculate commissions for your affiliates.
- Automatic tracking of one-time payments and subscriptions
- Support for product-specific commission rates
- Support for affiliate-specific commission overrides
- Secure webhook implementation for real-time tracking
- Works with Paddle Checkout and payment links
Setting Up Paddle Integration
Step 1: Configure Webhook
- Go to your project's "Integration" tab
- Select "Paddle Webhooks" as your tracking method
- Copy the provided webhook URL
- In your Paddle dashboard, create a new webhook with the copied URL
- Enable these events:
transaction.completed
,subscription.created
,subscription.updated
- Copy the webhook signing secret from Paddle
- Paste the signing secret in Refgrow and click "Save Secret"
Step 2: Choose Your User Flow
Select the appropriate user conversion flow for your business:
- Click → Signup → Purchase: Users create an account before making a purchase
- Click → Purchase: Users can purchase directly without signing up first
- Both: Your platform supports both flows
Passing Referral Codes to Paddle
For Paddle Checkout
When creating a checkout on your server, pass the referral code in the custom data:
// Example (Node.js Server-Side)
const refCode = req.cookies.refgrow_ref_code; // Get code from cookie
const checkout = await paddle.checkouts.create({
// ... other checkout parameters
custom_data: {
referral_code: refCode || null // Pass the code here
}
});
For Paddle Payment Links
For payment links, use the automatic processing with JavaScript:
Automatic Processing with JavaScript
- Add a special class to your payment links:
- Call the helper function after the page loads:
<a href="https://buy.paddle.com/product/xyz..." class="refgrow-paddle-link">Buy Now</a>
// Call this once after the page loads
if (window.Refgrow) {
Refgrow.processPaddleLinks();
// Or use a custom selector: Refgrow.processPaddleLinks('.your-paddle-class');
}
Commission Configuration
Default Commission Settings
Configure your default commission structure in your project settings:
- Commission Type: Percentage or Fixed Amount
- Commission Value: The percentage or fixed amount
- Commission Duration: Lifetime, First Purchase, or Limited Period
Product-Specific Commissions
Override commission rates for specific products:
- Go to your project's "Integration" tab
- Scroll to "Product-Specific Commissions"
- Click "Add Product Commission"
- Select a Paddle product and set its unique commission rate
Affiliate-Specific Overrides
Set custom commission rates for individual affiliates:
- Go to your "Affiliates" tab
- Find the affiliate you want to customize
- Click "Manage Override"
- Set a custom commission type and value
How It Works
1. Referral Click
User clicks an affiliate link and the refgrow_ref_code
cookie is set.
2. Paddle Payment
The referral code is passed to Paddle, and the user completes payment.
3. Webhook Processing
Refgrow receives the webhook, attributes the sale, and calculates the commission.
Supported Webhook Events
Refgrow automatically listens for these webhook events:
transaction.completed
- When a purchase is completedsubscription.created
- When a new subscription is createdsubscription.updated
- When a subscription is updated
Troubleshooting
- Verify your webhook signing secret is correctly set in your project settings
- Check that the webhook endpoint was created with the correct URL:
https://refgrow.com/webhook/paddle/{your-project-id}
- Confirm all required events are enabled for the webhook
- Check your Paddle dashboard for webhook delivery logs
- Ensure the webhook is active and not paused
- Verify that the customer email is included in the Paddle webhook data
- Check that referral codes are being passed correctly via custom data
- Ensure the affiliate exists in your Refgrow project
- Verify that trial orders with $0 amount are not triggering commissions (this is expected behavior)
- Check your commission settings and affiliate overrides
- Verify that
tracking.js
is loaded on all pages - Check that the referral code cookie is being set correctly
- For direct purchase flows, ensure you're using
Refgrow.processPaddleLinks()
- Verify that custom data is being passed to Paddle correctly
- Check that the customer's email matches between the referral and the purchase
Next Steps
Once your Paddle integration is set up:
- Customize your affiliate widget to match your brand
- Set up payout methods for your affiliates
- Configure commission rules for different products or affiliates
- View analytics and reports to track your program's performance