Fix invalid code issues with Stripe

NicolasBrondinBernard

Author
@NicolasBrondinBernard

If you've ever run into problems with Stripe discount codes, here's how to fix them.

Article published on 24/03/2025, last updated on 10/08/2026

If you had the good idea to create discount coupons on Stripe, then chances are you've encountered the following error at least once, on a sales page:

"This code isn't valid"

But there are several reasons why this message appears, and they're generally not very well explained on the platform.

So let's look at the solutions together!

Discount codes

You should know that on Stripe, there's a difference between a "coupon" and a "promotion code"!

A coupon is a discount, either a percentage or a fixed amount, for one or more products (or a subscription).

A promotion code is a code that can be used by a user on a sales page, to benefit from a discount.

A promotion code is therefore created from a coupon!

If you create a coupon without codes for users, then only you, from the Stripe management interface, will be able to apply this discount!

To get rid of this "Invalid code" error, you need to make sure to check the box "Limit the number of times this coupon can be redeemed"—no wait, actually the box is "Generate a customer-facing code for this coupon" (or "Use redemption codes for customers to enter"), in the coupon creation interface. Like this:

After that, all you need to do is enter the desired code, and your users will be able to use it on a sales page!

Allowing free orders

When launching a product, and wanting to test that everything works properly from a technical standpoint, we often end up creating a 100% discount code for our product.

This allows testing without going broke.

And this works very well on all subscriptions, but as soon as you try to pay for a product with a 100% discount, you might receive a message saying "This code isn't valid".

This is because, by default (perhaps for accounting reasons), Stripe doesn't allow order sales when the amount reaches zero euros (or dollars, etc.).

To fix this issue, simply go to Settings > Checkout and Payment Links then enable: "Zero-cost orders"!

And there you go!

Normally you shouldn't have any more issues with a discount code on Stripe!


Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet