Refgrow
16 min read

How to Create a Stripe Affiliate Program: Step-by-Step Guide

A practical guide to launching an affiliate program for your Stripe-powered SaaS. From webhook configuration to automated commission tracking and payouts — everything you need to get affiliates driving revenue.

Why Build an Affiliate Program on Stripe?

Stripe powers payments for millions of businesses, from solo founders to public companies. If you are running a SaaS on Stripe, building an affiliate program on top of your existing payment infrastructure is one of the highest-leverage growth channels available. Here is why.

Your payment data is already there. Every subscription, one-time payment, invoice, and refund flows through Stripe. An affiliate tracking system that connects directly to Stripe can automatically attribute revenue to the affiliate who referred the customer — no manual reconciliation needed.

Stripe's coupon system enables powerful attribution. Stripe supports promotion codes and coupons natively. When each affiliate gets a unique Stripe coupon, every payment made with that coupon is automatically linked to the correct affiliate. This works even when cookie-based tracking fails (ad blockers, device switches, direct purchases).

Webhooks provide real-time tracking. Stripe's webhook system delivers payment events in real time. When a referred customer pays, the affiliate's commission is calculated and recorded instantly. No batch processing, no delayed attribution, no missing conversions.

Recurring revenue = recurring commissions. For SaaS businesses with subscription billing, affiliates can earn commissions on every renewal, not just the first payment. This creates a powerful incentive for affiliates to refer high-quality customers who stick around.

How Stripe Affiliate Tracking Works

Before diving into the setup, it helps to understand the technical flow of how affiliate tracking works with Stripe. There are multiple attribution methods, and the best systems use all of them as fallbacks.

Attribution method 1: Coupon/promotion code matching

Each affiliate gets a unique Stripe coupon or promotion code (e.g., JOHN20). When a customer uses this code during checkout, Stripe attaches it to the subscription or payment. When the payment webhook fires, the tracking system looks up which affiliate owns that coupon and credits them with the commission.

This is the most reliable attribution method because it does not depend on browser cookies or referral links. Even if a customer types your URL directly into their browser and enters the coupon code, the affiliate gets credited. Learn more about coupon-based affiliate tracking.

Attribution method 2: Referral link + metadata

When a visitor clicks an affiliate's referral link, a tracking cookie is set. When that visitor starts a Stripe Checkout session, the affiliate's referral code is passed via client_reference_id or session.metadata.referral_code. The webhook handler reads this metadata and attributes the conversion to the correct affiliate.

Attribution method 3: Email-based fallback

If a visitor clicks a referral link and signs up for your product (creating an account with their email), this email is stored as a referral attribution. When a Stripe payment later arrives from that same email, the system can match it back to the affiliate who originally referred that visitor — even if the Stripe session did not carry referral metadata.

The attribution priority chain

A robust Stripe affiliate tracking system checks attribution sources in priority order:

  1. Stripe coupon/promotion code match — highest confidence, explicit intent
  2. Session metadata (referral_code) — passed during checkout creation
  3. Client reference ID — another metadata pathway
  4. Subscription metadata — for recurring billing events
  5. Email fallback — matches customer email to prior referral attribution

This multi-layered approach ensures that affiliates get credit for their referrals regardless of how the customer ultimately purchases. Refgrow implements all five attribution methods automatically. For a deep dive into the technical implementation, see how to set up Stripe referral tracking.

Step-by-Step: Create Your Stripe Affiliate Program

Here is the complete process to go from zero to a live affiliate program connected to your Stripe account. Using Refgrow, this takes about 15 minutes.

Step 1: Create your Refgrow account

Sign up for Refgrow with your email or Google account. No credit card required for the 14-day free trial. Once logged in, you will be prompted to create your first project.

Step 2: Connect your Stripe account

In your project settings, paste your Stripe secret key (starts with sk_live_ or sk_test_ for testing). Refgrow automatically creates a webhook endpoint in your Stripe account pointed at https://refgrow.com/webhook/stripe/YOUR_PROJECT_ID. This webhook listens for payment events and processes affiliate attributions in real time.

You do not need to manually configure webhook events in the Stripe dashboard. Refgrow handles the webhook registration, event selection, and secret verification automatically. See the detailed Stripe integration guide for specifics.

Step 3: Configure your commission structure

Set your default commission rate. Refgrow supports several commission models:

  • Percentage of revenue: e.g., 20% of each payment (most common for SaaS)
  • Fixed amount: e.g., $10 per conversion
  • Recurring commissions: earn on every subscription renewal, not just the first payment
  • Product-specific overrides: different commission rates for different Stripe products/prices
  • Affiliate-specific overrides: custom rates for top-performing or strategic affiliates

Step 4: Add tracking to your website

Add the Refgrow tracking script to your marketing site to capture referral clicks:

HTML — Marketing Site
<script src="https://scripts.refgrowcdn.com/tracking.js"
  data-project-id="YOUR_PROJECT_ID"></script>

When a visitor arrives via an affiliate link (e.g., yoursite.com?ref=AFFILIATE_CODE), the tracking script stores the referral attribution in a cookie. When that visitor later starts a Stripe Checkout session, the referral code is automatically passed to Stripe as metadata.

Step 5: Add the embedded affiliate dashboard

Add the Refgrow widget to your product so customers can become affiliates directly within your app:

HTML — Your Product
<div id="refgrow"
  data-project-id="YOUR_PROJECT_ID"
  data-project-email="{{user.email}}">
</div>
<script src="https://scripts.refgrowcdn.com/page.js"></script>

This creates an embedded affiliate dashboard inside your product. Customers see their referral link, coupon code, real-time stats, and earnings without leaving your app. This drives 2-4x higher affiliate activation compared to external portals.

Step 6: Test the full flow

Use your Stripe test mode to verify the complete affiliate tracking cycle:

  1. Create a test affiliate (or sign up through the widget yourself)
  2. Click the test affiliate's referral link
  3. Complete a Stripe Checkout purchase using a test card
  4. Verify the conversion appears in the affiliate's dashboard with the correct commission
  5. Test with a coupon code to verify coupon-based attribution

Ready to launch your Stripe affiliate program?

Connect your Stripe account, configure commissions, and start getting affiliate-driven revenue in under 15 minutes.

Start Your Free Trial

Coupon-Based Attribution: Your Secret Weapon

Cookie-based tracking has limitations. Ad blockers, incognito browsing, device switches, and cookie expiration all reduce tracking accuracy. Coupon-based attribution solves this by tying the affiliate relationship to the payment itself, not the browser.

How it works with Stripe

When an affiliate joins your program through Refgrow, a unique Stripe coupon is automatically created for them. For example, affiliate John Smith might get the coupon code JOHN20 that gives customers 20% off their first month. When a customer uses this code during Stripe Checkout, the coupon is permanently attached to their subscription.

When Stripe sends the invoice.payment_succeeded webhook, Refgrow checks the subscription's discount for a matching affiliate coupon. If found, the commission is automatically calculated and credited to John's account. This works for every subsequent payment too, so recurring commissions are tracked without any additional logic.

Why coupon tracking is essential

  • Works across devices: Customer hears about you from an affiliate on their phone, purchases on their laptop. The coupon code bridges both sessions.
  • Immune to ad blockers: No cookies, no JavaScript tracking to block. The attribution is in Stripe's payment data.
  • Podcast and video friendly: Affiliates can share coupon codes verbally ("Use code JOHN20 for 20% off"), which does not work with referral links.
  • Higher conversion: Customers get a discount, which increases checkout completion. The affiliate gets commission. Win-win.

Choosing the Right Commission Structure

Your commission structure directly affects affiliate motivation and program economics. Here are the most common models for Stripe-based SaaS businesses.

Recurring percentage (most popular)

The affiliate earns a percentage of every payment for the lifetime of the customer (or for a defined period, e.g., 12 months). Typical rates are 15-30% for SaaS products.

Example: 20% recurring commission. Customer pays $100/month. Affiliate earns $20/month for as long as the customer stays subscribed.

This is the most popular model because it aligns affiliate incentives with customer quality. Affiliates are motivated to refer customers who will stay, not just anyone who signs up.

One-time percentage

The affiliate earns a percentage of only the first payment. Simpler to manage, but provides less long-term motivation.

Example: 50% of the first payment. Customer pays $100. Affiliate earns $50 once.

Fixed bounty

The affiliate earns a fixed dollar amount per conversion, regardless of the payment amount. Good for products with variable pricing where you want predictable affiliate costs.

Example: $25 per paying customer. Works well for freemium products where you only pay affiliates for users who convert to paid.

Refgrow supports all three models, plus product-specific and affiliate-specific overrides. You can offer your top affiliates a higher rate, or set different commissions for different pricing tiers. See our commission rate guide for detailed advice on choosing the right rate for your business.

Managing Your Stripe Affiliate Program

Once your program is live, here are the key operational aspects to manage.

Affiliate approval

Refgrow supports both auto-approval (anyone can become an affiliate) and manual approval (you review each application). For most SaaS companies, auto-approval works well initially — your existing customers are already qualified. As your program grows, you may want to switch to manual approval for external affiliates.

Payout management

When affiliates accumulate commissions, they need to get paid. Refgrow supports automated payouts via PayPal and Wise, plus manual payout tracking for other methods. You set minimum payout thresholds, review pending payouts, and approve them individually or in bulk.

Fraud prevention

Self-referrals, fake signups, and commission manipulation are real risks. Refgrow includes built-in fraud detection that flags suspicious patterns: same IP for affiliate and customer, rapid-fire signups, disposable email addresses, and geographic anomalies. Flagged conversions are held for review before commissions are approved.

Performance tracking

Monitor your program's health through Refgrow's dashboard: total affiliate-driven revenue, top-performing affiliates, conversion rates by affiliate, average commission per conversion, and payout totals. These metrics help you optimize commission rates, identify star affiliates for special deals, and spot underperforming areas of the program.

Frequently Asked Questions

Does Stripe have a built-in affiliate program feature?

No. Stripe handles payments but does not include affiliate tracking, commission management, or affiliate dashboards. You need a third-party platform like Refgrow to add affiliate program functionality on top of Stripe's payment infrastructure. Refgrow connects via Stripe's API and webhooks to provide automated tracking.

Can I track affiliate referrals for one-time Stripe payments, not just subscriptions?

Yes. Refgrow tracks both one-time payments (via checkout.session.completed) and recurring subscription payments (via invoice.payment_succeeded). You can set different commission rates for one-time vs recurring revenue if needed.

How do I pass the referral code to Stripe Checkout?

Refgrow's tracking script automatically injects the referral code into Stripe Checkout sessions via the client_reference_id parameter. If you are using Stripe's server-side API to create checkout sessions, you can pass metadata.referral_code from the tracking cookie. The quickstart guide covers both approaches.

What happens when a customer cancels and resubscribes?

Refgrow maintains the affiliate attribution for the customer's email. If a referred customer cancels and later resubscribes (creating a new Stripe subscription), the original affiliate still gets credited via the email-based attribution fallback. Commission tracking resumes automatically with the new subscription.

Can I run a Stripe affiliate program alongside Paddle or LemonSqueezy?

Yes. Refgrow supports Stripe, Paddle, and LemonSqueezy within the same project. Affiliates earn commissions from all payment sources, and you see unified reporting across all providers.

Launch your Stripe affiliate program today

Connect your Stripe account, set your commission rate, and start getting affiliate-driven revenue. 14-day free trial, no credit card required.

Related Resources

Start Free Trial
How to Create a Stripe Affiliate Program (Step-by-Step Guide 2026) | Refgrow