Error message when trying to use coupon

Problem statement

You have a subscription form with a coupon field.
You’ve created a coupon, and when you are trying to use it, you get the following error:

You have entered an invalid coupon code.

The solution

Either of the following scenarios can cause the error:

  1. You are trying to use the coupon not in the API mode it was created in
  2. The name and ID of the coupon differ, and because of this the plugin cannot find it

The possible solutions are:

1) You are trying to use the coupon not in the API mode it was created in
In Stripe, live mode and test mode are two different worlds, with a different set of objects, like subscriptions plans, coupon codes, etc.
Most probably, you’ve created the coupon in test API mode, and you are trying to use it in live API mode, or vice versa.

Please make sure that the coupon exists in the mode you are trying to use it in.

2) The name and ID of the coupon differ, and because of this the plugin cannot find it
Make sure that you specify the same value for the name and ID of the coupon when creating it.

For existing coupons, verify that the name and ID are the same, and delete and create a new coupon if they differ.
(Stripe doesn’t allow the ID to be modified for existing coupons)

in Troubleshooting