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. 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. 2

    Put them in the Checkout Session

    Add metadata: { ref_code, vp_click } when you create the session.

  3. 3

    Add the webhook

    In your Stripe dashboard, add an endpoint at /api/stripe/webhook/<program id> for the three events below, and paste its whsec_ signing secret into the console.

Checkout Session with the two values
// 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

Checkout Session values
ValueWhereWhat it does
ref_codemetadata (vp_ref also works)The partner’s referral code. Credits the sale to that partner.
vp_clickmetadataThe click id. Checked first: it credits the right partner and holds the sale to the program’s cookie window.
client_reference_idsession fieldRead as the referral code when ref_code is missing, for checkouts where you cannot set metadata.
vp_couponmetadata, optionalA 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

Stripe events
EventBecomesNotes
checkout.session.completedA saleCounted only when the session is paid. On a $100 sale at 20% + 5%: $20 partner, $5 recruiter, $2.50 fee.
invoice.paidA renewalSubscription 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.refundedA refundMatched to the sale by its payment intent. Reverses commission, override and fee in proportion to the amount refunded.
charge.dispute.createdA chargeback openedThe sale's commission is held, so it is not paid out while the chargeback is open.
charge.dispute.closedA chargeback decidedLost: commission, override and fee are reversed in full. Won: the hold is lifted and it pays as normal.

One address per program

Each program has its own webhook address and signing secret, so a sale can only be credited inside that program.

Signed and replay-safe

Every request is checked against your signing secret. A redelivered event is recognised and ignored.

Currency must match

A sale in a different currency from the program’s is refused, not converted.

Not on Stripe Checkout?

Shopify

Supported: Shopify’s own order webhooks (orders paid, refunds created) at a per-program address. Nothing to install in your theme. The commission base is the subtotal after discounts, without shipping and tax.

Any other backend

Send sales, refunds and app events from your server to the signed event API. The same rules apply.

Whop

Whop is how ViralPayouts sends partner payouts. It is not a source of sales: a Whop store’s sales are not read.

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.