Skip to main content

Stripe Affiliate Integration Quickstart

Connect browser referrals to Stripe Checkout, verify payment attribution, and find the tracking script and REST API documentation.

Table of Contents

This quickstart is for merchants and developers launching an AffiliateBase affiliate program on Stripe. The launch path is: connect Stripe, configure your account, create a campaign, install attribution, and verify attribution through a qualifying checkout.

Setup sequence

Complete these steps in order:

  1. Connect Stripe from Setup.
  2. Set Portal and payout defaults: Affiliate portal address, Affiliate payout method, and display currency.
  3. Create the first campaign with its URL, reward rules, minimum payout, Referral window (how long a click stays eligible for credit), and Commission delay.
  4. Choose an install path for attribution: Stripe Payment Link, Buy Button or Pricing Table, Custom Checkout Session, or Promo codes only. If someone else edits your site, copy the Install request note under Hand this to a developer and send it to them.
  5. Verify tracking for links: open the test affiliate link, complete a checkout, and wait for Stripe to return the generated referral ID as client_reference_id. For code-only tracking, this step is Set up promo codes, and a redeemed promo code confirms attribution.
  6. Add your first affiliate and give them their referral link or promo code. Setup finishes with the first referred sale.
  7. Create payout runs once commissions become due, then execute or reconcile them based on the selected payout method.

For most Stripe Payment Link, Buy Button, or Pricing Table setups:

  1. Paste the AffiliateBase tracking script in the shared site layout or site-wide custom-code area, ideally before </body>.
  2. Keep the Stripe checkout link or element on the same published page as the script.
  3. Open the test affiliate link from AffiliateBase setup.
  4. Start a fresh Stripe checkout.
  5. Confirm the Checkout Session has client_reference_id.

For backend-created Checkout Sessions, submit referral_id from the browser first, then set Stripe client_reference_id server-side. See Stripe Checkout and Payment Links.

For promo-code-only launches, you have two options:

  • Campaign-generated codes (Generate codes automatically): choose an available Stripe discount during setup. AffiliateBase creates a code for every active affiliate.
  • Individually assigned codes (Manage codes individually): open an affiliate, go to the Links & codes tab, and choose Manage promo codes to assign an existing Stripe promotion code or create one from an existing Stripe discount. No campaign discount default is required.

Both code paths work without a tracking script or client_reference_id handoff. See Assign Stripe Promo Codes to Affiliates for individual assignments and checkout verification.

What to verify

  • For link tracking, the test affiliate link creates a referral and Stripe receives its ID as client_reference_id.
  • For individual codes, Stripe actually redeems the assigned promotion code on a qualifying checkout after assignment.
  • A full test checkout creates the expected referral, sale, and commission records.
  • The affiliate portal shows referral links, promo code details when configured, commissions, and payout status.
  • PayPal and Wise payout runs use provider exports and external payment. With Stripe payouts turned on in Settings -> Stripe Payouts, a payout is sent as a Stripe transfer from the merchant’s Stripe balance only after the affiliate’s Stripe account shows Ready for payouts. Connecting Stripe alone does not mark anything paid.

Next steps

Esc