Voucher Automation Configuration

Automatically generate Shopify discount codes when a reward's coupon stock runs low

Written By mkumar (Super Administrator)

Updated at October 22nd, 2026

Overview

Voucher Automation keeps your reward coupon codes topped up without repeated manual uploads. Annex Cloud tracks how many coupon codes are still available for a reward. When that number drops to the threshold you set, a webhook is triggered automatically. The webhook creates new discount codes in your Shopify store, using the settings saved on the reward, and adds them to the reward's coupon group in Annex Cloud, so members can keep redeeming the reward without interruption.

Coupons are created in Shopify through the Shopify REST Admin API, using a price rule. Automation only adds new batches to a coupon group that already has codes; it does not generate coupons from scratch, so you upload the first batch yourself (see Step 3). The reward acts as the template for each coupon, so a single reward can keep producing unique coupons throughout its lifetime.

Key terms

Term Meaning
Coupon group The pool of coupon codes attached to a reward. Each redemption uses one code from the group.
Threshold The Low Coupon Alert Count. When the number of available codes drops to this value, new codes are generated.
Webhook An automatic call from Annex Cloud to the coupon generation service, made when the threshold is reached.
Reward Attributes Extra reward fields (shown under UI Settings) that hold the voucher parameters, such as value and prefix.

How it works

Figure 1: Voucher Automation flow
Figure 1: Voucher Automation flow
  1. Member redeems: each redemption uses one coupon code, so the available count goes down.
  2. Threshold reached: the available count reaches the Low Coupon Alert Count set on the coupon group.
  3. Webhook triggered: the Voucher Creation webhook is called automatically.
  4. Shopify discounts created: the webhook reads the reward's UI Settings and creates the configured number of discount codes in Shopify.
  5. Codes added back: the new codes are added to the coupon group and are ready for redemption.

Configuration at a glance

Step What you configure Where
1 Create the voucher reward Loyalty > Rewards > General Information
2 Voucher parameters Loyalty > Rewards > UI Settings
3 Coupon group and threshold (Low Coupon Alert Count) Loyalty > Additional Loyalty Settings > Coupon Groups
4 Low coupon email (optional) Loyalty > Rewards > Additional Settings
5 Voucher generation webhook Admin 2.0 > Webhook
6 Check that coupons are generated Admin 2.0 > Webhook > View Logs

Before you begin

  • You have access to the Annex Cloud Admin and to Admin 2.0 (Webhooks).
  • Your Shopify store is connected to Annex Cloud so that discounts can be created in Shopify.
  • The Reward Attributes used for voucher generation exist on your site (see below).

Check the voucher Reward Attributes

Navigation: Loyalty > Additional Loyalty Settings > Extended Attributes > Reward Attributes

The voucher parameters you fill in on Step 2 are Reward Attributes. Before you start, check that the attributes below are listed. If any are missing, contact your Annex Cloud Customer Success Manager, because the names must match exactly, including upper and lower case.

  1. reward_min_value, reward_checkout_display, Reward_Value and Reward_Name
  2. requiredCoupons and couponPrefix
Figure 2: Reward Attributes used for voucher generation
Figure 2: Reward Attributes used for voucher generation

Step 1: Create the voucher reward

Navigation: Loyalty > Rewards > Add New Reward (or select an existing reward and click Edit)

On 1. General Information, enter the Reward Name, set Reward Category to Vouchers and turn Reward Status ON (highlighted). Complete the Redemption step as usual, then continue to UI Settings.

Figure 3: Reward Category and Reward Status on the General Information step
Figure 3: Reward Category and Reward Status on the General Information step

Step 2: Configure the voucher parameters

Navigation: Rewards > select the reward > Edit > 3. UI Settings

These fields tell the webhook what kind of coupon to create in Shopify. Fill in the six parameters below; the values shown are sample values.

Parameter What it controls Sample value
reward_min_value Minimum value linked to the discount (for example, the minimum order amount needed for the coupon to apply). 10
reward_checkout_display Text shown for the discount at checkout. $10Shopify
Reward_Value Discount amount that each generated coupon gives. 10
Reward_Name Name given to the discount created in Shopify. $10 Shopify
requiredCoupons Number of coupon codes created each time the webhook is triggered. 2
couponPrefix Prefix added to the start of every generated coupon code. Shop10
Figure 4: Discount parameters (1) and coupon generation parameters (2) in UI Settings
Figure 4: Discount parameters (1) and coupon generation parameters (2) in UI Settings

Note: discountId is not required, so leave it blank. lang_translation and reward_name_lang are used to display the reward in the reward widget and are not needed for voucher generation. When you are done, click Next. The reward is saved when you click Update Reward on the last step, 4. Additional Settings.

Step 3: Create the coupon group and set the threshold

Navigation: Loyalty > Additional Loyalty Settings > Coupon Groups

Create the coupon group

If the reward does not have a coupon group yet, click Add New Coupon Group and fill in the form:

  1. Select Product: Loyalty Program. Coupon Type: Reward Coupon.
  2. Coupon Group Name: enter the reward name exactly as it appears on the reward, for example $10 Shopify Voucher.
  3. Upload Coupons: upload a starting set of codes from a CSV file (one code per line, no blank lines). This first upload is required: voucher automation only generates new batches for an existing coupon group and does not create coupons from scratch. Use Download sample spreadsheet for the format.

Click Save.

Figure 5: Add Coupon Group
Figure 5: Add Coupon Group

Important: The coupon group is linked to the reward by name. If the Coupon Group Name does not match the Reward Name exactly, the reward will not use this group.

Set the threshold

Find the coupon group for the reward (1) and click the Edit (pencil) icon in the Actions column (2). The list also shows Total, Used and Available Coupons, which is a quick way to check stock at any time.

Figure 6: Coupon Groups list
Figure 6: Coupon Groups list

In the Edit Coupon Group window, scroll down and fill in:

  1. Low Coupon Alert Count: the threshold. When Available Coupons drops to this number, the webhook is triggered and new coupons are generated.
  2. Alert Sent To: the email address(es) that receive the low coupon alert. Separate multiple addresses with commas.

Click Save.

Figure 7: Low Coupon Alert Count (1) and Alert Sent To (2)
Figure 7: Low Coupon Alert Count (1) and Alert Sent To (2)

Tip: Choose a threshold that leaves enough codes to cover redemptions while new codes are being created. For example, if a reward is redeemed around 20 times a day, a threshold of 50 gives a comfortable buffer. Set requiredCoupons high enough that each run brings Available Coupons well above the threshold.

Step 4: Set up the low coupon email (optional)

Navigation: Rewards > select the reward > Edit > 4. Additional Settings

Under Notification Alert Settings (highlighted), enter a Notification Email Subject (for example, "Low Coupon alert") and a Notification Email Body. These set the subject and body of the low coupon alert email. Click Update Reward.

Figure 8: Notification Alert Settings
Figure 8: Notification Alert Settings

Step 5: Configure the webhook

Navigation: Admin 2.0 > General > Webhook

The Voucher Creation webhook (2) connects Annex Cloud to the coupon generation service. The list shows its method, status, success rate and the dates of the last success and failure. Make sure the Enable toggle is on. To add a new webhook, click Create Webhooks (1).

Figure 9: Webhooks list
Figure 9: Webhooks list

The Create Webhook form has three steps (1): Endpoint Details, Event Subscriptions and Securities & Retries. Start with the endpoint details (2):

Field What to enter
Name A clear name, for example "Voucher Creation".
Method POST
URL The coupon generation endpoint provided by Annex Cloud.
Templates The site(s) the webhook should run for.
Description Optional notes about the webhook.
Figure 10: Create Webhook – Endpoint Details
Figure 10: Create Webhook – Endpoint Details

Under Security & Authentication, select the Auth Type (JWT), enter the Secret Token and click Verify Connection to confirm the endpoint can be reached. Click Next, choose the event on Event Subscriptions, set the retry options on Securities & Retries, and save.

Figure 11: Create Webhook – Security & Authentication
Figure 11: Create Webhook – Security & Authentication

Step 6: Check that coupons are generated

  1. Go to Webhook, click the actions menu (⋮) on the webhook and select View Logs.
  2. Set the start and end dates and click Search (1).
  3. Each trigger is listed with its own Event ID. Success with status code 200 (2) means the coupons were created. If a call fails, the reason appears in the Error column.
  4. Go back to Coupon Groups and confirm that Total and Available Coupons have increased.
Figure 12: Webhook Logs
Figure 12: Webhook Logs

Test checklist

Use this checklist to confirm the set-up works end to end before going live.

  1. The reward is set to Vouchers with Reward Status ON.
  2. All six UI Settings parameters are filled in and the reward is saved.
  3. On the coupon group, temporarily set Low Coupon Alert Count just below the current Available Coupons.
  4. Redeem the reward until Available Coupons reaches the threshold.
  5. In Webhook > View Logs, confirm a new entry with status Success and code 200.
  6. In Coupon Groups, confirm that Total Coupons has increased by the requiredCoupons value.
  7. In Shopify, confirm the new discounts exist and their codes start with the couponPrefix.
  8. Confirm the low coupon email reached the addresses in Alert Sent To.
  9. Set Low Coupon Alert Count back to your production value and save.

Frequently asked questions

Do I still need to upload coupon codes manually?
Only the first batch. Upload it when you create the coupon group. After that, a new batch is generated automatically for that existing coupon group each time the threshold is reached. Voucher automation does not generate coupons from scratch.

How many codes are created each time?
The number set in requiredCoupons on the reward's UI Settings.

Who is told when codes are running low?
The email addresses in Alert Sent To on the coupon group.

How can I tell whether generation worked?
Check Webhook > View Logs for a Success status with code 200, and the Available Coupons count in Coupon Groups.

Key points

  • Coupon generation starts automatically when the available count reaches the Low Coupon Alert Count.
  • Automation only tops up an existing coupon group. The first batch of codes must be uploaded when the coupon group is created.
  • Coupons are created through the Shopify REST Admin API using a price rule.
  • Generated codes start with the couponPrefix set on the reward, which makes them easy to identify in Shopify.

Need help?

For help with set-up, or if coupons are not being generated as expected, contact your Annex Cloud Subject Matter Expert. Include the reward name, the coupon group name and, if available, the Event ID from the webhook logs so the team can investigate