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

Note: You'll need a Paddle account to track payments. If you don't have one, sign up here.

Step 1: Configure Webhook

  1. Go to your project's "Integration" tab
  2. Select "Paddle Webhooks" as your tracking method
  3. Copy the provided webhook URL
  4. In your Paddle dashboard, create a new webhook with the copied URL
  5. Enable these events: transaction.completed, subscription.created, subscription.updated
  6. Copy the webhook signing secret from Paddle
  7. 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

Important: If you have a direct purchase flow (Click → Purchase), passing the referral code to Paddle is essential for correct attribution.

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

  1. Add a special class to your payment links:
  2. <a href="https://buy.paddle.com/product/xyz..." class="refgrow-paddle-link">Buy Now</a>
  3. Call the helper function after the page loads:
  4. // Call this once after the page loads
    if (window.Refgrow) {
      Refgrow.processPaddleLinks();
      // Or use a custom selector: Refgrow.processPaddleLinks('.your-paddle-class');
    }
Note: Refgrow will automatically append the referral code via custom data to the Paddle link if a referral cookie exists.

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:

  1. Go to your project's "Integration" tab
  2. Scroll to "Product-Specific Commissions"
  3. Click "Add Product Commission"
  4. Select a Paddle product and set its unique commission rate
Note: Product-specific rates take priority over your default commission settings.

Affiliate-Specific Overrides

Set custom commission rates for individual affiliates:

  1. Go to your "Affiliates" tab
  2. Find the affiliate you want to customize
  3. Click "Manage Override"
  4. Set a custom commission type and value
Priority: Affiliate-specific overrides take highest priority, followed by product-specific commissions, with default settings as the fallback.

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 completed
  • subscription.created - When a new subscription is created
  • subscription.updated - When a subscription is updated

Troubleshooting

  1. Verify your webhook signing secret is correctly set in your project settings
  2. Check that the webhook endpoint was created with the correct URL: https://refgrow.com/webhook/paddle/{your-project-id}
  3. Confirm all required events are enabled for the webhook
  4. Check your Paddle dashboard for webhook delivery logs
  5. Ensure the webhook is active and not paused

  1. Verify that the customer email is included in the Paddle webhook data
  2. Check that referral codes are being passed correctly via custom data
  3. Ensure the affiliate exists in your Refgrow project
  4. Verify that trial orders with $0 amount are not triggering commissions (this is expected behavior)
  5. Check your commission settings and affiliate overrides

  1. Verify that tracking.js is loaded on all pages
  2. Check that the referral code cookie is being set correctly
  3. For direct purchase flows, ensure you're using Refgrow.processPaddleLinks()
  4. Verify that custom data is being passed to Paddle correctly
  5. Check that the customer's email matches between the referral and the purchase

Next Steps

Once your Paddle integration is set up: