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

greevesh's avatar

Stripe\Exception\InvalidRequestException: No such plan:

I'm trying to create a subscription with Laravel Cashier and Stripe. My post request that subscribes a user is successfully being passed onto the Stripe back-end. I know this because I've checked the Stripe logs and the requests have statuses 200.

Wonderful.

Despite Stripes approval, Laravel is actually throwing an exception whenever I submit the subscribe form: Stripe\Exception\InvalidRequestException: No such plan: yearly_plan.

yearly_plan is the ID I've given one of my subscription plans that the user gives and the Stripe API retrieves.

The ID's I've given for each of the two plans are correct. I've checked multiple times.

// subscribe.blade.php

        <select class="form-control" name="plan" id="plans">
            <option selected value="">Choose a plan</option>
            @foreach($plans as $planId => $planName)
                <option value="{{ $planId }}">{{ $planName }}</option>
            @endforeach
        </select>
// SubscribeController.php
public function storePaymentMethod()
    {
        $user = Auth::user();

        // if user is logged in
        if (!$user)
        {
            return redirect('login');
        }

        $plans = [
            'plan_H1SbSi9r1YhXNG' => 'Monthly',
            'yearly_plan' => 'Yearly'
        ];

        return view('subscribe', [
            'intent' => $user->createSetupIntent(),
            'plans' => $plans
        ]);
    }

    public function subscribe(Request $request)
    {
        $user = Auth::user();
        $paymentMethod = $request->paymentMethod;
        $plan = $request->planId;

        if (!$user->subscribed())
        {
            // 'create' method will automatically store customers payment method
            $user->newSubscription('subscription', $request->plan)->create($paymentMethod); 
        }

        redirect()
        ->route('confirmation')
        ->with('subscriptionSuccessMessage', 'You have successfully subscribed. See you around!');
}

0 likes
3 replies
eugenefvdm's avatar

I have a similar problem. Below the error:

Stripe\Exception\InvalidRequestException
No such plan: 'price_xyz'

I've checked so many time, that price_xyz is correct. I even deleted it and made new ones. I just don't seem to get past this error.

ribal_arshad's avatar

You need to first go to stripe and then products, Then make a product such as: Monthly Plan and Yearly Plan then just copy their api ID and you can use it as plan ID or price. That just means that it's unable to find the product with this price on your stripe.

Please or to participate in this conversation.