What the Stripe integration can and can’t do
Connecting Stripe covers the money side of your program completely. It does not cover clicks or sign-ups on its own — those come from the Referly tracking script and from other integrations.Before you start
You’ll need:- Owner or admin access to your Stripe account, so you can approve the connection when Stripe asks.
- The ability to add a line of code to your website, or someone who can do it for you. This is what tracks clicks and carries the referral to checkout.
- An active Referly plan on the program you’re connecting.
- A decision on test mode or live mode. Referly connects to one or the other, never both at once. If you want to rehearse first, read Step 4 before connecting.
Step 1: Install the tracking script on your site
The tracking script is what recognises a visitor who arrived from an affiliate link, records the click, and remembers who referred them until they buy. Without it, Stripe payments can still be credited through coupon codes, but you’ll have no clicks, no conversion rate, and no link-based attribution.Open your integration instructions
Open the guide that matches your checkout
Copy the script and paste it into your site
head section of your website, on every page. If you use Google Tag Manager, switch to the Using Google Tag Manager tab in the guide and copy that version instead.Step 2: Connect your Stripe account
Connecting is a single approval — you don’t create API keys, and you don’t add a webhook endpoint in Stripe by hand. Referly uses Stripe’s own app connection flow, so Stripe asks you to approve access and then sends Referly the events it needs.Open the integrations dialog
Choose Stripe
Select Connect Stripe Account
Sign in to Stripe and approve
Wait for the redirect back to Referly
Check that it connected
Open Connect Integration again and select Stripe. A green Connected badge appears at the top with your Stripe account’s display name — the same name Stripe shows in its own dashboard. If you connected in test mode, the badge is yellow and reads Test Mode instead. If you see the message that the Stripe account is already linked to another campaign, that account is connected to a different Referly program. Disconnect it there first, or connect a different Stripe account.Connecting in test mode
The Connect Test Mode button connects your Stripe account’s test data instead of your live data, so you can rehearse the whole flow with test cards before real money is involved.Step 3: Send the referral through to Stripe
Connecting your account tells Referly which payments to watch. This step tells Referly who to credit for each one. When someone lands on your site from an affiliate link, the tracking script records the click and stores a reference for that visitor. That reference has to travel with them into Stripe. Referly looks for it in three places on the payment:- The Client reference ID field on the checkout — the field Stripe shows as
client_reference_id. - Checkout metadata under the key
pushLapAffiliateId. - Customer or subscription metadata under the key
pushLapAffiliateId.
A limit worth knowing about
If you’re adding the reference to a Stripe Payment Link URL, Stripe only accepts letters, numbers, dashes, and underscores in theclient_reference_id parameter, up to 200 characters. Stripe silently drops anything else — the payment page still works, but the reference never arrives and the sale can’t be attributed. Referly’s snippet always sends a plain number, so this only bites if you build the URL yourself. See Stripe’s payment link URL parameters for the details.
Step 4: Test the whole flow before you go live
Rehearse in test mode. It takes ten minutes and catches the two mistakes almost everyone makes — the script on the wrong pages, and the reference never reaching Stripe.Switch your Stripe Dashboard into test mode
Connect Referly in test mode
Recreate your checkout in test mode
Visit your own site through an affiliate link
your-site.com/?ref=TESTAFFILIATE. Use a real affiliate’s code from your Affiliates page. If you changed your link parameter in your program settings, use that instead of ref.Complete a test payment
4242 4242 4242 4242, any future expiry date such as 12/34, any 3-digit CVC, and any postal code. Stripe’s testing documentation lists more test cards, including ones that fail on purpose.Check the payment in Stripe
pushLapAffiliateId entry under metadata. If it’s empty, the reference never left your website — go back to your Step 3 guide.Check the customer in Stripe
Check the result in Referly
Go live
What happens automatically once you’re connected
You don’t have to do anything for these — Referly acts on them as soon as Stripe reports them.A checkout completes
A checkout completes
A payment succeeds
A payment succeeds
A subscription renews
A subscription renews
A subscription is created or cancelled
A subscription is created or cancelled
A customer is created with a referral reference
A customer is created with a referral reference
A payment is refunded
A payment is refunded
A coupon or promo code changes in Stripe
A coupon or promo code changes in Stripe
How refunds are handled
When Stripe reports a refund, what happens depends on whether the affiliate has already been cleared for payout on that sale.Changing or disconnecting your Stripe account
Open Connect Integration, select Stripe, and choose Disconnect. Referly stops receiving events from that Stripe account immediately. Disconnecting does not delete anything you’ve already tracked — your referred customers, sales, and rewards all stay. What stops is new tracking: payments taken while you’re disconnected are not recorded, and they won’t be picked up when you reconnect. To move to a different Stripe account, disconnect first and then connect the new one. A single Stripe account can only ever be linked to one Referly program.Troubleshooting
Payments are appearing in Referly but with no affiliate attached
Payments are appearing in Referly but with no affiliate attached
Nothing at all is appearing in Referly
Nothing at all is appearing in Referly
Clicks aren't being counted
Clicks aren't being counted
A renewal didn't create a new commission
A renewal didn't create a new commission
Stripe says the account is already linked to another campaign
Stripe says the account is already linked to another campaign
Coupon sales aren't being credited
Coupon sales aren't being credited