Stripe affiliate software for Stripe Checkout
ViralPayouts tracks affiliate sales from your own Stripe account. You add two values to the Checkout Session's metadata and point a Stripe webhook at your program's own address. Sales, renewals and refunds then arrive by themselves.
Stripe only tells us that a customer paid or was refunded. It does not move money to partners: ViralPayouts pays them, after you fund the payouts.
- Metadata values
- 2
- Stripe events
- 3
- Webhook per program
- 1
- Monthly fee
- $0
What you set up in Stripe
Once per program. The webhook address and the secret field are on the Integration tab of your console.
- 1
Keep the two values
A partner's link sends the visitor to your site with
?ref=and&vp_click=in the address. Keep both until checkout, in a cookie or the session. - 2
Put them in the Checkout Session
Add
metadata: { ref_code, vp_click }when you create the session. - 3
Add the webhook
In your Stripe dashboard, add an endpoint at
/api/stripe/webhook/<program id>for the three events below, and paste itswhsec_signing secret into the console.
// Your server, when the buyer clicks "Pay".
// ref and vp_click came in on the landing URL from the partner's link.
const session = await stripe.checkout.sessions.create({
mode: 'subscription', // or 'payment'
line_items: [{ price: 'price_123', quantity: 1 }],
success_url: 'https://yourapp.com/thanks',
metadata: {
ref_code: ref, // the partner's referral code
vp_click: vpClick, // the click id
},
});The metadata values ViralPayouts reads
| Value | Where | What it does |
|---|---|---|
ref_code | metadata (vp_ref also works) | The partner’s referral code. Credits the sale to that partner. |
vp_click | metadata | The click id. Checked first: it credits the right partner and holds the sale to the program’s cookie window. |
client_reference_id | session field | Read as the referral code when ref_code is missing, for checkouts where you cannot set metadata. |
vp_coupon | metadata, optional | A partner’s coupon code the buyer typed, credited while the program’s coupon offer is on. |
The order is: a renewal of a subscription already credited, then a coupon code, then the click id, then the referral code. A sale that matches nobody is listed for you as unmatched, never guessed.
The three Stripe events
| Event | Becomes | Notes |
|---|---|---|
checkout.session.completed | A sale | Counted only when the session is paid. On a $100 sale at 20% + 5%: $20 partner, $5 recruiter, $2.50 fee. |
invoice.paid | A renewal | Subscription renewals only. Credited to the partner who brought the first payment, for the program's recurring period (first payment only, 2 to 36 months, or lifetime). |
charge.refunded | A refund | Matched to the sale by its payment intent. Reverses commission, override and fee in proportion to the amount refunded. |
charge.dispute.created | A chargeback opened | The sale's commission is held, so it is not paid out while the chargeback is open. |
charge.dispute.closed | A chargeback decided | Lost: commission, override and fee are reversed in full. Won: the hold is lifted and it pays as normal. |
One address per program
Signed and replay-safe
Currency must match
Not on Stripe Checkout?
Shopify
Any other backend
Whop
Why brands choose ViralPayouts
Your Stripe account stays yours
ViralPayouts reads your own Stripe events through a signed webhook. No Stripe Connect, and no partner money moving through your Stripe balance.Server-side by design
The two values travel from your server into the Checkout Session metadata, and Stripe reports the sale server to server. A browser script that fails to load cannot lose it.Renewals and refunds handled
Renewals earn for as long as the program says; refunds reverse the commission, the override and the fee in proportion.Partners paid for you
ViralPayouts sends partner and recruiter payouts through Whop, from the money you fund each month.
Questions brands ask before they switch
- Is there a JavaScript snippet?
- You do not need one. Keep two values from the landing URL and add them to the Checkout Session on your server: a few lines, shown above.
- We take delayed payment methods.
- Report those sales through the event API once they are paid, so a commission is only ever earned on money you actually received.
- We also sell on Shopify, or off Stripe.
- Shopify order webhooks are supported at a per-program address, and any backend can send sales and refunds to the signed event API. One ledger for all of them.
- Can we pay more than two levels?
- Two is deliberate. Why two levels is the right number.
Try it on test money first
Set your commission and recruiter override, see what each sale costs you, and run it on the test network before a real partner joins. No monthly fee.
Related pages
- Two-tier affiliate softwareWhat a second tier is, the split on a $100 sale, and who offers it from what price.
- Sub-affiliate softwareRecruit links kept apart from customer links, per-program overrides and refunds.
- Multi-level affiliate trackingWhy two levels is the right number, and what deeper chains cost a brand.
- Affiliate software with no monthly feeThe fee table, and what a flat-price plan still leaves you to do yourself.
- Pay-for-performance affiliate softwareYou pay on approved sales only, and refunds take the fee back.
- For recruitersHow recruiter overrides are earned and paid, per program.
- GlossarySub-affiliate, override, hold period, clawback and the rest, each with a worked number.