> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create referral campaign

> Learn how to create a referral campaign in the Campaign builder

The referral campaign builder guides you through the following steps to launch your program.

Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Referral codes**.

<Tip>
  <Badge color="green">Campaign draft</Badge>

  If you can't configure the whole campaign in one go, don't worry.

  You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.

  If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.

  That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
</Tip>

<Steps>
  <Step>
    ## Program size

    Start by defining the core identity of your campaign:

    1. Enter unique **Campaign name**.
    2. Optionally, select a **Category** to group this campaign.

    3) Optionally, provide a **Description** for internal reference.
    4) Optionally, enable **Customers can join campaign only once** to ensure each customer can own only one referral code in this campaign.

    Next, define campaign size:

    * Set **Code count** to define how many referral codes are generated when the campaign is created.
    * Enable **Auto-increase voucher count** to automatically generate new referral codes when the initial pool is exhausted.

    Set **Code generation settings**:

    * Define the pattern, format, charset, and other details for your codes.
  </Step>

  <Step>
    ## Timeframe

    You can add the following optional time limitations:

    * **Starts on** and **Expires** dates
    * **Duration and interval time frame** (for example, every 2 days for 3 hours)
    * **Valid days of the week** (for example, only Wednesdays)
    * **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)

    - Set **Keep valid for a specific amount of time after publishing** to ensure referral codes expire after a defined time once assigned to customers.
  </Step>

  <Step>
    ## Incentive workflow

    Select the conversion event and define if the referral program is single-sided (referrer is rewarded) or double-sided (both referrer and referee are rewarded).

    <Steps>
      <Step title="Select conversion event">
        Select the event that marks a referral as successful.

        You can select one of the following:

        * **Code redemption**\
          The referee redeems the referral code (for example, during checkout).

          A successful redemption means a successful referral.

        * **Custom event**

                  <Info>
                    <Badge color="gray">Prerequisite: Developer setup</Badge>

                    Tracking custom events in your system requires sending them to Voucherify through [POST Track custom events](/api-reference/events/track-custom-event) API endpoint.
                  </Info>

          The referral is confirmed by an API custom event (for example, `subscription_paid`, `social_media_sign_up`).

          Select a custom event or create a new one.

          Voucherify records a successful referral when it receives the event together with a referral code.
      </Step>

      <Step title="Select who will be rewarded">
        Decide how incentives are distributed in your referral program:

        * **Referrer** (single-sided)\
          Only the referrer receives a reward.

        * **Referrer and referee** (double-sided)\
          Both the referrer and the invited customer receive rewards.

        If you select **Referrer and referee**, the referee-specific steps will be available later in the builder.
      </Step>
    </Steps>
  </Step>

  <Step>
    ## Referee eligibility

    <Info>
      This step includes **Referee reward** panel only when you selected **Referrer and referee** in the **Incentive workflow** step.

      If you selected **Referrer**, you can also add a **Validation rule**.
    </Info>

    Define how the **referee is rewarded** after a successful referral conversion.

    <Steps>
      <Step title="Referee reward type">
        If **Referrer and referee** is selected in the **Incentive workflow** step, select what the invited customer receives:

        * **Discount coupon** – apply a discount to the referee’s order.
        * **Credits on gift card** – add a balance to the referee’s gift card in an existing gift card campaign.
        * **Points on loyalty card** – add loyalty points to the referee's loyalty card in an existing loyalty campaign.
      </Step>

      <Step title="Reward configuration">
        Configure the selected reward type:

        * **Discount coupon**
          * Define discount type, value, and conditions (validation rule).
          * Control when and how the discount is applied to orders.

        * **Credits on gift card**
          * Define the gift amount.
          * Select the target gift card campaign.

        * **Points on loyalty card**
          * Define the number of loyalty points.
          * Select the target loyalty campaign.
      </Step>

      <Step title="Validation rule">
        <Info>
          The **Validation rule** step is available only for **Credits on gift card** and **Points on loyalty card**. For **Discount coupon**, add a **Validation rule** in the **Conditions** step in the discount builder.

          You can also add a **Validation rule** when only the **Referrer** is rewarded.
        </Info>

        Optionally, add or create a validation rule to restrict when the referee reward can be granted (for example, new customers only or order value conditions).

        <Tip>
          For single-sided referral campaigns, it's recommended to set the **Redemptions per customer in a campaign** rule to **less than or equal to 1**. This way, each referee can use a referral code from this campaign only once. Referees won't be able to redeem one code twice or use referral codes from several referrers.
        </Tip>

        <Note>
          Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.

          Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
        </Note>
      </Step>
    </Steps>
  </Step>

  <Step>
    ## Referrer rewards

    **Create tier** to configure rewards for referrers with **referral tiers**.

    <Steps>
      <Step title="Tier criteria">
        Select how referrers qualify for rewards:

        * **Each unique referee redemption** – reward the referrer for every successful referral.
        * **Minimum unique referee redemptions** – reward the referrer after reaching a defined number of successful referrals. You can **Add filter** to create a customer segment that a referrer must be part of to receive a reward.
      </Step>

      <Step title="Reward configuration">
        Add a **Digital** (a discount coupon, credits on a gift card, points on a loyalty card) or **Material** (a product) reward. Optionally, create a new reward.
      </Step>

      <Step title="Channels">
        Add distribution channels that trigger notifications when all reward criteria are met and a reward is assigned to the referrer.
      </Step>
    </Steps>

    You can configure multiple referral tiers within one campaign.
  </Step>

  <Step>
    ## Distributions (optional)

    Set up automatic messages sent when referral events occur. Messages can be sent to customers or external systems using channels such as email, SMS, webhooks, or integrations.

    <Note>
      The distribution builder is preconfigured for the selected event. The only step to configure is **Channels**.
    </Note>

    <Steps>
      <Step>
        **Add distribution** and select the event:

        * **Successfully published** – used when a voucher is successfully published to a customer.
        * **Customer was referred** – used when a new customer joins through a referral.
      </Step>

      <Step>
        In the distribution builder, **Name distribution**.
      </Step>

      <Step>
        Go to **Channels** to **Add channels**. You can add one or more distribution channels.
      </Step>

      <Step>
        In **Summary**, review the configuration and **Save** the distribution.
      </Step>
    </Steps>

    You can add many distributions to a referral program.
  </Step>

  <Step>
    ## Metadata (optional)

    Add custom attributes for tracking, optimizing, or experimenting.

    You can either:

    * **Use an existing metadata schema**.
    * **Add unknown property**: metadata that isn't defined and won't be added to the schema.
    * **Add to schema**: define new metadata schema. Once saved, reload the schema to use the new metadata.

    <Note>
      Read [Metadata](/prepare/metadata) to learn more about custom attributes.
    </Note>

    By default, the campaign uses **Voucher metadata schema**. This will set metadata for the campaign and its vouchers. If you're editing the campaign, changes made to the metadata will apply only to the vouchers that haven't been redeemed yet and haven't been published to any customers.

    Uncheck **Use the voucher's metadata schema** to use campaign metadata schemas. The metadata will apply only to the campaign and not to its vouchers.
  </Step>

  <Step>
    ## Access settings

    Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.

    <Note>
      <Badge color="blue">Enterprise feature</Badge>

      This step is available for Enterprise clients who have the Areas and stores feature enabled.

      Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).

      Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
    </Note>
  </Step>

  <Step>
    ## Summary

    Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.

    If the setup is correct, click **Save** to launch your campaign.
  </Step>
</Steps>

<Warning>
  Editing campaign settings (for example time frame or expiration settings) affects only vouchers that *have not been published or redeemed yet*.

  Vouchers that are already *published or redeemed keep their existing settings*.
  To change their settings, update the voucher directly.
</Warning>

<Tip>
  <Badge color="green">Campaign calendar</Badge>

  Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
</Tip>

## Related features

Explore additional features to improve referral performance.

<AccordionGroup>
  <Accordion title="Referral code publication">
    Each referral code needs to be published to a referrer before referees can use it. Publication means that a referral code is assigned to a particular customer (referrer).

    Learn how you can [publish referral codes](https://support.voucherify.io/article/460-how-can-i-publish-codes-to-my-customers).
  </Accordion>

  <Accordion title="Custom events: Reference article">
    If you want to build your referral program around a custom event, read the [Custom events](/prepare/custom-events) article first.
  </Accordion>

  <Accordion title="Campaign tracking">
    Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.

    <Tip>
      <Badge color="green">Dev tools</Badge>

      Devs can use the following tools for campaign tracking:

      * [Voucherify Core MCP](/guides/voucherify-core-mcp)
      * [Campaign summary API](/api-reference/get-campaign-summary)
    </Tip>
  </Accordion>

  <Accordion title="Fraud prevention">
    Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.

    You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.

    Learn more about stopping incentive fraud in:

    * [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
    * [Fraud prevention and tracking](https://support.voucherify.io/article/516-fraud-prevention) article.
  </Accordion>
</AccordionGroup>
