Stripe
Last updated
Was this helpful?
Last updated
Was this helpful?
The ReferralHero Stripe is a powerful integration that enables a seamless connection between your ReferralHero account and your Stripe payment gateway. This support document provides a comprehensive overview of the integration's key features, outlining how you can make the most of this powerful tool for your referral marketing campaigns.
Here is what can be done with the ReferralHero Stripe integration:
Import Stripe customers into ReferralHero
Create customers in ReferralHero when starting an onboarding flow or completing a Stripe payment page/checkout
Track Stripe trialing, active, and other subscription events in ReferralHero
Track Stripe transactions
Sync Stripe customer's conversion value and total spend to RerferralHero
Apply Stripe coupons to customers when a ReferralHero reward is unlocked
Apply Stripe credit to customers when a ReferralHero reward is unlocked
Follow these steps to securely link your Stripe account to ReferralHero for a reliable integration.
In the Stripe Dashboard, navigate to Developers > API Keys section, ensure you grant the necessary permissions in your Stripe account for event tracking with RH.
Go to Stripe Dashboard > Developers > API Keys and copy the Secret Key.
If you would like to enable Test mode in the integration, turn on “Test mode” in your Stripe Dashboard and copy the Test Secret Key.
In ReferralHero, go to Edit Campaign > Integrations > Stripe, and click the button "Connect your Stripe account."
Enter the Stripe Secret Key in the API KEY text box.
Click "Connect".
The "Transaction Tracking" event is automatically generated upon connecting your Stripe account.
Your Stripe account is now successfully connected.
Note: The "Transaction Tracking" event automatically includes Stripe transactions in the "Transactions" tab under the "Reward Logs".
Test mode is a testing environment that simulates creating real events without the risk of affecting live transactions or moving actual money. It allows you to verify that the integration between ReferralHero and Stripe is functioning as expected.
To enable test mode, enter your Stripe test API key in the ReferralHero integration settings. This ensures you can safely test the integration, verify referral tracking, and validate workflows without impacting live data or customer activity.
Using test mode is essential for confirming the setup of your referral program before launching it to your audience.
In your ReferralHero campaign dashboard, go to Add Subscribers > Import via Integration > Import from Stripe.
Click "Import".
Note:
If your "Welcome Email" automation is active, your imported list will receive this email
Import may take 1 to 2 hours to complete, depending on the number of customers in your Stripe account
You can create customers in ReferralHero when they are added to Stripe using the following methods:
Custom Form
Use the ReferralHero JavaScript RH_MFxxxxxxxxxx.form.submit() or RH.pendingreferral() when implementing a custom form/checkout on your website to capture signup or customer information. Data will be automatically synced with ReferralHero when they are created in Stripe.
Stripe Payment Link
You need to create a custom Stripe thank you page on your website to use this feature.
Follow the steps below to generate unique payment links with Stripe and add customers automatically when payment is completed.
Go to your website and add the following ReferralHero script to your Stripe thank you page:
The RH_MFxxxxxxxxxx.stripe_checkout()
works similarly to RH_MFxxxxxxxxxx.organicTrackReferral()
, which adds organic subscribers or tracks referrals as unconfirmed/confirmed on the conversion page to your referral campaign.
Go to your Stripe dashboard > Payments > Payment Links and click "+ New."
Choose a product on the "Payment Page" tab.
Go to the "After Payment" tab, check the option "Don't show confirmation page" to redirect customers to the custom thank you page on your website.
Enter your custom thank you page URL by attaching an additional parameter session_id as shown below to the URL text box:
https://mywebsite/Stripethankyoupage?session_id={CHECKOUT_SESSION_ID}
Click "Create link."
Copy the payment link created and send it to your customer.
The customer will be created in ReferralHero when they complete the payment.
Organic Subscriber Creation: The RH_MFxxxxxxxxxx.stripe_checkout() creates an organic subscriber by default when triggered.
Pending Referral Confirmation: If the subscriber already exists as a pending referral, the referral is confirmed automatically.
Referred Visitor Conversion: If a referral cookie exists, the referred visitor is converted into an unconfirmed/confirmed referral.
There are three types of Stripe events that can be tracked in the integration based on specific Stripe activities:
Stripe Status Change: Monitor changes in customer statuses (such as trialing or active) to trigger referral actions in ReferralHero.
Payment Succeeds in Stripe: Record referral events when specific payment transactions occur in Stripe.
Customer Created: Add new Stripe customers automatically to ReferralHero.
The Transaction Occurs event is automatically created when the Stripe account is connected. It logs the transaction data in the “Transactions” tab, sets the Conversion Value and updates the Lifetime Spend with the Stripe Total_Spend in the subscriber profile. You must track this event if you plan to use affiliate reward structures.
Example 'Stripe Status Change' event
This example illustrates an event that sets the referral status from 'pending' to 'unconfirmed' when a Stripe subscription state moves into trialing.
Example 'Payment Succeeds' event
This example illustrates an event that sets the referral status from 'unconfirmed' to 'confirmed' when a customer's Stripe payment amount is greater than $50.
Example 'Transaction Tracking' event
This example illustrates the event that sends the Stripe transaction data, which is logged in the “Transactions” tab. It also sets the Conversion Value and updates the Lifetime Spend with the Stripe Total_Spend in the subscriber profile.
Enhance your referral campaigns by offering discounts through Stripe coupons, seamlessly integrated with ReferralHero. Stripe customers' accounts will automatically apply a discount code when they unlock a reward in ReferralHero.
Set up a reward in your ReferralHero campaign
Go to your Stripe integration in ReferralHero and click the button "Add reward coupon"
Select the coupon you would like to apply to the Stripe customer from the dropdown.
Select the reward that the customer needs to unlock to earn the discount.
Example ‘Reward Coupon’ event
This example illustrates that when the Stripe customer successfully refers one referral and unlocks the reward "Reward for Advocate",
the 'Reward Coupon' event set up for the reward will automatically apply the discount code "50OFFOneTime" to the customer's account in Stripe.
Enhance your referral program by applying Stripe credit directly to customers' accounts when they unlock a reward in ReferralHero. This feature allows you to offer incentives without requiring a separate discount code or manual intervention.
Navigate to the Reward Overview section and enable the "Apply Stripe credit" option.
Set the reward value in the Reward Value section.
Once a subscriber unlocks the reward, the corresponding credit amount will be automatically applied to their Stripe account.
ReferralHero supports ongoing transaction tracking, empowering you to reward affiliates for transactions that occur over time. This feature allows you to provide commissions beyond the initial transaction.
Note: For existing Stripe customers, the first-ever payment amount becomes the Conversion Value, and the Stripe Total_Spend is reflected as the Lifetime Spend in the ReferralHero subscriber profile.
Scenario Overview
Stripe integration events:
“Transaction Tracking”
"Stripe Status Change" event triggered when a subscriber moves into "Active", setting the referral to confirmed.
Reward settings:
Reward the advocate for each transaction completed by a “Confirmed” referral
Reward the advocate 10% of each transaction by the “Confirmed” referral
Reward should recur for 10 transactions
Expected Behavior of Events:
A Pending referral is simultaneously created in ReferralHero when a Trialing customer is created in Stripe.
The Trialing customer purchases a $200 plan and transitions into Active status in Stripe
"Stripe Status Change" event triggers, changing the referral status from Pending to Confirmed.
"Transaction Tracking" event is triggered, logging data in the Transactions tab, and updating the subscriber profile.
A reward of $20 is unlocked by the advocate
The referral makes another payment in Stripe
“Transaction Tracking” event is triggered again, logging data in the Transactions tab, and updating the subscriber profile
Rewards are unlocked by advocate for 10 transactions.