How to Leverage Friendbuy With ReCharge

Samantha Samuels Updated by Samantha Samuels

How to Leverage Friendbuy with ReCharge

Leverage both Friendbuy and ReCharge's platforms to automatically distribute ReCharge codes to referred Friends and Advocates for discounts off subscription products. There are two options

Option 1: Friendbuy will distribute Recharge discount codes via Reward Email. Advocates can then apply these coupon codes toward future subscription orders by logging into their ReCharge account.

Option 2: Automatically apply a discount code toward a future subscription via Friendbuy's Reward Webhooks and Recharge's discounts API

How to enable Option 1 - Friendbuy Distributes Coupon Codes

Step 1: Create bulk discount codes in ReCharge 

Creating a large volume of discount codes in ReCharge can be accomplished in two ways. You can either use the ReCharge API or ask the ReCharge Support team to create them for you. For the latter, please contact with a description of the request.

In addition to configuring your discounts codes with the appropriate fixed amount or percentage off, here are some items to keep in mind when creating discount codes:

  • We suggest naming discount codes with a convention that can be used to easily identify to whom they will be distributed: an Advocate or Friend. For example, use an “ADV” and “FRN” prefix, respectively.
  • Make sure to apply usage limits so that each discount code can only be used by one customer, for one subscription, for a single charge.
  • Friendbuy will notify you via email if you’re running low on codes. However, we suggest you create enough to last at least one year.

For a complete guide to ReCharge discount codes and all of the options, please refer to the ReCharge discounts documentation.

Step 2: Add your ReCharge discount codes to Friendbuy

To complete this step, you must have CSV or TXT files that contain the discount codes created in ReCharge. 

  • If you’re using the the ReCharge API, you can call the List Discounts endpoint to retrieve a list of codes.
  • If the ReCharge support team created the discount codes for you, they’ll send you a CSV once the codes have been added or you can download a discounts export from the reports page in Recharge.

Once you have your discount code files handy, you’ll want to create code banks in Friendbuy for both Advocates and Friends and upload each respective discount code file. For detailed instructions about creating code banks and uploading codes, please check out this Friendbuy help article.

Step 3: Install Friendbuy Conversion Tracking code on Recharge checkout

Needs to be installed with both Integration Options

Since referred friends will be checking out on a ReCharge hosted page, you'll need to install Friendbuy's conversion tracking code to ensure you're capturing referral conversions. 

Copy and paste the below code in Settings > Checkout > Thank you page > Additional scripts and trackers. Be sure to replace the MERCHANT ID ('xxxxx' below) with your site ID from the Integration Code section in your Friendbuy account. 

window["friendbuyAPI"] = friendbuyAPI = window["friendbuyAPI"] || [];

// registers your merchant using your merchant ID found in the
// retailer app
friendbuyAPI.merchantId = "XXXXX";
friendbuyAPI.push(["merchant", friendbuyAPI.merchantId]);

// load the merchant SDK and your campaigns
(function(f, r, n, d, b, u, y) {
while ((u = n.shift())) {
(b = f.createElement(r)), (y = f.getElementsByTagName(r)[0]);
b.async = 1;
b.src = u;
y.parentNode.insertBefore(b, y);
})(document, "script", [
"" + friendbuyAPI.merchantId + "/campaigns.js",
id: '{{ order_number }}',
amount: '{{ total_price }}'.replace(/[$,]+/g,""),
currency: '{{ currency }}',
couponCode: '{{ discount_code }}',
email: '{{ email }}'

Enabling referred Friends to apply their discount code to subscriptions

You’re in luck, there is nothing to configure here! Referred Friends can simply apply their discount code on the ReCharge checkout page for a discount toward their new subscriptions. 

Enabling Advocates to apply their discount code to an existing subscription

Advocates can redeem their reward by accessing the ReCharge Customer Portal and applying their discount code to one of their Subscriptions. Note, this option is not enabled in ReCharge by default. To turn it on, login into your ReCharge dashboard then navigate to Settings > Customer Portal > Discounts, then enable the “Allow customers to input discount code on customer portal” option.

Note, ReCharge allows only one discount code to be applied to a subscription at a time. If an Advocate earns multiple rewards through the referral program in a given month, they can apply that discount to their next recurring subscription when that period hits.

For the best user experience, we recommend adding a sentence or two to your Friendbuy Advocate Reward Email that describes how they can redeem their discount code.  Here is an example you’re free to use.

“Thanks for sharing! Here's your discount code to redeem on your next subscription. When you’re ready to cash in on your reward, simply login to your account, click on Subscriptions, and add your code into the Apply Discount Code field. We’ll then automatically apply the discount towards your next subscription!”

Support for a la carte products in addition to subscription

If you want to provide discounts off a la carte products as part of the offer structure for your Friendbuy referral program, you’ll also need to create the same discount codes in Shopify.  You can learn more by checking out Shopify’s discount code article. If you’re looking for an easy to use tool for create your Shopify discount codes, we recommend the Bulk Discounts Shopify app.

How to enable Option 2 - Automatically Apply Discount Codes Toward Future Subscriptions via API

Leverage Friendbuy's Reward Webhooks to automatically apply a discount code toward an Advocate's future subscription order. You can use the Recharge API to create the Recharge discount code in real time and apply it to an Advocate's future subscription order.

How did we do?

How to Enable the Iterable Integration

How to Enable the Cordial Integration