I am using the API connector to set up a Stripe call that lets users switch their current subscription plan. The reason I am doing this is because, in the event that a user upgrades or downgrades their plan, I would like to immediately charge them a prorated amount (or provide a credit) for the remainder of their billing period. From what I understand, Bubble’s Stripe plugin does not allow this behavior and will instead charge at the end of the billing cycle.
However, when setting up my API call as follows, rather than switching the user’s subscription to the new price, it simply adds the new price to the subscription, so that the upcoming invoice will have charges for both the new and the old price
My question is, is there something wrong in my setup below that is causing this? Additionally, are there better ways of handling this scenario where the user switches their plan (perhaps the default way Bubble provides is better from a business standpoint for some reason I am missing, though I would have assumed most SaaS companies charge a prorated amount immediately. I’d love to get peoples’ thoughts on this matter).
Why is using Stripe checkout and webhooks preferable to using the API connector? Theoretically, the API should be able to handle this, but there is probably something wrong in how I set up my call that is causing the issue.
With that being said, if this method is more robust, I would be interested in exploring it. I am still a little confused about how I would implement the webhooks to trigger events in bubble. Does this essentially involve exposing the API endpoints for my app and getting stripe to make calls to my app that trigger workflows?
You set up webhooks in Stripe. That part is simple. You need to build backend workflows in Bubble to handle the incoming data. I’m sure there’s a bunch of info on the forum about specific implementation.
Great, thanks! I am looking into this. Still working through how to set up the checkout page to allow switching between the different plans I offer, but it seems like this could be the way to go.