#bruce-zhang_api

1 messages ¡ Page 1 of 1 (latest)

tired kettleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1278448412160692301

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sturdy yoke
#

Hello

#

Yeah if you want that level of customization then you are going to need to build your own UI to handle upgrades/downgrades

wind drum
#

Hi, in API level, what should I use to achieve this behavior

sturdy yoke
#

Well first, why do you want to cancel a Subscription and create a new one?

#

Why not just update the Subscription Item?

wind drum
#

Yes we can also do that. Will that be easier?

sturdy yoke
#

Yes

wind drum
#

Doing this way will need more complicated logic to handle updating subscription at our backend, but if that's easier to integrate stripe api then we are ok with that

sturdy yoke
#

You can do either way, but just updating the Subscription is much cleaner

#

You want to set proration_behavior: 'none' and billing_cycle_anchor: 'now' if you want to charge immediateley for hte full price with no proration

wind drum
#

Can I do this on the customer portal?

sturdy yoke
#

No not with the limitations that you want

#

You can't reset the billing anchor with the Customer Portal

wind drum
#

For billing_cycle, my upgrade and downgrade behaviors are different, upgrade will work immediately and downgrade will wait until the priod ends

#

so this is the problem right? Customer portal can not handle this

sturdy yoke
#

Customer Portal can't do either of those things, no.

wind drum
#

Cool. Can you give me some instruction about the api to do upgrade and downgrade in this logic?

sturdy yoke
#

Yeah so I already mentioned above how to do the upgrade

#

You update the Subscription Item to the new Price and use proration_behavior and billing_cycle_anchor like I mentioned above