Comment on page
Stripe
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
- Sync Stripe customer's 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.
- 1.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.

- 2.Go to Stripe Dashboard > Developers > API Keys and copy the Secret Key.

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

- 4.In ReferralHero, go to Edit Campaign > Integrations > Stripe, and click the button "Connect your Stripe account."

- 5.Enter the live Stripe Secret Key in the API KEY text box.
- 6.Enter the test Stripe Secret Key in the TEST API KEY text box.
- 7.Click "Connect" and "Save."

- 8.Your Stripe account will now be connected.
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.
- 1.Toggle on the option “Enable Test Mode” in the ReferralHero Stripe integration

- 2.Toggle on the option “Test mode” in your Stripe dashboard

- 1.In your ReferralHero campaign dashboard, go to Subscribers > Import > Import from CRM.
- 2.Enter a URL for the default referral link.
- 3.Toggle on the option to optionally send imported customers a welcome email.
- 4.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.
- 1.Go to your website and add the following ReferralHero script to your Stripe thank you page:
1
<script>
2
window.onload = (event) => {
3
let checkout_id = new URLSearchParams(document.location.search).get('session_id');
4
if (RH) {
5
RH.stripe_checkout(checkout_id)
6
}
7
}
8
</script>
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.- 2.Go to your Stripe dashboard > Payments > Payment Links and click "+ New."

- 3.Choose a product on the "Payment Page" tab.

- 4.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.
- 5.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}
- 6.Click "Create link."

- 7.Copy the payment link created and send it to your customer.

- 8.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:

- 1.Stripe Status Change: Monitor changes in customer statuses (such as trialing or active) to trigger referral actions in ReferralHero. You can optionally send the Stripe payment amount to ReferralHero and set it as the conversion value.
- 2.Payment Succeeds in Stripe: Record referral events when specific payment transactions occur in Stripe. You can optionally send the Stripe payment amount to ReferralHero and set it as the conversion value.
- 3.Total Spend Updates in Stripe: Automatically update the customer's lifetime spend in ReferralHero with the latest total spend value from Stripe.
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. This event sends the Stripe payment amount to ReferralHero to set it as the conversion value.

Example 'Total Spend Updates' event
This example illustrates an event that sends the latest total spend value from Stripe to set it as the lifetime spend in ReferralHero.

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.
- 1.Set up a reward in your ReferralHero campaign.
- 2.Go to your Stripe integration in ReferralHero and click the button "+ Add Reward Coupon."

- 3.Select the coupon you would like to apply to the Stripe customer from the dropdown.
- 4.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.


Last modified 9d ago