How to set up a Refer A Friend program

SparkySparky Member
Hi there,

I want to set up a Refer A Friend program where each customer has a unique code they can share with their friends. It will give a one-time discount on a purchase by the friend. I will track the referrals and the customers earn product from our store.

What would be the best way to approach this?

An old thread suggests creating a stack of coupon codes and then assigning them to customers.

Is this still a good way to approach this? Foxycart's coupon features are much better than 6 years ago so it should be relatively easy to set it up so that each person can only use each code once but each code can be shared many times. It's just figuring out how to assign 1 unique code to each customer and then let them know, ideally in their receipt, what their code is.

I see in another thread, the suggestion to use the Customer ID as the referral code.

How would this be set up so that the Customer IDs are recognized as coupon codes?

  • fc_adamfc_adam FoxyCart Team

    That's for providing a detailed overview of what you're looking to set up. That's a good question.

    There are a few different ways you could approach this, depending on how automated you want the set up to be.

    As an example, utilising the customer ID could be a great way to approach it. It's already a unique identifier for each customer, makes it easy to connect it back to the customer on your side, and as it's already included on the receipt, is easy to display to customers. For displaying it to the customer, you would edit the receipt and email templates to add in some custom text, displaying their code (either as their straight customer ID, or perhaps with a prefix of some kind).

    The trickiest part would be in updating the coupons to include each new customer ID that needs to be added. You could handle this manually if you wanted, or you could also automate it with our API. Using our webhooks, you could trigger an endpoint on your side at the completion of each successful order. If it's a new customer, you could use the coupon resource in the API to find the coupon, and add the customer's ID as an additional code on the coupon. That would mean the coupon code was ready for the customer to pass on to others as soon as they completed their order. You could also create individual coupons for each customer too if you prefer - isolating each one to allow different discounts and track usage easier for each referral. It could make managing your coupons a bit cumbersome though, depending on how many customers would be added to this program.

    For the coupon - you could configure that to only allow a single use per code per customer in the usage settings. That would mean that a customer could only use a given referral discount once, restricted based on their email address entered.

    Could that approach work for your needs? Would you be comfortable working with the API to set up that kind of automation?

    Let us know if we can provide any further details, or if you have any questions!
  • Thanks Adam!

    It sounds like it could be not too complicated to set up - at least for the developer I'm working with. ;-)

    The other option I'm looking at is signing up with Referral Candy. According to, it is supposed to integrate with Foxycart though I can’t see any current discussion about it in this forum and Foxycart is not listed as a supported platform by Referral Candy. What do you think - would that be an easier way to get this set up? I'm not clear from their site how much work is involved.

    Referral Candy comes with other features which are attractive (e.g. fraud detection and it does the follow up with customers and makes it easy for them to share the codes).

    Thanks again, I appreciate your help!
  • fc_joshfc_josh FoxyCart Team
    Hi @Sparky.
    Referral Candy offers a great service and may be a quicker and easier approach since so much is already built and ready to go. Here's information on integrating Foxy and Referral Candy: If you run into any issues at all, please don't hesitate to reach out.

  • Thanks @fc_josh !
Sign In or Register to comment.