Skip to main content
All CollectionsCampaigns
Double-sided incentives: how to apply coupons to referred customers
Double-sided incentives: how to apply coupons to referred customers
Kyle Fox avatar
Written by Kyle Fox
Updated over a week ago

Note: Double-sided incentives are only supported for customers with a Stripe connected account. This feature is not available for Paddle customers.

Double-sided incentives allow you to automatically apply coupons to referred customers, which can boost your conversion rates and enhance affiliate engagement. This approach benefits both sides: affiliates earn commissions for driving traffic, while referred customers receive discounts, making them more likely to complete a purchase. By rewarding both parties, double-sided incentives help create a win-win scenario for both your business and your affiliates.

Unlike promo codes that require customers to manually enter a code at checkout, double-sided incentives apply the discount automatically when the customer clicks the affiliate link. This experience makes it easy for customers to get their discount, while affiliates still receive their commission.

In this guide, we will walk you through setting up double-sided incentives for your Rewardful campaign.

How to add double-sided incentives to your Rewardful campaign

Follow the steps below to integrate double-sided incentives into your Rewardful campaign and apply coupons to referred customers.

Step 1: Set up your campaign to use double-sided incentives

Rewardful campaigns allow you to manage affiliate groups, setting parameters for commission type, duration, and percentage. To turn on double-sided incentives, you'll need to configure the coupon settings for the discounts offered to referred customers.

  1. Go to the Edit campaign form.

  2. In the Advanced Settings section, locate the Campaign coupon option.

  3. Click Create a coupon to open the coupon configuration form.

In this form, you'll define the discount type (percentage or fixed amount), the value of the discount, and the duration. These settings will be used to create a coupon in Stripe that is directly linked to your Rewardful campaign.

Step 2: Enable double-sided incentives

Once you've configured the coupon rules, you'll need to enable the double-sided incentives for your campaign:

  1. Toggle on the option to use double-sided incentives.

  2. Click Create coupon to save your settings.

Step 3: Pass the coupon back to Stripe (code)

Note: This step will need to be performed by a developer.

The Stripe coupon ID will be part of the tracking cookie that is generated when the customer uses an affiliate link. It has to be retrieved via Rewardful.coupon. If there is no coupon attached to your campaign, or the visitor isn't a referral, the value Rewardful.coupon will be empty.

You must then pass the coupon ID to Stripe, similar to how referral is passed as metadata.

For example, your Ruby code might look something like this:

Stripe::Customer.create(
  email: params[:email],
  metadata: { referral: params[:referral] },
  coupon: params[:coupon]
)

Note the coupon: params[:coupon] being passed to Stripe.

This will add the coupon to the Stripe customer and apply a discount to their invoices based on the coupon settings.

⚠️ IMPORTANT ⚠️

Stripe's API will raise an error if you attempt to pass an invalid coupon code. Rewardful attempts to never include an invalid coupon code, but we recommend implementing error handling nonetheless — as always.

One approach is to validate the coupon by attempting to retrieve it from Stripe before adding it to the customer object. For example, in Ruby:

coupon = Stripe::Coupon.retrieve(params[:coupon]) rescue nil

Stripe::Customer.create(
  email: params[:email],
  metadata: { referral: params[:referral] },
  coupon: coupon
)

Retrieving the coupon first (and handling any Stripe API errors) guarantees you'll never encounter a "No such coupon" error when creating the customer.

Tip for advanced users: the coupon data will also be accessible through our JavaScript API. You can use this to customize your website or populate coupon form fields based on the current coupon.

Have more questions?

If you have more questions or would like code samples in another programming language, please let us know at hello@getrewardful.com or by live chat. We'll be happy to help!

Did this answer your question?