Stripe
Last updated
Last updated
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
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 live Stripe Secret Key in the API KEY text box.
Enter the test Stripe Secret Key in the TEST API KEY text box.
Click "Connect" and "Save".
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 real transactions or moving actual money. Leverage "Test Mode" to safely test the ReferralHero integration without processing real transactions.
Toggle on the option “Enable Test Mode” in the ReferralHero Stripe integration
Toggle on the option “Test mode” in your Stripe dashboard
In your ReferralHero campaign dashboard, go to Subscribers > Import > Import from CRM.
Enter a URL for the default referral link.
Toggle on the option to optionally send imported customers a welcome email.
Click "Import."
Note: 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.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.stripe_checkout()
works similarly to RH.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.
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.
Transaction Occurs: This 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 "cybermonday19",
the 'Reward Coupon' event set up for the reward "cybermonday19" will automatically apply the discount code "cybermonday19" to the customer's account in Stripe.
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 referrer for each transaction completed by a “Confirmed” referral
Reward the referrer 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 referrer
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 referrer for 10 transactions.