A referral program is defined by an advocate, a friend and a referral code.
- The advocate is the person who invited their friend via a referral program.
- The friend is the person who receives the invite from an advocate.
- The referral code is a generated code that can be used by one or more friends.
To learn more about what referral programs are, see the end-user documentation.
Let's imagine we want to set up a referral program for our business in Boston, USA. The program should give a referral code to every customer in the database that they can share with their friends.
Before we begin, let's suppose we have a campaign with the referral and coupon features active.
To set up a referral program, we must generate referral codes for our customers. We can do this in 2 ways:
- Using the Create a referral code endpoint from the Integration API.
- Selecting the
Create referral codeas an effect in a rule inside the Campaign Manager.
Both methods as they offer different benefits.
The endpoint allows us to create referral codes directly instead of updating customer sessions. We can also set a start/expiry date and link the referral code to a customer profile.
Another option is to link the referral code to a friend, which is useful when you're migrating historical referral campaigns to Talon.One.
Let's call the Create a referral code endpoint with this example payload that creates a referral code for customer 88:
Note about the timezone
Pay attention to the
properties. They use the RFC3339 format. They can contain any timezone,
relative to UTC. In this case, the timezone is EST, or UTC-5. You can provide
any timezone (your own, your store's, your app's...), it is
converted to UTC internally.
We can repeat this operation for each customer of our database to give them a referral code.
Let's now imagine that we have more than one loyalty campaign in our application. In this case we want to choose in which campaign the referral code can be redeemed. To do this, we must use the Rule Builder in the Campaign Manager and create an effects.
Whenever this rule gets executed successfully, the integration API returns
referralCreated effect that also contains the referral code generated:
When a user inputs a referral code in your application, share it with Talon.One using the Update Customer Session endpoint.
For example, submitting the
kg5yldcv1i referral code for the profile with id
Once submitted, you can check wether Talon.One accepted or rejected the referral code
by looking for the
rejectReferral effect in the response:
- Accepted referral
- Rejected referral