proration amount settlement

21 views
Skip to first unread message

Shubham Bhagat

unread,
Nov 5, 2024, 10:39:47 AM11/5/24
to Stripe API Discussion
Hi,
I am facing issue where i am creating a subscription like basic plan and when user want to upgrade to pro plan we create a new subscription ,as we return a session to frontend and everything handle frondend and once payment is done we use webhook to update our system.

So when pro plan is purchase a new session is created and then user do the payment , after that when webhook is called we delete the old subscription , but to manage the proration amount of plan cancelled to new pro subscription bought ?

Karl Reid

unread,
Nov 5, 2024, 11:22:50 AM11/5/24
to Stripe API Discussion, Shubham Bhagat
Hi there,

My understanding is that you are creating a new CheckoutSession object in `mode:"subscription"` and creating a whole separate new Subscription for the pro plan, and then cancelling the Customer's existing Subscription.

What I'd suggest doing instead is updating the existing Subscription, not creating a new one. That makes it much easier to handle your use case of charging a prorated amount.
The easiest option would be to let the customer make the change in the Customer Portal [0] [1] . You can configure that the update will calculate proration, and the portal will handle the payment processing for any invoice created as a result.
Alternatively it's also possible to update the subscription directly [2] , where you can use the `proration_behavior:"always_invoice"` parameter to force calculation of proration and charging the customer's default payment method for the change.

If you have any more questions or problems in implementing this I'd suggest opening a support case at https://support.stripe.com/?contact=true with the code you're using and example Subscription IDs `sub_xxx` and we can help!

I hope this helps but please do not hesitate to get back to me if you need more details.
All the best,
Kyle


Reply all
Reply to author
Forward
0 new messages