Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tptompkins's avatar

"Free for X Months" type discount with Stripe

Hello,

I'm trying to create a "Free for X Months" type discount in Stripe but anytime I try to plug in the discount code into my Spark app an error occurs behind the scenes. If I look at the logs in my Stripe account, I can see the following error:

{
  "error": {
    "type": "invalid_request_error",
    "message": "Coupon expired: TESTCODE123",
    "param": "coupon"
  }
}

Notice how the error says that the discount is expired when in fact the discount's expiration date (the Redeem By field in Stripe) is set to a date in the future. I created multiple discount codes that are 100% off for X months, and all of these codes have the exact same issue. But if I create a code that has less than 100% off (ie. 90% off) everything works just fine.

I'm using an older version of Spark and Laravel 5.2 but I have a feeling that the issue is Stripe related and not Spark.

Can somebody here try to create a multi-month 100% off coupon in their own Spark install and see if you get the same results?

Thanks,

Tommy

0 likes
3 replies
ejdelmonico's avatar

I am using a few right now (for about 18 months) with no issues except that the user had to already be registered for some reason. I made the coupons valid for 10 days and anywhere from 6 to 12 months active. Once accepted in the users profile, it works as expected. I have not upgraded to the latest version of Spark though.

tptompkins's avatar

Hmm..that’s interesting. If it works for you, it makes me wonder if the issue is with my older version of Spark / Cashier

ejdelmonico's avatar

That, I am not sure of. I would say more to do with Cashier than Spark overlay. Have you looked at the returned Stripe data in the vue tools extension? If I remember correctly, you can see all of the values.

Please or to participate in this conversation.