API update subscription with stripe to add coupons

Hi bubblers
so… im trying to make a flow when i user tried to cancel there subscription to offer them 3 months for half price instead.. and when they accept that i need to add a coupon to there subscription..

my issue here is that i am able to add the coupon with and update subscription action throw the API.. but if the user already have a coupon on there subscription it replace that coupon instead of just add it..

i felle i have tried everything now to make it not replace it.. and also how to i then retrieve the new price back to bubble?

No you do not. You can just update their subscription fees for upcoming months and then schedule a backend workflow to update the subscription fee again.

I’ve done this for an app that offers subscriptions and on checkout they can add an internal coupon (not anything to do with stripe) and if that coupon entitled them to 10% off first month, we send in the subscription as the normal rate less 10% and schedule a backend workflow to update it in one month time to the normal rate. Had to do it as well to tie in the Affiliate system so that affiliates if they are also users can opt to have their monthly subscription fee reduced by the particular months affiliate earnings instead of just receiving a payout. That required the same setup to change the subscription fee in stripe via API and then schedule for backend to change it back for subsequent months.

You could consider just updating your app setup to use coupons in your app database rather than coupons in Stripe and when you send API calls to stripe just do the math on the bubble app to send correct cost details to stripe.

Keep in mind a subscription is just a product, and both in stripe can have multiple prices associated with them, so you can basically in stripe create the subscription or product and in real time via api from your bubble app create the prices…

that was an option..
but its because i want it to be showed on the invoices that they actually are getting a discount in form of the coupons so it will be listed kinda as this:

Taskforce pro 499 DKK
discount 1 -150 DKK
discount 2 -125 DKK

Total 125,- DKK pr month

and as i understand it.. the invoices wouldnt display that with your suggestion.. right?

Not if you are having stripe generate the invoices. But if you generate your own invoices yes.

aah i see.. but im interrestet in letting stripe handle everyhting there has to do with payments..
so what im trying to figure out is how to add the coupon instead of replacing existing coupons :slight_smile:

1 Like