#Gautam
1 messages · Page 1 of 1 (latest)
Can you share what you're trying to achieve with proration?
I want that if the cutomer has already taken my subscription plan of higher amount for one month and after few days he is downgading or upgrading to anouther plan then I want the price will be adjusted automatcally
so that user has not to pay the entire amount if has already paid a higher amount and switching to a lower price plan and vice versa
Is there any way to achieve that using the checkout session?
Checkout Session is only for newly created subscription. For upgrading/downgrading a subscription with proration, it can only be done via Update Subscription API: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
No problem! Happy to help 😄
Hey, I also want to make our frontend dynamic, so that if I am changing the price or the product or applying any coupon or discounts from the dashboard then it should reflect in my website frontend UI also.
Is There any way to achieve this thing?
Yes! You may listen to customer.subscription.updated event for any changes on the subscription
No I am not changing the price for the specific cutomer, because there are many thousands of customers.
For any subscription changes on any customer, the customer.subscription.updated event will be sent and it's not specific to any customer
Okay I have a confusion that for the second time when the user wants to upgrade the plan then which page I should be redirecting ? Previously I was every time I was creaing a checkout session and redirecting to the user to the prebuilt checkout page. But Now as you said that Prebuilet checkout page is for the first time then for the second time where should I redirect to the user?
You can either build your own upgrade/downgrade UI with the Update Subscription API I shared earlier, or use Customer Portal to allow customer to change the subscription: https://stripe.com/docs/customer-management#customer-portal-features
Okay thanks