#Jenya-subscriptions
1 messages ยท Page 1 of 1 (latest)
hi! It should be doing that by default. When you change from one plan to another, the proration items generated is a discount for the unused time on the previous plan and a charge for the remaining time on the new one; any other plans on the subscription are not involved.
So I basically have a product with both standard pricing and then metered
Like this
And problem is when I upgrade it should prorate both
But when I downgrade it should change it only in a month
But still prorate the metered pricing
Uhhh I don't know how to explain it best
I also considered doing something like this
But it only charges at the end of the billing period
trying to understand...
I mean yes, metered billing always charges in arrears, at the end of the month.
Yeah, so like when I downgrade right
Let me send code to show how I'm downgrading
I do this
makes sense. But that call does the change(downgrade) immediately yes
if you want to instead have the change to the plans only happen at the end of the current billing cycle it can be done but you have to use SubscriptionSchedules
to be clear yes, that's how it works
you do the change today
we calculate proration and add invoice items for it
that proration gets pulled into the next invoice for the customer/subscription(which would be the one at the start of the next billing cycle, usually)
So it will change, but it will still count the pricing from the previous plan for the current month?
not really sure I follow you
the way it works in the simple case (non-metered plans) is :
- jan 1, using Plan A($100/month). Charges $100 that day
- jan 21, change from Plan A to Plan B($75/month)like your API call above). No charge today. We calculate 9 days on Plan B, add that as an invoice item, and we calculate 9 days on Plan A, and add that as a negative invoice item.
- Feb 1, next invoice. We charge $75(upcoming month on Plan B), minus the negative item, plus the positive item.
What if I have metered as well as standard pricing?
If the customer has usage between Jan 1 and Jan 21 and the user downgrades
How will the metered usage be invoiced on Feb 1?
why does 'downgrading' mean for a metered plan though? Like are you switching it to a non-metered plan, or are you switching it to a different metered plan, or something else?
to be clear, if you have a subscription that has two items, one for a regular price and one for a metered plan, changing the regular plan doesn't do anything to the metered plan as far as I'm aware. In my example above, basically what would happen instead is
- Feb 1, next invoice. We charge $75(upcoming month on Plan B), minus the negative item, plus the positive item, plus the charge for accumulated usage during January on the metered plan
Different metered plan
Each product has different pricing
$99 + $1/extra
$199 + $0.8/extra
etc
I'm changing both the metered
So if I'm on the second plan
I replace $199 with $99
$0.8/extra with $1/extra
But I need it to still count this months usage with the $0.8/extra pricing
If you get what I mean :/
not sure off the top of my head then, I'd have to test it. I think it's possible we don't let you do that type of change(changing a subscription item from one metered plan to another) since the question of what to do with any reported usage so far is complicated
ok seems like it's possible
when I do it, what happens is that any usage reported on the old plan instead gets calculated as per the new one ( like here I reported 7 usage on an old plan, then updated the subscription), reported 7 more, and you see the next invoice just takes all 14 together and calculates against the new price
It needs to calculate with the old one
For the original month
When they downgrade it should basically downgrade in a month
So that it calculates price based on the original plan before the billing period ends
then yeah, subscription schedules
there's an example here https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#downgrading-subscriptions but overall if you want a change to happen in the future you'd need to use that API, or set up your own server to make an API call at the right time
(have to run but my colleague ynnoj can help)
๐
Hey
Thanks
Let me know if you have any specific questions!
Alright