# Auto-generate coupon

Imagine you have so many affiliates joining regularly. Manually assigning coupons for each of them would be very time-consuming and overwhelming. This multi-step manual task can be optimized by automatically generating coupons following a preset rule.&#x20;

With the **Auto-generate coupon feature**, as soon as affiliates join your program, our system automatically creates a coupon code for each of them with the same discount rules you set for the sample coupon.

## Set up Auto-generate coupon

To start setting up **Auto-generate coupon**, please follow the below steps:

1. Create a discount code in the **Discounts** section of your **Shopify admin** (please DO NOT choose **Automatic discounts** because our system only tracks referrals with normal **Discount codes**).
2. Go back to UpPromote > **Settings** > **Link & coupon** > **Coupon settings.** Next, locate the **Auto-generate coupon** section, then click **Set up**.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2F0DLfQeVBFgTfMjS38Ul7%2Fimage.png?alt=media&#x26;token=8f5818b1-8548-4c6f-86a0-7332e8b16750" alt=""><figcaption></figcaption></figure>

3. Once you access the *Auto-generate coupon* page, switch the feature on and click **Save** to confirm the activation. After that, start adding a sample coupon.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FCXeltc9EfFsXL3zuOyOR%2Fimage.png?alt=media&#x26;token=3d8bbec4-764e-403b-aead-1d51e2e5c5e6" alt="" width="563"><figcaption></figcaption></figure>

4. For the sample coupon, select the program(s) that you want to generate coupons for the affiliates who join there. If you want to create a sample coupon for all programs, choose **Select all**.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FgTPpYMDO928GZwOTcZMe%2Fimage.png?alt=media&#x26;token=8745cb61-5b91-4b76-9825-e4c9e4f3934c" alt="" width="563"><figcaption></figcaption></figure>

5. Choose a **Coupon name's format**, including *Affiliate's name, Affiliate's first name,* *Random letters,* or *Affiliates select while registering*.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FYYD5WOAoaae5dfLxM9ZK%2Fimage.png?alt=media&#x26;token=621db4bd-5b95-4940-9ab8-f5bdaa2130d3" alt="" width="563"><figcaption></figcaption></figure>

***Note***: In case of a duplicate first name, the system will automatically generate coupons following the rule of FIRSTNAME + AFFILIATE ID (the affiliate ID can be found in the Affiliates tab). For example, if you have 3 affiliates named John, the first one will get the JOHN code, the second one will have JOHN2495068 (2495068 is his affiliate ID), and the third affiliate's coupon is JOHN2495063 (2495063 is his affiliate ID).&#x20;

6. If you choose **Affiliates select while registering**, move to **step 7**. You can also learn more about this option [here](https://docs.uppromote.com/set-up/tracking-by-coupon/allow-affiliates-to-fill-in-their-preferred-coupon-code-while-registering).

If you choose the coupon format of **Affiliate's name, Affiliate's first name,** or **Random letters**, you can set up to add a **prefix** or **suffix** to the auto-generated coupons.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2F8GPl2T7K1E4iB0Hb9LKd%2Fimage.png?alt=media&#x26;token=a55f37cf-2218-429f-8d7e-38f184445615" alt="" width="563"><figcaption></figcaption></figure>

* **Prefix**: Add characters to the beginning of the auto-generated coupons.
* **Suffix**: Add characters to the end of the auto-generated coupons.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2Fe7sXvSmjP8XSa7osN6zs%2Fimage.png?alt=media&#x26;token=2a379f3b-732f-4e22-8021-f2bcaac994bb" alt="" width="563"><figcaption></figcaption></figure>

7. Enter the sample coupon that is already created in your Shopify Discounts. Then, finish setting up by clicking **Save**.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FIoQCmzCzOEtu16ugRzgU%2Fimage.png?alt=media&#x26;token=5dd5468f-a37e-4730-a660-fe6d8691ce91" alt="" width="563"><figcaption></figcaption></figure>

💡 **Important notes about the sample coupon:**

* Once you add a sample coupon, please do not change its name in your Shopify admin to avoid auto-generating coupon errors.
* When affiliate coupons are generated from a sample coupon, a sub-code similar to the sample coupon will also be created in your Shopify admin. Please DO NOT remove that sub-code. Deleting it can cause the sample coupon to stop functioning and prevent the system from generating new affiliate coupons.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2Fwu6Mkw1312cOGNF5PkIu%2FFine%20Snowboards%20%C2%B7%20Discount%20SUMMERSALE%20%C2%B7%20Shopify%20(1).gif?alt=media&#x26;token=3afb3a79-d907-4a00-8fb4-f24e5a3ce465" alt=""><figcaption></figcaption></figure>

* The latest sample coupon added will be displayed on top of the sample coupon list.&#x20;

8. (Optional) Enter a description for the coupons generated from the sample coupon.&#x20;

If you already added a description for a sample coupon, you can edit it. However, the new description will only be applied to newly generated coupons, while old coupons will still have the old description.

## Auto-generate coupons for existing affiliates

If you want to add a new coupon for the current affiliate list with bulk action, you can create a new sample coupon as instructed, then click the cyan button—**Auto-generate coupon for existing affiliate in the selected program(s)** to assign the code to all affiliates in chosen programs that haven't been assigned with this coupon.

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FiW06WZiRvRnng0GkegfS%2Fimage.png?alt=media&#x26;token=145021f4-8b39-4d6b-896b-aa1903a3908d" alt="" width="563"><figcaption></figcaption></figure>

The newly assigned coupon will be shown on the affiliate account's **Dashboard**. The system will also send the **New coupon** email to affiliates once they have a new coupon added to their account.

{% hint style="warning" %}
After creating a sample coupon, you have the option to **delete it. You can also choose whether to remove all affiliate coupons** generated by the sample coupon (make sure that you inform your affiliates about this change).
{% endhint %}

<figure><img src="https://2915776664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnqRFg4of77qA6qOdUp%2Fuploads%2FacwJV9IZxOOht7d4uGO0%2Fimage.png?alt=media&#x26;token=55cf1f37-1504-4c31-b1ed-8fc859888cfc" alt="" width="563"><figcaption></figcaption></figure>
