Skip to main content

[WooCommerce] Integration guide

Connect your WooCommerce store to ReferralCandy, and what to do if you're already on plugin 2.x

Written by Adam

This article applies if you run your store on WooCommerce and want to connect it to ReferralCandy.

Connecting your WooCommerce store to ReferralCandy lets ReferralCandy read your orders, so it can detect which purchases came from a referral and reward the advocate behind them. From plugin version 3.0 onwards you connect by approving ReferralCandy once inside WooCommerce. There are no API keys to find, copy or paste.

If you already run the plugin with API keys, nothing about your setup breaks. Skip to If you're already using plugin 2.x below.


Before you start

Before you start, three things need to be true of your WooCommerce store. The plugin checks the first two on its setup screen and tells you which one is missing.

  • Your store is served over HTTPS. WooCommerce won't deliver the approval to a plain HTTP address.

  • You're signed in as a WordPress administrator who can manage WooCommerce. Only an administrator can approve an app.

  • Your store has a public address. A local or password-walled site can't be reached back, and your store's WordPress REST API needs to be reachable from the internet, because that's how ReferralCandy reads your orders.

The plugin also checks whether your store already has a ReferralCandy account. If it does, it offers to confirm that connection rather than creating a second one.

You also need WooCommerce 9.0.1 or higher, with WordPress 6.4 or higher and PHP 7.4 or higher. The plugin installs on older versions but shows a notice and won't run, so if your store is below those versions, use one of our other integration methods instead.

Check your store currency too. ReferralCandy sets your currency from the location you signed up from, not from your WooCommerce store. If you signed up while travelling, or through a VPN, the two can differ without anything warning you. Fixed-amount friend offers only work when your ReferralCandy currency matches your store currency. Check it under Account > Store details.


How the connection works

The connection between WooCommerce and ReferralCandy has two parts, and it helps to know which does what.

Approving ReferralCandy inside WooCommerce is what links your store. The approval creates a WooCommerce API key whose description starts with ReferralCandy, which you can see under WooCommerce > Settings > Advanced > REST API. That key is how ReferralCandy reads your orders, and it's the only permission you ever grant us.

ReferralCandy also creates your friend offer coupon codes in your WooCommerce store. Each advocate gets their own code, created when they join your campaign, and a purchase that uses one is detected as that advocate's referral. This runs through the store connection, so it works whether or not the plugin is installed.

The ReferralCandy plugin adds the other half. It recognises a friend who arrived through an advocate's referral link, so referrals are detected by the click and not only by the coupon code. Without the plugin, a friend who buys without using a code isn't detected as referred.

You can see both at a glance under Integrations > WooCommerce in your ReferralCandy dashboard: it shows Connected when your store is linked and Plugin active when the plugin is running, along with confirmation that coupon rewards are being created in your store and orders are syncing from it.


Step 1: Install the ReferralCandy plugin

To install the ReferralCandy plugin, use either of the two methods below. You only need one of them.

Method 1: From your WordPress dashboard (recommended)

  1. In WordPress, go to Plugins > Add New Plugin and search for ReferralCandy.

  2. Find ReferralCandy for WooCommerce, published by ReferralCandy, and click Install Now.

  3. Click Activate. A ReferralCandy item appears in your WordPress admin menu.

Method 2: From WordPress.org

  1. Download the latest version ZIP file from the ReferralCandy for WooCommerce plugin page.

  2. In WordPress, go to Plugins > Add New Plugin, then click Upload Plugin.

  3. Select the ZIP file from your device and install it, then click Activate.

Using HPOS? The plugin works whether your store uses High-Performance Order Storage or the older post storage, because order data goes through WooCommerce's own order API either way. It also works with both the classic shortcode checkout and the block checkout. Nothing is needed from you.


Step 2: Connect your store

To connect your store, open ReferralCandy in your WordPress menu. The plugin opens on a single screen with one button, and that button starts the approval that links your store.

  1. Open ReferralCandy in WordPress. The button reads Create account & connect store if your store has no ReferralCandy account yet, or Confirm connection if you already have one. Either way it's the same one-click approval, and running it on an existing account doesn't create a second one.

  2. Click the button. WooCommerce shows its own approval screen, headed ReferralCandy would like to connect to your store, asking for Read/Write access to create webhooks and to view and manage your coupons, customers, orders and sales reports, and products.

  3. Check that the store named on the approval screen is the store you meant to connect, then click Approve.

  4. You land back on ReferralCandy. Enter or check the email address, choose a password, and pick a plan. Your store's address is already filled in, because it came across with the approval.

  5. When the plan is set, ReferralCandy brings you back to the plugin; if it doesn't, or you closed the tab or finished on a different device, just reopen it. It reads Connected. Now launch a campaign. That's Step 3 below. It re-checks with ReferralCandy every time it loads.

ReferralCandy Setup screen in WordPress, headed Create your ReferralCandy account, with the three stages Create account, Approve access and Choose a plan listed down the left, three readiness checks reading Store is served over HTTPS, You can manage WooCommerce on this site and No ReferralCandy account found for this store, and a Create account and connect store button.

WooCommerce authorization screen headed ReferralCandy would like to connect to your store, listing Read/Write access to create webhooks and to view and manage coupons, customers, orders and sales reports, and products, with Deny and Approve buttons.

The approval screen names mainapi.referralcandy.com. That's ReferralCandy's own API domain, so seeing it on WooCommerce's approval screen is expected. Use an email inbox you actually monitor when you create the account, too: it's how you sign in later, and how you'd recover the account if you needed to.

Starting from ReferralCandy instead

You can also start from ReferralCandy rather than from WordPress. If you don't have an account yet, sign up at my.referralcandy.com/signup/woocommerce: it asks for your store address, then sends you to your WordPress admin to approve access, with no keys to copy. If you already have a ReferralCandy account, go to Integrations > WooCommerce.

Whichever way you start, install the ReferralCandy plugin as soon as you can. Your store connects and your friend offer codes are created without it, but until the plugin is active, friends who arrive through an advocate's referral link and buy without using a code aren't detected as referred.


Step 3: Start a campaign

Connecting your store isn't the last step, and starting a campaign is easy to miss. A new ReferralCandy account begins with a campaign that is stopped, and a stopped campaign sends nothing at all: no referral emails, no rewards, even though your store is connected.

The plugin tells you when this is the case. The Overview reads Connected. Now launch a campaign. and the campaign list underneath shows each campaign's real state: Running, Paused, or Not running. Start or resume one in your ReferralCandy dashboard, then reload the plugin page.


If you're already using plugin 2.x

If you're already using ReferralCandy plugin 2.x with API keys, updating to 3.x breaks nothing and nothing is urgent. Your API Access ID, App ID and Secret Key are kept exactly as they were and keep working: orders keep being sent, tracking keeps rendering, and your settings are preserved. The key fields are simply no longer shown, because version 3 has one setup path and it isn't a form asking you to copy three strings.

Your settings still live under Settings in the ReferralCandy menu, and the old WooCommerce > Settings > Integration tab redirects there.

When you're ready to move over, the plugin's Overview offers Connect through WooCommerce. It runs the same one-click approval a new store gets. After that, ReferralCandy reads your orders directly and the plugin stops sending them, so the same order isn't sent twice.


Plugin settings

The ReferralCandy plugin's settings live under Settings in the ReferralCandy menu, grouped into Tracking (called Order Tracking if you're still on API keys), Checkout and Post-purchase popup. What you see depends on how your store is connected.

Tracking

The Tracking group controls where the ReferralCandy tracking code renders. It always renders on your store's order-received page, and the page you pick here is an extra location on top of that. The list holds your store's own pages and always has one selected, starting on Checkout, so there's nothing to switch off here. Change it only if your theme sends customers to a different page after checkout.

Order Tracking (if you're still on API keys)

If your store is still connected with API keys from plugin 2.x, this group is called Order Tracking instead, and it also contains Process orders with status. Orders are sent to ReferralCandy once, when they reach the status you pick here. Completed is the safest default; Processing rewards referrals sooner. Once your store is connected through the WooCommerce approval, ReferralCandy reads your orders directly and this setting disappears, because there's nothing left to configure about sending them.

Checkout

The Checkout group controls the accepts-marketing checkbox shown to customers at checkout, and its label. It works with both the classic shortcode checkout and the block checkout. Turning the checkbox off marks every customer as unsubscribed from referral emails by default.

Post-purchase popup

The Post-purchase popup group shows the ReferralCandy post-purchase popup on your thank-you page, so customers are invited to join your program just after they've bought something. On WooCommerce you turn it on here in the plugin, with no code snippet to paste.

Switching the popup on is what reveals the rest. Turn on Enable at checkout and a Campaign dropdown appears beneath it. Once your store is connected through the WooCommerce approval, that dropdown lists your own campaigns by name: pick the one whose offer the popup should show, then click Save settings. If the only entry is Connect your store to choose a campaign, the plugin hasn't received your campaigns yet, usually because your store is still on API keys. The plugin won't save the popup switched on until there's a campaign to pick, so connect through WooCommerce first. If you're already connected, check that a campaign exists in your ReferralCandy dashboard, then reload the plugin. If you set the popup up on plugin 2.x it keeps working in the meantime: the dropdown shows its campaign key, marked in use, alongside that entry.

Enable the quickfix beside it only if the popup breaks the layout of your thank-you page. If turning on the quickfix doesn't resolve it, our support team can help, just let us know.


Troubleshooting

If something goes wrong while connecting your WooCommerce store, work through the checks below, starting with the most common.

The plugin won't install or won't run

If the plugin won't install or shows a notice that it can't run, the WordPress account you're signed in with may not be allowed to install plugins, or your store may be below the versions the plugin supports. Sign in as a WordPress administrator and confirm you're on WooCommerce 9.0.1 or higher, WordPress 6.4 or higher, and PHP 7.4 or higher. If your host manages updates, ask them to bring the store up to date before you try again.

The connect button isn't available

If the connect button isn't available, the readiness checks on the setup screen show you which one hasn't passed. The usual causes are a storefront that isn't served over HTTPS, or a WordPress account without permission to manage WooCommerce. Install a TLS certificate for your public storefront, sign in as a WordPress administrator who can manage WooCommerce, then reload the ReferralCandy setup screen.

The connection can't be confirmed

The plugin distinguishes two reasons a connection can't be confirmed, and the fix differs. If it says your store approved access but ReferralCandy couldn't be reached to confirm it, nothing is lost: click Try again. If it says the approval link has expired or was already used, click Restart connection and approve once more. Approving again takes a moment and creates nothing new on the ReferralCandy side.

"An error occurred in the request and at the time were unable to send the consumer data"

This message comes from WooCommerce, not from ReferralCandy, and it means WooCommerce approved the connection but couldn't hand the new credentials over to ReferralCandy. Start the connection again from the plugin. If you're already connected with API keys from plugin 2.x, that connection is unaffected and you don't need to change anything. Our support team can look into it with you, just let us know your store URL and roughly when you tried.

Your account still needs a plan

If the plugin says your ReferralCandy account needs a plan, your store is linked but the account never finished at the plan picker. Click Choose a plan, finish it, and reload the page. Don't approve again, because that part is already done.

Your store was connected but is asking again

If your store was connected and the plugin is now asking you to connect again, there are a few possible reasons: the WooCommerce API key was revoked, someone disconnected the store in your ReferralCandy dashboard, the ReferralCandy account was deleted, or your store has moved to a new address. If your store is still on the same address, press the connect button once more to grant a fresh key. If you have moved to a new domain, read the FAQ below first, because reconnecting from a new address behaves differently.

There are several "ReferralCandy" keys in WooCommerce

If you see several keys starting with ReferralCandy under WooCommerce > Settings > Advanced > REST API, that's expected: every approval adds one and older keys aren't removed automatically. They're harmless, so there's no need to tidy them up, and it's best not to: the newest key isn't necessarily the one ReferralCandy is using.

Purchases from referral links aren't detected

If purchases from referral links aren't being detected, the ReferralCandy plugin may be missing or deactivated. If your store is connected through the WooCommerce approval, the plugin also needs to be on version 3.x or higher. Recognising a friend who arrived from a referral link is the plugin's job, so install or update ReferralCandy for WooCommerce and activate it in WordPress. To check, open Integrations > WooCommerce in your ReferralCandy dashboard: it shows Plugin active alongside Connected when the plugin is running. On a store connected through WooCommerce, referrals that came through a friend offer coupon code are detected either way, so this affects link referrals only.

The tracking code isn't running on your thank-you page

The tracking code always renders on your store's order-received page. If your theme sends customers to a different page after checkout, select that page in the Tracking settings so the code runs there too. If a custom thank-you page is still giving you trouble, our support team can take a look at your setup, just let us know.

Your store is connected but no referral emails are going out

If your store is connected but no referral emails are going out, every campaign is probably paused or stopped. Open your ReferralCandy dashboard and start one. The plugin Overview names this specifically when it's the cause.

If none of these resolve it, our support team can look into your account. It speeds things up if you include your store URL, your plugin version, your WooCommerce version, and roughly when you tried to connect. Never send us your passwords or your WooCommerce secret keys.


WooCommerce integration FAQ

Do I still need API keys anywhere?

No. A store that connects through WooCommerce never needs API keys in the plugin, and the plugin doesn't show the key fields at all. Stores set up on plugin 2.x keep the keys they already have, and those keys keep working.

Separately, your ReferralCandy account has its own API Access ID and API Secret ID under Account > Profile. A store connected through WooCommerce doesn't use them, so seeing them there doesn't mean something is missing from your setup. If you're still on plugin 2.x, those are the keys your plugin uses (the plugin's App ID is the same value as the API Access ID).

What access does ReferralCandy get to my store?

ReferralCandy gets read and write access to your store through WooCommerce's own API, which is what lets us read your orders. You can see exactly what was granted, and revoke it, under WooCommerce > Settings > Advanced > REST API.

How do I disconnect my WooCommerce store?

To disconnect your WooCommerce store, go to Integrations > WooCommerce in your ReferralCandy dashboard and click Disconnect WooCommerce. Revoking the ReferralCandy key under WooCommerce > Settings > Advanced > REST API also cuts our access to your store.

Disconnecting your store does not cancel your plan. You'll continue to be billed until you cancel. To cancel your plan or delete your account, see Cancelling and deleting your ReferralCandy account.

I moved my store to a new domain. What do I do?

If you moved your store to a new domain, check with us before you reconnect. The plugin works out what to offer by asking ReferralCandy whether an account already exists for your store's current address, so a store on a new address may not be recognised as the one you already have. Let us know your old and new store addresses and we'll make sure your existing account follows you across.

Can I connect this store to a different ReferralCandy account?

No. Each store address maps to a single ReferralCandy account, and a store can belong to one ReferralCandy account only. If you connect a store that already belongs to an account, we recognise it and link it rather than creating a second one. If you need a store moved to a different account, let us know and we can look at it with you.

Does it work with the block checkout?

Yes. The plugin works with both the classic shortcode checkout and the block checkout. On the block checkout the accepts-marketing checkbox is registered through WooCommerce's own checkout-fields API; on the classic checkout the plugin places it just above the Place order button. A heavily customised checkout may not show it, so if you don't see it, let us know and we can take a look.

Does connecting my store start sending referral emails straight away?

No, connecting your store doesn't start sending referral emails. Your store has to be connected, your account needs a plan, and a campaign has to be running before anything goes out to your customers. Until then, connecting only means ReferralCandy can read your orders.

Did this answer your question?