If you bill with Stripe, you already have everything an affiliate program needs: a customer, a subscription, and a payment event to attribute. What’s usually missing is the layer in between — tracking who referred whom, calculating commission, and paying partners without a spreadsheet. This guide walks through adding an affiliate program to a Stripe SaaS end to end.
What you need before you start
- A live Stripe account with at least one recurring or one-time product.
- Access to add a small script to your marketing site (or your AI agent can do it).
- A decision on your commission rate — if you haven’t set one, read how much commission a SaaS should pay affiliates first.
That’s it. You don’t need to change your checkout or migrate billing.
Step 1: Connect tracking to your Stripe events
Affiliate attribution comes down to linking a referral click to a Stripe conversion. The referral platform drops a first-party cookie when someone lands on a ?via= link, then reads Stripe webhooks (checkout.session.completed, customer.subscription.created) to match the resulting customer back to the referrer.
With Qanary this is one snippet on your site plus a webhook connection — no changes to your Checkout or Payment Links. Because it reads standard Stripe events, it works whether you use Stripe Checkout, Payment Links, or your own billing flow.
Step 2: Create referral links and coupon codes
Give each affiliate two ways to send traffic:
- A referral link (
yoursaas.com/?via=jane) that attributes on click. - An optional coupon code for creators who share a code in a video or post rather than a link.
Both should resolve to the same partner so attribution is consistent no matter how the customer arrives.
Step 3: Set commission rules and payouts
Decide three things:
- Rate — a percentage of the sale or a flat amount per conversion.
- Duration — one-time, or recurring for the lifetime of the subscription.
- Hold window — a delay before a commission is payable, so refunds and chargebacks net out.
Then automate the payout so approved commissions are paid on a schedule instead of by hand. This is where most DIY programs fall apart — manual payouts don’t scale past a handful of partners.
Step 4: Give affiliates a portal
Partners convert more when they can see their own clicks, conversions, and earnings. A branded affiliate portal — with their links, assets, and payout history — turns a one-time signup into an active promoter.
The pricing trap to avoid
Many affiliate tools price by the revenue your affiliates generate, so the better your program performs, the more you pay. That’s the “growth penalty.” Usage-based pricing avoids it by metering events instead — see usage-based vs revenue-share pricing for the full breakdown.
Doing it from an AI agent
If you build with a terminal AI agent (Cursor, VS Code), you can script the whole setup — snippet, webhook, links, and commission rules — over the REST API and MCP, instead of clicking through a dashboard. That’s the fastest path from zero to a working program, and it’s covered on the AI agent integration page.
FAQ
Will adding affiliate tracking change my Stripe checkout?
No. Attribution reads standard Stripe webhooks, so your Checkout, Payment Links, or custom flow stay exactly as they are.
Can I run recurring commissions on Stripe subscriptions?
Yes. Because conversions are matched to the Stripe subscription, you can pay a commission once or for the lifetime of that subscription.
How fast can I launch?
For a straightforward Stripe SaaS, an afternoon — most of the time goes into deciding your commission rate, not the technical setup.
More setup guides are in the affiliate & referral guides hub.
