All of that is very simple, and none of it requires anything to do with webhooks if you’re simply getting the subscription data from Stripe via an API call and displaying it on the page as and when you need it
Thanks Adam, that all makes sense although for me it’s far from simple! I wonder, if I rely on API’s (without webhooks) how will my Bubble app know if a user has unsubscribed? In other words, surely I will need to ‘send’ the API call to get that info from Stripe, but when do I send it?
Surely your customers are paying for more than just a message saying “You are subscribed”?
Yes, I didn’t want to overload you with the full details of my app, but essentially I have two tiers (see below).
Free users can create and send invoices to their customer but are limited to sending 3 invoices per month. Paid (subscribed) users can create and send unlimited invoices and they have access to a few other features.
So, when a user unsubscribed (downgrades from a paid plan to a free plan) I will then need to limit the amount of invoices they can send. This is probably easy, but first I need to make sure the user sees in their dashboard (in my app) clear text which says “You have unsubscribed but you can still enjoy using the app until xx.xx.xxxx”.
Bubble’s Stripe plugin makes use of Stripes Event subscription.updated
which tells my app that the user has unsubscribed, but this information only comes when the subscription period has ended. So, the notice I am able to display to my customer when they unsubscribe is:
You are on a paid plan. your next payment is on xx/xx/xx
Of course, my user should see;
You have unsubscribed but you can still enjoy using the app until xx.xx.xxxx
I have found this issue impossible to fix. Stripe customer support even admitted to me that they need to add a new Event and Bubble support are also unable to help.
They key is just the name/identifier of the parameter (it can literally be anything you want to call it).
It is not editable so I can’t rename it. The Key is generated from the URL so maybe my platform has a bug.
To be clear, the URL I have used is https://api.stripe.com/v1/subscriptions/[sub_1L2X8DJjP8NRYZahVZ***]
and the subscription part at the endsub_1L2X8DJjP8NRYZahVZ***
I took from a random users subscription. There is no ‘parent’ subscription ID so I just grabbed one of the subscribed users subscription ID’s.
If I create a new account in my app and go to ‘my subscriptions’ the user should initially see “You are on a free account” because they have not yet upgraded, but when using the above API settings I always see “You are on a paid account”.
I think I will reinstall the Stripe Plugin and follow the [this video] which worked previously for me, at least then my app can update the Status. Then, one again I will try and find a solution which allows me to display the following Text when a user unsubscribes “Your plan will be cancelled, but is still available until the end of your billing period on xx.xx.xxxx”.