My users can subscribe to 2 different Stripe plans.
I am trying to enable them to delete a specific plan via “Cancel a user’s plan”. I added the Stripe API ID (Price…) but it doesn’t work. I am getting an error that this subscription does not exist. Any idea?
Cancel all subscription works, but not with a single “Cancel Subscription ID”. I also tried to add the Product ID instead of the Price ID but it also doesn’t work.
You need to pass subscription ID returned by stripe here
if there is only one subscription
If there are multiple subscriptions then check which subscription you want to cancel
If you want to see the subscription id’s before cancelling
You can display it in Text element by writing this
Thanks @viquarahmed07 !! But when I use first and second item I cannot be sure exactly to delete the right subscription right. If I filter the IDs like you said how can I use them, because the direct Subscription ID as number is not accepted if I am right.
Because now I can see the subscription IDs but I don’t know which one is associated with the plan. And when a user is signing up to the 2 plans in a different order, than I can’t be sure which one he is deleting. Is there another way to detect and cancel the subscription plans?
I think you can see it in stripe dashboard
I will let you know by tomorrow.
Hi there @bubble48,
You may need to check that you’re trying to cancel on the correct version (live vs. development). i.e., you can’t cancel a development version stripe subscription on the live version vice versa.
This I already checked. I am able to delete the subcriptions with the tip from viquarahmed07.
For posterity’s sake, when the user initially signs up for a subscription, assign the Stripe subscription ID in a field you create in Bubble. For my app, I create an “Account”, with the current user assigned as the admin, and I have a user field “account” which gets linked to the thing (Account) that just got created. In my app, an Account might have multiple subscriptions, so Accounts have text fields for storing the “Feature A Subscription ID”, “Feature B Subscription ID” when they sign up to get those features.
Then, when trying to cancel a specific subscription ID, you would use “current user’s account’s Feature A Subscription ID”.
This is the only way I know of to cancel a specific subscription, vs. all subscriptions or a random subscription, for a user.
To be super clear, a subscription is NOT a product in terms of Stripe, and a subscription ID will always begin with “sub_” in Stripe. You can think of it like this: you don’t subscribe to a subscription; you subscribe to a product. Once you subscribe to a product, you have a subscription (as a user), and that subscription is unique to you.
Hopefully that makes sense.