Skip to content
Operator handbook
Refer a Friend
Commercetools
Commercetools

Refer a Friend

This article explains what you can see and manage in commercetools for the Refer a Friend program. A customer shares their referral code with a friend. The friend gets a discount on their first order, and once that order is paid the customer gets a voucher of their own.

Referral codes and the vouchers customers earn are not commercetools discount codes. They live in Voucherify, so you will not find them in the Discount code list, and you should not create them there. The amounts, minimum order values and how long a voucher stays valid are Voucherify settings. Ask the development team to change them.

For the landing page, the referral portal and its texts, see Refer a Friend in Hygraph.

Participants

Each brand has its own customer group for the program, for example vitaminexpress-friend-referrers for VitaminExpress. Customers enrol themselves: the first time a logged-in customer opens the referral portal, they are added to the group and get their referral code. There is nothing to do for this in commercetools.

Customer groups

To see who takes part, in commercetools navigate to Customers in the left menu bar, open the customer list, click Filters and pick the group under Customer group (Assignments).

Participants

  • Adding a customer to the group by hand is rarely needed, but also creates their referral code without them opening the portal. Open the customer, go to the Customer groups tab and click Assign customer group. Do not use the Customer group field on the General tab, that one does not create a code. The code is only created when the customer has a language set (the culture custom field), because VitaminExpress runs the program in both EUR and CHF.
  • Removing a customer from the group (the bin icon on the same tab) does not take their code away, and they are added back the next time they open the portal. To stop someone from taking part, ask the development team.
  • Do not rename or delete the group. Its key has to match the Protected Area in Hygraph and the program in Voucherify, otherwise nobody can join.

Customer groups tab

Referral discounts on carts and orders

Because the codes are not commercetools discount codes, they also do not show as one on a cart or order. The friend's discount and a redeemed voucher show as an extra line with a negative amount, next to the products:

Code English name German name
Friend's referral code Friend discount Freundschaftsrabatt
Referrer's voucher Referral voucher Empfehlungsgutschein

The name follows the language of the shop. The website lets a customer use one code per cart, so a referral code cannot be combined with a commercetools discount code. Automatic cart discounts, such as tier discounts, still apply next to it and show under Cart Discounts as usual.

Referral discounts on carts and orders

Times applied on the Discount code list does not count referral codes. For numbers on the program, ask the development team.

New customers only

A referral code only works for new customers. The shop checks the customer's order history in commercetools: anyone with an order created in the last 12 months is not new. Cancelled orders count as well, orders from the last hour do not count yet.

A guest can add the code to the cart. The check runs again once the cart belongs to a customer, at login or checkout, and the discount is removed if they turn out not to be new.

Payment and cancellation

The program reacts to two changes on an order:

Payment and cancellation

  • Payment state becomes Paid. When the friend's order is paid, the friend's use of the code is registered and the referrer gets their voucher. This also happens when you set an order to Paid by hand.
  • Order state becomes Cancelled. The friend's use of the code is reversed. The voucher the referrer already received stays valid.

Nothing else affects the program. A return or refund without cancelling the order changes nothing.

Ask the development team

Ask the development team, via #help-commercetools-hygraph, for:

  • Changing an amount, a minimum order value or how long a voucher stays valid
  • Changing the rules, for example who counts as a new customer or how often a code can be used
  • Stopping a customer from taking part, or taking back a voucher
  • Starting the program on another brand or currency