Feature Spotlight: Generating Unique, One-Time Coupon Codes for Shopify Plus

As most of you already know, Klaviyo integrates seamlessly with both Shopify and Shopify’s enterprise solution, Shopify Plus. One key feature of Klaviyo’s integration with Shopify Plus is the ability to dynamically generate unique, one-time coupon codes within a flow email. This saves you the trouble of manually switching out coupon codes every so often and the worry of having your coupon codes posted on sites like Retailmenot. If you use coupon codes for promotional purposes and use Klaviyo with Shopify, consider upgrading to Shopify Plus to utilize this feature.

How it Works

Setting up coupon codes for your Shopify Plus store is a quick, 3-step process:

1. First, you’ll need to create a private API key in Shopify and send the API key and password to our success team to have this feature enabled.

2. Once this feature is enabled, you will see a Coupons tab on your sidebar. Inside this tab, you can create your coupon codes by selecting “Add Coupon.” Each coupon can be customized. You will set:

  • A name for the coupon (i.e. “Welcome_Coupon”).
  • A prefix — though each code will be unique, you can set a prefix that will be the same for each customer (i.e. “WELCOME—-”).
  • Discount type — this refers to whether a coupon code offers a percent discount, fixed amount off, or free shipping.
  • What items the coupon code applies to (i.e. specific products or collections).
  • How many days the coupon code will remain valid for.

3. Next, you can use dynamic tagging to refer to the specific coupon code you would like to use in your email. So, if we use the coupon name Welcome_Coupon, your tag will be: {% coupon_code ‘Welcome_Coupon’ %}. Like other tags, the coupon code will generate automatically wherever you place the tag in your template.


For more detailed information on how to set up coupon codes for your Shopify Plus account, check out our docs.

Use Cases

These coupon codes can be used wherever you offer promotions in your flow emails. Please note that these cannot be used in campaigns, since Shopify has a limit on how quickly these codes can be generated. However, since flow emails are often only updated periodically and aren’t sent in the same high-volume batches that campaigns are, these automated coupon codes will allow you to avoid editing all your flows to switch out new codes once the old ones expire.

Coupon codes are most often used in welcome series, abandoned carts, and win-back emails, but you can use them in any type of flow you’d like. There aren’t any limits on the number of coupon codes you can create.


While you should refresh your flow emails every so often to keep them timely and relevant, Klaviyo’s automatically generated, unique, one-time coupon codes will save you time and energy when it comes to updating coupon codes. Furthermore, it will eliminate the possibility of coupon code sharing, since each individual email recipient will get a unique code that they can use only once.

Marissa Petteruti
Marissa started at Klaviyo on the Marketing team, and is now a technical writer on the Product Education team. She enjoys writing helpful content for our customers and training them on how to use the product.
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search