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

MatthewStanford's avatar

Stripe will not connect to plans. Says plan exists but token is differnt.

I am new to Spark and am very excited. I chose stipe for the subscriptions. I have followed the set up. But I am getting this error when stripe is trying to post. No such plan: Pro; one exists with a name of Pro, but its ID is plan_************* . The reason I see that it is saying that is because the plan Id in stripe does not match up to that plan id. Is there anybody with an idea of why that is happening?

0 likes
5 replies
Cronix's avatar

In Spark, you define plans like:

Spark::teamPlan('My Wonderful Plan', 'test-30')
    ->price(4.99)
    ->features([
        'Feature 1', 'Feature 2', 'Feature 3'
    ]);

So, in Stripe, you need to have a subscription with an id of 'test-30' defined. You have to log into stripe to create it. Just having it in Spark doesn't create it in Stripe.

That's how it connects them.

MatthewStanford's avatar

Well of course. I appreciate that. I have 3 plans in stripe. That is how I know the plan id printed in the error is different than the plan id in stripe. So I thought I had put in the wrong environment variable keys for stripe. But those were correct. And I verified that the names in the spark service provider matched the plan names in stripe. That is why I ask because I don't know where the wrong product key is coming from.

geerizzle's avatar
Level 2

Note there is a distinction between a product and a plan on stripe.

You create the product, and then it has plans associated with it.

Make sure you're referencing the latter in the SparkServiceProvider i.e. it should be plan_xxxx rather than prod_xxxx

I wasted a bit of time on this myself!

1 like

Please or to participate in this conversation.