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

mastermindlegion's avatar

Cashier Coupon not found

Hello guys, I'm using Laravel Cashier with Stripe and I have a problem regarding to the coupon applying. If i'm trying to use a coupon I always get response coupon not found 'halfprice'

  1. I have created coupon in Stripe
halfprice
  1. Im sucesfully sending a coupon from to the backend a

3.Backend Handling


       $this->validate($request, [
           'token' => 'required',
           'plan' => 'required|exists:plans,slug',
           'coupon' => 'nullable'
       ]);

     $cleaned_plan =  Purifier::clean($request->plan);
     $request_plan = strip_tags($cleaned_plan);

     $cleaned_token = Purifier::clean($request->token);
     $request_token = strip_tags($cleaned_token);


     $plan = Plan::where('slug', $request_plan)->first();

        auth()->user()->newSubscription('pro', $plan->stripe_id)
       ->withCoupon($request->coupon)
       ->create($request_token);

0 likes
3 replies
srasch's avatar

The code looks good. I think something went wrong creating the coupon.

Could you submit a screenshot from your dashboard or submit the response from GET /v1/coupons?

Thanks

mastermindlegion's avatar

@srasch Hello there and thanks for the reply. Here is the response from the stripe: Coupon name halfprice is there....

{
  "object": "list",
  "data": [
    {
      "id": "bhDLNZj7",
      "object": "coupon",
      "amount_off": 3000,
      "created": 1602780400,
      "currency": "czk",
      "duration": "once",
      "duration_in_months": null,
      "livemode": false,
      "max_redemptions": null,
      "metadata": {
      },
      "name": "halfprice",
      "percent_off": null,
      "redeem_by": null,
      "times_redeemed": 0,
      "valid": true
    }
  ],
  "has_more": false,
  "url": "/v1/coupons"
}

Please or to participate in this conversation.