ReCharge (Shopify)

Integrate ReCharge with Post Affiliate Pro to track recurring payments on Shopify. Use Shopify integration, create an API token, configure the ReCharge webhook plugin, and edit the thank you page for effective affiliate management.

ReCharge (Shopify)

ReCharge (Shopify) integration

Specific integration for ReCharge is no longer needed. Please use the regular Shopify integration instead!

ReCharge platform allows you to add recurring subscription products to your Shopify store. This guide explains how to integrate ReCharge with Post Affiliate Pro to track these recurring payments.

To track recurring payments you either need the [Recurring Commissions](https://support.qualityunit.com/980100-Recurring-commissions “Discover the power of recurring commissions with Post Affiliate Pro. Reward affiliates for subscription-based payments through flexible “accurate” and “dumb” modes. Easily configure and activate the feature, define commission settings, and choose between varied recurrence options. Ideal for businesses with subscription models, this feature simplifies commission management and boosts affiliate engagement. Explore detailed setup guidance and decide if this feature suits your needs. Visit to learn more!”) feature or the Lifetime Commissions plugin activated in your Post Affiliate Pro!

The integration process depends on if the store uses ReCharge Checkout on Shopify or Shopify Checkout.

Customers who installed ReCharge after November 2nd 2020 use Shopify Checkout and customers who installed ReCharge before November 2nd 2020 use ReCharge Checkout on Shopify. You can confirm your store’s checkout type also directly in the ReCharge admin panel in your store - > Settings (wrench icon) -> Store (My account) -> Account status. Click here for more details.

If your store uses Shopify Checkout you need to create an API token as described in step 1. and configure the ReCharge webhook handling plugin as described in step 2. Then proceed to integrate your Shopify store as described in this guide. You don’t need to do steps 3. and 4. below.

If your store uses ReCharge Checkout on Shopify you need to follow all four steps described below.

Create API token

As a first step, you’ll need to contact ReCharge to request access to API. Click here for more details.

Once you are granted API access, you can create your API token. To do so, log in to your Shopify admin panel, go to the Apps section and click on Recurring Billing by ReCharge so you get to the ReCharge panel.

Once there, click on the Integrations tab in the top menu, in this section click on Enabled integrations, and then on API tokens. On the right edge of the page. Afterward, click on Create an API token.

Name the API token however you want, add an email where you will be notified if the webhook should be failing, and most importantly make sure you add Read access permission to Orders. If you can also see the Webhooks permission there, please set it to Read and Write access, however this might have been removed and therefore is no longer needed to be set.

Save the token and copy its API key.

Configure ReCharge webhook handling plugin

The next step is to log into your Post Affiliate Pro merchant panel, go to Configuration - > Plugins and activate the plugin called ReCharge webhook handling. Once it’s active, click the Configure button and add the Recharge API key on the plugin configuration page. On this page, you can also configure what exactly will be tracked as Product ID , and you can also choose if you want to track any additional order data in the extra data fields. When you are finished, save the plugin config at the bottom of the page.

Edit your thank you page

If your store uses ReCharge Checkout on Shopify as described above, log in to your Shopify admin panel, go to the Apps section and click on Recurring Billing by ReCharge to get to the ReCharge admin panel. Once there, click on the Settings (wrench icon) in the upper right corner and go to the Checkout section. Scroll down to the Thank you page section and paste the following code into the Additional & scripts and trackers field:

<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var discountMultiplier = 1 - {{total_discounts}} / ({{subtotal_price}} + {{total_discounts}});
{% for item in line_items %}
var itemPrice = {{item.price}} * {{item.quantity}};
  var sale{{ loop.index }} = PostAffTracker.createSale();
  sale{{ loop.index }}.setTotalCost(itemPrice * discountMultiplier);
  var subscriptionId = '{{item.subscription_id}}';
  if (subscriptionId  != '') {
    sale{{ loop.index }}.setOrderID(subscriptionId);
  } else {
    sale{{ loop.index }}.setOrderID('{{id}}({{ loop.index }})');
  }
  sale{{ loop.index }}.setProductID('{{item.product_id}}');
  sale{{ loop.index }}.setCoupon('{{discount_code}}');
{% endfor %}
PostAffTracker.register();
</script>

If you wish to save customer name or email you can add the following lines:

  sale{{ loop.index }}.setData1('{{email}}');
  sale{{ loop.index }}.setData2('{{first_name}} {{last_name}}');

under the:

sale{{ loop.index }}.setCoupon('{{discount_code}}');

You can find more available variables in ReCharge knowledgebase.

Click tracking

Log in to your Shopify admin panel, go to the Online store section, and click on Themes. In this section click on the Actions button in your Live theme preview, and choose Edit code from the drop-down menu.

In the Layout directory, find a file called theme/liquid. Insert the click tracking code from your **_Post Affiliate Pro merchant panel - > Tools -> Integration -> Clicks tracking _**right above </BODY> tag in this file and save it.

Frequently asked questions

What is the ReCharge (Shopify) integration for Post Affiliate Pro?

It allows you to track recurring subscription payments from ReCharge on your Shopify store within Post Affiliate Pro, enabling efficient affiliate commission management.

Is a specific ReCharge integration still required?

No, a specific integration for ReCharge is no longer needed. Stores can use the standard Shopify integration with Post Affiliate Pro.

How do I track recurring payments for ReCharge subscriptions?

You need to enable the Recurring Commissions feature or the Lifetime Commissions plugin in Post Affiliate Pro to track recurring payments from ReCharge subscriptions.

What are the main steps to integrate ReCharge with Post Affiliate Pro?

Main steps include creating an API token in ReCharge, configuring the ReCharge webhook handling plugin in Post Affiliate Pro, editing your Shopify thank you page, and setting up click tracking.

What if I installed ReCharge after November 2nd, 2020?

If installed after this date, your store uses Shopify Checkout. You need to create an API token and configure the ReCharge webhook handling plugin, then continue with the standard Shopify integration.

Where can I find more details on available variables for scripts?

Refer to the ReCharge knowledgebase for a list of available variables for email notifications and scripts.

Lucia is a talented content editor who ensures the seamless publication of content across multiple platforms.

Lucia Halašková
Lucia Halašková
Content Editor

Enhance Your Affiliate Program with Shopify & ReCharge

Seamlessly track subscription payments and manage affiliate commissions by integrating ReCharge (Shopify) with Post Affiliate Pro. Start optimizing your e-commerce operations today.

You will be in Good Hands!

Join our community of happy clients and provide excellent customer support with Post Affiliate Pro.

Capterra
G2 Crowd
GetApp
Post Affiliate Pro Dashboard - Campaign Manager Interface