A customer makes it all the way to checkout. They type in the code from your email, your Instagram caption, or the sticker on the box from their last order. They hit enter, expecting the total to drop, and instead get a flash of red text telling them something's wrong.
That moment is expensive in a way that's easy to underestimate. The customer didn't abandon their cart over price, they abandoned it over confusion, and confusion at the very last step of checkout is the worst place for it to happen. You paid for the ad or the email that got them there, you got the offer right, and the sale dies on a technicality the customer can't see and probably can't explain to you afterward either, they just leave.
The good news is that discount codes almost never fail randomly. Shopify's discount engine follows a strict, fairly predictable set of rules, and once you know what they are, tracking down why one specific code failed usually takes a couple of minutes, not a support ticket.
Here's how to actually work through it.
Start with the exact error message
Shopify doesn't fail silently, it tells you something, even if it's not always obvious what that something means. There are three messages worth knowing:
"Enter a valid discount code." This means Shopify doesn't recognize the code at all, or it does but it's expired, not yet started, or deactivated. This is a code problem, not a cart problem.
"[CODE] discount code isn't valid for the items in your cart." The code exists and is active, but whatever's in the cart right now doesn't meet its conditions. This is almost always a cart problem, not a code problem, and it's the message that shows up most often.
"Some discount codes couldn't be used together. We applied the best combination." The customer tried to use more than one code, and Shopify picked the better one instead of stacking them. More on why that happens below.
If you're troubleshooting this for your own store, the message your test attempt produces tells you which of the next few sections to actually read.
The eligibility mismatch, the most common cause by far
Most failed codes aren't broken, they're working exactly as configured against a cart that doesn't qualify. A discount can be restricted by minimum purchase amount, by specific products or collections, by quantity, or by customer segment, and if the cart in front of you doesn't satisfy every condition attached, the code is correctly rejected.
Say you've set "SAVE15" to require a $75 minimum and you promoted it as a flat "15% off" without mentioning that threshold anywhere. A customer with a $52 cart enters the code, gets rejected, and has no idea why, because nothing in your messaging told them there was a minimum at all. From their side it just looks broken. From Shopify's side it's working perfectly, the cart simply never qualified.
The collection restriction catches people more than they'd expect. If a code is scoped to a "Summer Essentials" collection and a product technically belongs there but was added through an automated collection rule that hasn't run yet, the product can look like it's in the collection from the storefront while the discount engine sees it differently. Worth checking the collection's actual product list directly in admin, not just assuming.
Customer segment restrictions have a quirk that trips up a lot of new-customer promotions specifically: a discount scoped to an existing segment only applies to people who already have a customer profile. A brand new shopper checking out for the very first time doesn't have a profile yet, so they won't be matched to a segment until after that first order completes, even if the segment is meant to describe exactly the kind of customer they are. If you're running a "first order" promotion and customers say it's not working, this is usually why.
Only one code works at a time
This one surprises a lot of people: Shopify only allows a single discount code to be entered per order. Customers can't stack two manual codes together no matter what either code allows individually, that's a platform rule, not a setting you can change.
What you can control is whether a code combines with an automatic discount that's already running, or with another type of discount entirely. That's handled through the Combinations section at the bottom of each discount's settings. If you've got a site-wide automatic sale running and a customer tries to layer a code on top of it, and combinations aren't explicitly turned on, the code will fail or only partially apply, even though both look "active" from where you're sitting.
If you're running more than one promotion at a time, it's worth actually testing the combination end to end before launch, since this is exactly where the math can quietly come out wrong and nobody notices until a customer points it out.
A common version of this: you launch a site-wide automatic 10% off sale for the weekend, then send an email blast with a "WELCOME15" code for new subscribers. A subscriber tries to use it, and unless you've gone into both discounts and explicitly allowed them to combine, only one applies, usually whichever one Shopify determines is the better deal for that cart, and the customer never gets an explanation for why their email code "didn't work" when really it just lost out to a discount they couldn't see.
Usage limits and who's allowed to use it
A code can have a total redemption cap across the whole store, a limit of one use per customer, or both. Once either limit is hit, the code stops working even though it still shows as "Active" in the admin if you're not specifically looking at the usage count.
The "one use per customer" version is usually tracked against the email or account on the order, which means a returning customer trying the same code a second time, even from a different device, will get rejected on purpose. That's frequently mistaken for a bug when it's actually the discount doing its job.
The smaller things that quietly cause failures
A handful of less obvious issues round out most of the rest:
Typos and stray characters. Shopify discount codes aren't case sensitive, but a trailing space, a copy-pasted character, or letters that look alike (a capital O next to a zero, a lowercase l next to a 1) can still cause a mismatch.
Currency and Markets. If a minimum spend is set in your store's main currency and a customer is shopping in a different market currency, the converted threshold can land a few cents off from what you'd expect, especially if you've set fixed regional pricing separately.
Draft orders. If a code is supposed to work on an invoice sent through a draft order, the "Discount codes" option has to be checked when that invoice is created. Skip it, and no code will work on that order no matter how correctly it's configured.
Checkout customizations. If you or an app have modified checkout behavior, the discount code field itself can disappear entirely for some customers. This is one of the few cases where the problem isn't the discount's settings at all, it's that the field never rendered.
Post-purchase upsells. Discounts created in the Shopify admin aren't compatible with post-purchase offer pages. If a code is meant to apply somewhere in a post-purchase flow, that needs to come from whatever app is running that flow, not the native Discounts section.
BOGO specifically. Buy X Get Y codes fail constantly for one simple reason: the customer added the X item but forgot the Y item, so the cart never met the condition in the first place.
The hidden mobile field. On a lot of mobile checkouts, the discount code field lives inside a collapsed order summary that the customer has to tap open first. If they never expand it, it's not that the code failed, it's that they never found anywhere to enter it.
The wrong box entirely. Some checkout themes show a gift card field alongside or instead of an obvious discount field, and customers occasionally try typing a promo code into the gift card box, where it will never validate no matter how correct it is.
A quick way to actually diagnose it
- Note the exact error message, it tells you which section above to check first rather than making you guess.
- Open the discount in admin and confirm it's Active, not scheduled for later or already expired.
- Check every restriction on it: minimum purchase, specific products or collections, customer segment, usage limits, all of them, not just the first one you spot.
- Build a fresh cart with only the eligible items and test again before assuming anything else is wrong, half of these issues disappear the moment you control exactly what's in the cart.
- If another discount or automatic sale is also running, check the Combinations setting on both, not just the one you're testing.
- If the code field is missing entirely rather than rejecting the code, look at recently installed or recently updated checkout apps first, since a missing field points to the checkout itself rather than the discount's rules.
The easiest long-term fix
A lot of this entire category of problem only exists because the customer has to type something correctly, into a small field, on the page where they're trying to finish buying something. Remove the typing and most of these failure points disappear with it.
That's the part Show Discount's Pro plan handles directly: it auto-applies your discount codes at checkout instead of waiting for a customer to enter one manually. No field to mistype into, no case mix-ups, no copy-paste errors from an email that wrapped the code across two lines. If code friction has been showing up in your support inbox more than you'd like, it's worth a look, the free plan's there to try the basics first.
A few quick answers
Why does it say my code isn't valid when I know it's active?
"Active" only means the dates and status are correct. It says nothing about whether the current cart meets the code's other conditions, that's a separate check.
Can a customer use two discount codes at once?
No. Shopify allows one manual code per order. A code can combine with an automatic discount if you've explicitly allowed that combination, but two manual codes can't stack.
Why did it work for one customer and not another with the identical cart?
Check usage limits and customer segment restrictions first, those are the two conditions that vary by customer rather than by cart contents.
Is there a way to see why a specific failed attempt happened, after the fact?
Not in detail from the native admin. Shopify shows the customer an error in the moment, but it doesn't log a per-attempt reason you can look up later. If this happens often enough to matter, the practical fix is testing the exact scenario yourself rather than trying to reconstruct someone else's failed checkout.
If you've worked through all of this and the code is still failing on a cart that genuinely should qualify, that's the point to test on a duplicate theme with other apps disabled one at a time, since at that stage it's more likely to be a checkout customization conflict than a discount setting.