FLOWS

Klaviyo discount codes not working? Where the Shopify sync breaks

When a Klaviyo discount code doesn't work at Shopify checkout, the cause is usually on the Shopify side of the code: it's a preview placeholder, it has expired or isn't active yet, it's already been used, or the cart doesn't meet its rules. If none of those fit, check whether it clashes with another discount, whether someone edited the coupon, and whether Klaviyo ever generated a real code for that person.

Jack White
Jack White Founder, Bardown Digital
Updated · 9 min read
KEY TAKEAWAYS
  • A code ending in "-PREVIEW" is a placeholder. It will never work at checkout.
  • Klaviyo dates are in UTC and Shopify uses your store's time zone, so a code can expire earlier or later than you think.
  • Each unique code works once. A flow gives the same person the same unexpired code, even after they've used it.
  • Discounts only stack if both of them allow it. Otherwise Shopify applies the best one and drops the other.
  • Edits made in Klaviyo don't change codes already sent. Edits made in Shopify do, and Klaviyo won't show them.

This is for Shopify founders whose customer just replied "your code doesn't work." It's the troubleshooting companion to my guide on setting up Klaviyo unique coupon codes, so I won't repeat the setup here. Work down this list in order.

Is it a real code or a preview code?

Check this first. Klaviyo's coupon guide says previews inside Klaviyo show CouponName-PREVIEW, not a real code. Paste that into Shopify and you'll get an error every time.

Real codes are created when the message sends. If you want to test a real one, Klaviyo says to add codes first. A preview sent to your inbox then uses a real available code, which is reserved for preview and pulled from the customer pool. If several people are on that preview send, they all get the same code. So if you and a teammate both tested it, only one of you gets to redeem it.

Has the code expired, or is it not active yet?

When a code doesn't exist or isn't currently active, Shopify's discount FAQ says customers see "Enter a valid discount code." Dates are the usual reason a real code lands here.

Things to check, from Klaviyo's coupon guide:

  • Time zones. Klaviyo dates are in UTC. Shopify sets expirations in the store's time zone. Your coupon can show different dates in each place.
  • Specific end dates. These expire at 23:59:59 UTC on the date you picked, with no grace period. If your store is on Pacific time, that's late afternoon your time, not midnight.
  • Relative expirations. Flow coupons set to expire after a number of days or hours get a 24-hour grace period for delivery delays. Klaviyo's example: a 4-hour expiration gives a 28-hour window. That cuts the other way too. If your email says "48 hours" and someone shows up on day four, the code is gone.
  • Activation date. If the coupon has a start date in the future, the code won't work yet. Klaviyo also lets you activate codes at send time instead.

To see a specific customer's code, open their profile, go to Details, then the Coupons section. Klaviyo's coupon history guide says it lists each code with its status and expiration date. Codes that expired more than 90 days ago don't show.

Has the code already been used?

Klaviyo unique codes are one per person, and Klaviyo says each code can be redeemed once. When the limit is hit, Shopify shows "The DISCOUNT_CODE discount code has already been used."

Three ways this catches people:

  1. The same code in multiple flow emails. If the same coupon tag is in several messages, Klaviyo sends the same unexpired code each time. Redeeming it doesn't make it usable again. So the "last chance" email in your abandoned checkout flow may be handing a buyer a code they already spent. A new code only comes after the old one expires.
  2. An unfinished checkout. Shopify's FAQ says an unfinished checkout can hold a code, and a declined payment releases it. Check Orders to see if the customer already placed one.
  3. Shared codes. Klaviyo says the recipient can still share a code. If a friend used it first, it's spent.

Does the cart actually qualify?

Next is "the code is real and active, but not for this cart." Shopify says customers see "DISCOUNT_CODE discount code isn't valid for the items in your cart" when the code's products aren't in the cart.

Check these settings on the coupon:

  • Applies to. A code limited to specific products or collections won't touch anything else.
  • Minimum purchase. Klaviyo says that for product-specific codes, the minimum applies only to that product. Shopify adds that the minimum counts product prices only, not shipping or taxes. For order discounts, the cart has to meet the minimum both before and after product discounts. So, as a hypothetical, a $50 minimum can fail on a $55 cart if another discount knocks it under.
  • Subscriptions. Klaviyo codes only work on one-time orders, not subscription orders such as those run through Recharge.
  • Post-purchase offers. Shopify says codes applied at checkout don't apply to post-purchase offers and can't be entered on the post-purchase page.

One more for static codes you built in Shopify, like a welcome code. Shopify's FAQ says discounts limited to customer segments only apply to existing customers, and new customers join a segment after their first order. So a welcome code limited to a segment can block the exact first-time buyers it was written for.

Is it clashing with another discount?

This is the one that feels random to customers. Shopify's discount combinations page says each discount has to be set to combine with the other's class. Both sides must allow it. If they can't combine, Shopify applies the best discount for the cart. If a customer enters codes that can't combine, they see "Discount couldn't be used with your existing discounts."

Where it bites:

  • An automatic discount is running. Say you have a sitewide automatic sale and a welcome code that doesn't allow combining. The customer may get the sale instead of the code, or the other way around. Shopify says automatic discounts and codes only combine if each is set to combine with the other's class.
  • Klaviyo's Combinations setting. Klaviyo's coupon guide says this sets which discount types the coupon can combine with. Check it on the Klaviyo side and the other discount's settings in Shopify.
  • Limits. Shopify allows up to 5 product or order discount codes and 1 shipping code per order. Shipping discounts can't stack with other shipping discounts.
  • Checkout limits. Combinations only work on the Online Store, Storefront API and Shopify POS, not external checkouts like Facebook, Instagram or Google.

Did someone edit the coupon?

Edits split codes into versions, and that confuses everyone. Klaviyo's guide to editing coupons says:

  • Changing a coupon in Klaviyo deletes the unsent codes. Codes already sent keep the original terms. Klaviyo's example: a $20 minimum with 30 codes sent, then changed to $40. Those 30 codes still need $20.
  • Changes made directly in Shopify apply to codes already sent, and Klaviyo doesn't reflect them. So Klaviyo can say one thing while Shopify enforces another.
  • After an edit, new flow codes can take time to generate.

If a customer says the code was "supposed to be" a certain amount, go to Content, then Coupons, open the 3-dot menu and select View History. Klaviyo says clicking a coupon title on a profile opens the latest version, which may not be the one the customer got. Export the history to see the terms tied to a specific code.

Did Klaviyo ever create a code for them?

If the customer got a blank or never got the email, the code may not exist. Klaviyo's coupon guide covers these:

  • No Coupons tab. Go to Integrations, open Shopify and click Update Settings. You may need to re-authenticate. If your connection has other issues, see Klaviyo Shopify sync problems.
  • Flow generation failed. If generation is unavailable, Klaviyo retries. If it fails or the retry window ends, the message can be skipped. Check recipient activity for the skip reason. During testing you may see "Retrying: Generating Coupon Codes."
  • Campaign ran short. You need at least as many codes as recipients. With "Determine recipients at send time," people added after you generated codes are skipped.
  • The store limit. Shopify allows 20 million unique codes per store. At the limit, you have to delete codes in Shopify first.

For SMS, Klaviyo's SMS coupon guide says the tag is {% coupon_code 'CouponName' %}, with the exact coupon name. Errors usually come from missing quotes or brackets, or a misspelled name. Only one coupon is allowed per SMS, and unique codes can't be used in the SMS auto-responder.

For links that apply the code automatically, Klaviyo's guide says to use ?discount= on a checkout URL without a ?, and &discount= if it already has one. Klaviyo also says it can't guarantee the code applies when the link goes to a non-checkout page, because the site may strip it from the URL. If that happens, Klaviyo says to contact your theme developer. And if the code field is missing at checkout, Shopify says it needs at least one active code, and some third-party apps can hide it.

Once the code works, is it the right offer?

Fixing the code is one job. Making sure it's not costing you margin is another. My rule: non-customers get the welcome offer and never a bigger one. If a broken code gets "fixed" with a bigger code, you've taught people that complaining pays. I go deeper on this in email discount strategy and the welcome email series.

And consider skipping the code altogether on your popup. I like cash back claimed as store credit, not a gift card, so the brand isn't paying out a gift card. Brands that offer cash back on the signup popup instead of a discount see 10 to 20% higher first-order profit, because non-customers place that first order without a discount.

FAQ

Why does my Klaviyo code say "-PREVIEW"?

That's Klaviyo's preview placeholder. Real codes are created when the message sends. To test a real code, add codes first, then send a preview to your inbox.

Why does Shopify say my Klaviyo code has already been used?

Each unique code works once. Flows send the same unexpired code in every message that uses that coupon, and an unfinished checkout can also hold a code.

Why did my code expire early?

Klaviyo uses UTC and Shopify uses your store's time zone. Codes with a specific end date expire at 23:59:59 UTC on that date, with no grace period.

Why won't my Klaviyo code stack with my sale?

Both discounts must be set to combine with each other's class. If they can't, Shopify applies the best discount for the cart.

Jack White, founder of Bardown Digital
WRITTEN BY Jack White

Founder of Bardown Digital, a Chicago-based Klaviyo email and retention agency for Shopify brands. He's worked with brands doing $500K to $100M a year, with $100M+ in email-attributed revenue across them.

SOURCES

Keep reading

All posts →
FLOWS · 10 MIN READ

Klaviyo back in stock emails: how to set them up so the restock actually sells

How to set up Klaviyo back in stock emails, from the flow to the restock campaign, plus why one restock email got double the clicks and made $0.

Read the post →
FLOWS · 9 MIN READ

Klaviyo custom properties: what to store and how to use it

Klaviyo custom properties store what Shopify doesn't know: birthdays, survey answers, quiz results, preferences. What to save, how to name it and use it.

Read the post →
FLOWS · 9 MIN READ

Klaviyo dynamic content: show and hide blocks without breaking your emails

How Klaviyo show/hide logic works, the syntax, how to preview it, why blocks vanish, and when a conditional split is the better tool.

Read the post →

Want me to check your discount setup?

A code that fails at checkout costs you the order and the customer's trust. The first strategy session is free: one hour, live with me in your Klaviyo account, and you leave with a fix list even if we never work together. Not ready to book? Grab one of my free resources instead.

Book a strategy session
Or email me at jackwhite@bardowndigital.com