#yangloyzlm_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1388132690682708118
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
I want to implement a subscription upgrade&downgrade feature. Wish:
the subscription period before and after the upgrade and downgrade remain the same
the cost is the price of the full cycle, not a percentage of the date.
use the portal page provided by stripe, no need to customize.
Example:
bought a $20/month subscription on 6.1 and upgraded to a $100/month subscription on 6.15, then immediately pay the difference of $80 instead of $40 by date, while the subscription period stays the same from 6.1-7.1.
no need to repost your question
ok, how I can implement this feature.
we can't really do that by simply applying prorations
yes that's not even possible with the Customer Portal
The screenshot above, that's what I'm looking for.
but that's not the same as your calculation
in the screenshot the customer paid a prorated value
what you want is for them to pay the difference which is not something that we offer
It's the same, when upgrading the plan, I want it to be effective immediately, and I want the full difference, not the time-apportioned difference.
no it's not the same because you want them to pay the difference which is not possible
Look at the screenshot, Pro2 is $50, Pro3 is $100, when I upgrade, I only have to pay the difference of $50, that's what I want.
what's the subscription ID here?
Pro2 I bought it on the 28th of last month, when i upgrade the amount needs to pay is full-difference, not time-apportioned difference.
because you upgraded on the same day
right?
so there's no proration to calculate
no, it's not same day. When I opened this upgrade page two days ago, it was the same amount.
full-difference
ok I just checked and the portal would upgrade starting next month
you made the changes on June 26
and it will applied starting June 28
so it's not an immediate upgrade
it's an upgrade starting the next billing cycle
the customer portal is using https://docs.stripe.com/api/customer_portal/configurations/object?api-version=2024-10-28.acacia#portal_configuration_object-features-subscription_update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sorry I meant to send this link https://docs.stripe.com/api/customer_portal/configurations/create?api-version=2025-05-28.basil&lang=curl#create_portal_configuration-features-subscription_update-schedule_at_period_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the payment is immediate
but applying the subscription update would only occur at the start of next billing cycle
ii upgrade from $25 to $50 on June 26, paid $25 full-difference amount, and take effect immediately
I'm not sure how they're providing access to their service but know that the subscription upgrade would only take effect at the end of the current billing cycle
Hi there ๐ jumping in as my teammate needs to step away soon.
Regarding proration calculations, the only methods we offer are to either calculate prorations based on when the upgrade is made in comparison to where in the current billing period the Subscription is, or to not calculate any prorations.
If you want the behavior that you're describing, where the "prorated" amount is just new_price-old_price, then you will need to implement custom code to handle that. You will need to fully disable our proration logic, and implement your own, generating the one-off Invoice needed to charge the customer for the amount you want to charge them for.
If so, means that I can't use the portal page provided by stripe? have to implement the subscription management page myself?