> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/sample-setups/sample-campaigns/13-refer-friends-who-shop-get-rewards.md).

# #13 Refer friends who shop, get rewards

## Refer friends who shop, get rewards

### Business case

This setup helps you turn referrals into real revenue, not only sign-ups.

Rewarding the member only after their friend's first purchase improves the referral quality. It aligns the incentive cost with a completed business outcome.

Use this setup when you want to:

* acquire new customers through trusted recommendations
* motivate members to bring buyers, not only registrations
* combine points and gifts to make the reward more attractive

<figure><img src="/files/JrfZFeZSghppuDCGBqTN" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Important concepts when talking about referrals

* referrer - the original member
* referee - the friend invited by the member
  {% endhint %}

Use this setup to reward the **referrer** when the **referee** makes their first purchase.

In this example, the referrer gets:

* extra points
* a gift reward

This setup uses a **Referral Campaign** with a **Referee's transaction** trigger.

{% hint style="warning" %}
This setup involves these mechanics:

* a referral link between the referrer and referee
* points added with the **Add units** effect. [Learn about points](/members-and-activity/wallets.md).
* a reward granted with the **Give reward** effect. [Learn about rewards](/rewards-redemption/rewards.md).
  {% endhint %}

### Recommended setup

For this use case, use these elements:

* **Campaign type:** Referral
* **Trigger:** Referee's transaction
* **Referrer reward:** Add points
* **Referrer reward:** Give one gift reward
* **Main condition:** Reward only after the referee's first purchase

{% hint style="info" %}
Use two separate referrer rules with the same condition:

* one rule for points
* one rule for the gift

This keeps the setup clear and easy to maintain.
{% endhint %}

### Step-by-step setup

{% stepper %}
{% step %}

### Prepare the referral flow

Before you create the campaign, make sure the referral link flow works end to end.

1. Retrieve each member's referrer token.
2. Add that token to your referral link or app flow.
3. Capture the token during registration.
4. Send the token in the referred member creation request.

The referrer and referee must already be linked before the first purchase happens.

Learn more about how referral programs work:

{% content-ref url="/pages/Lywj6gE33DaBkknwW3HW" %}
[Referral Programs](/faq/referral-programs.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

### Create the gift reward

Go to **Rewards** → **Reward List** → **Add reward**.

Then:

1. Choose the reward type.
   * Use **Material reward** for a physical gift.
   * Use **Coupon** for a voucher or gift code.
2. Enter the reward name and description.
3. Set availability and visibility.
4. Add redemption limits if needed.
5. Set the reward to **Active**.
6. Save the reward.

Example reward:

* `Welcome gift coupon`

You will select this reward later in the referral campaign.

Learn more about how rewards work:

{% content-ref url="/pages/-MZBsgxfYxB177ii8Wzr" %}
[Rewards](/rewards-redemption/rewards.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

### Create the referral campaign

Go to **Campaigns** > **Referral** and click **Add referral campaign**.

Set the basic campaign details:

* **Campaign trigger:** Purchase transaction
* **Name:** `Refer a friend - first purchase reward`
* **Start date:** choose when the campaign should begin
* **Status:** Active

This means the campaign reacts when the referred member makes a purchase.
{% endstep %}

{% step %}

### Add the rule for points

In **Rules for Referrer**, add a new rule for the points reward.

Use this condition:

* **Referee's first transaction date** → **Is after the date when the campaign was started**

Then add this effect:

* **Add units**
  * **Wallet type:** your points wallet
  * **Calculation formula:** `100`

This rule gives the referrer 100 points after the referee's first purchase.

{% hint style="info" %}
If you want to reward only meaningful purchases, add another condition for the minimum transaction value.
{% endhint %}

Learn more about how points work:

{% content-ref url="/pages/-MZBsg7doWQHfFWAyYNz" %}
[Wallets](/members-and-activity/wallets.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

### Add the rule for the gift

In **Rules for Referrer**, add a second rule.

Use the same condition:

* **Referee's first transaction date** → **Is after the date when the campaign was started**

Then add this effect:

* **Give reward**
  * **Reward:** the gift reward you created earlier

This rule gives the referrer the gift after the same qualifying purchase.
{% endstep %}

{% step %}

### Add limits and fraud protection

Set campaign limits before launch.

Recommended options:

* limit the number of rewarded referrals per member
* add a minimum purchase value for the referee
* set a daily or total cap for the campaign

Example:

* max `5` rewarded referrals per member per day
* reward only when the first purchase is above `$20`

These limits reduce abuse and keep costs predictable.
{% endstep %}

{% step %}

### Test the full flow

Run one full test before launch.

1. Create a test referrer.
2. Register a test referee with the referrer token.
3. Make the referee's first purchase.
4. Check that the referrer receives:
   * the points
   * the gift reward
5. Make a second purchase for the same referee.
6. Confirm the reward is not granted again for the first-purchase rule.

Also verify the referral relation in the member profile.
{% endstep %}
{% endstepper %}

### Example configuration

Here is a simple version of this use case:

* **Referrer reward 1:** 100 points
* **Referrer reward 2:** 1 welcome gift coupon
* **Trigger:** referee purchase transaction
* **Condition:** only the referee's first transaction qualifies
* **Optional extra condition:** transaction value must be above $20

### Expected result

After launch, the flow looks like this:

1. Member A shares a referral link.
2. Member B registers with Member A's referrer token.
3. Member B makes a first purchase.
4. Open Loyalty grants Member A:
   * points in the selected wallet
   * the configured gift reward

### Troubleshooting

#### The referrer did not get rewarded

Check these points:

* the referred member was created with the correct referrer token
* the campaign is active
* the first purchase happened after the campaign start date
* the transaction meets all rule conditions

#### Points were granted, but the gift was not

Check these points:

* the gift reward is active
* the reward is available in the campaign period
* the second referrer rule points to the correct reward

#### The reward triggered more than expected

Check these points:

* campaign limits are configured
* the first-purchase condition is present in both referrer rules
* test transactions are not duplicated by the integration

### Best practices

* Reward the first purchase, not only registration.
* Add a minimum purchase value.
* Start with clear limits.
* Test the full flow before launch.

### Related articles

* [Referral Programs](/faq/referral-programs.md)
* [Referral Campaign](/campaigns/campaigns/campaigns-and-referral-campaigns/creating-campaigns/referral-campaign.md)
* [Creating Campaigns](/campaigns/campaigns/campaigns-and-referral-campaigns/creating-campaigns.md)
* [Creating Reward](/rewards-redemption/rewards/reward-list/creating-reward.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/sample-setups/sample-campaigns/13-refer-friends-who-shop-get-rewards.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
