#ironbeard - Sub Proration
1 messages ยท Page 1 of 1 (latest)
Hey ๐ So I think my flow is going to only allow one subscription per customer, and after their initial subscription creation, if they purchase other "subscriptions" then I would just update the items on their current subscription.
Every Price is a 1-year subscription.
So let's say someone creates their initial subscription today and then in a month they add to it. Will there be a charge at that point, or will it wait until one year from today to charge them for the added content?
That depends on how you update the subscription
Right.
If you leave it off then include create_prorations they will get credit for the 11 months of the first price toward the 11 months of the new price.
So if I subscribe to an annual $100 price today, and then next month add a second, annual $100 price and use always_invoice, will the customer just be charged $100 when they buy the second price?
Yup
and then a year + month from now they'd be charged $200? or would that stick with the old billing date (a year from today)
Actually I'd want to test that.
I guess it doesn't really matter to me, just more important that they're not getting charged $200 when they make the second payment
I would think adding the second price would either 1) charge the customer for 11 months of the new price and keep the billing cycle or 2) charge for the full amount and reset the billing cycle
You added a price, what are you trying to achieve?
Hmm, I suppose 2).
If I bought $120 / yr today and then added another $120 / yr a month from now, I'd want them to be charged the full $120 when they update their subscription.
Okay but these are recurring prices, correct? So won't the customer be charged $240 at the next billing cycle?
Oh: I'd like them to be recurring, yes. It's best if I explain a little more:
I'm selling SaaS, each price corresponds to 1 year access for, say, $120 for data on a given city. So someone can buy a subscription to, say, NYC today for $120 and it'll auto-renew every year. Then one month later they want to add Boston, so they pay another $120 that's charged right then. Then either a year from today or a year from 1-month, they're charged $240 until they cancel.
Okay but why should the billing cycle still be the same? You would either be shorting them 1 extra month on NYC or giving an extra month on Boston. I think it would make more sense to use separate Subscriptions in that case.
oh, right.
It might make more subs for you but now imagine someone wants to add SF 7 months into their NYC subscriptions
Right
so if I did proration_behavior='create_prorations', at what point would I be able to access what the actual amount charged would be>
Okay so if you wanted to add prices to the existing Sub for the above use case, the user would be charged 1 year for NYC (initial price) and a proration of 5 months of the SF price at the end of the billing period associated with that subscription
Then for the next sub they would get charged full price for both
I would recommend using Test Clocks to try out a few different approaches to this process
https://stripe.com/docs/billing/testing/test-clocks
ooh, nice
Thanks for the link, I'll def check out the test clocks.
Just to make sure I understanding, your example above:
Initial NYC = charged $120. 7 months later they add SF, no charge is made. 5 months later, their bill is now 5 months of SF + 1 year of NYC + 1 year of SF?
Where is the extra year of SF coming from? I would include always invoice and create_prorations for your use case.
So first the user pays for 1 year NYC
7 months later they select to add SF - They get the prorated amount of 5 months for SF
then when the next billing period comes around (in another 5 months) they are charged the full year for both NYC & SF
Sorry, you're right: In that situation, how do I determine the prorated charge amount to display in my cart?
You can use the upcoming invoice API: https://stripe.com/docs/api/invoices/upcoming
You submit the changes you are planning on making along with the customer
and it will show you what that would do
Would the prorated amount be in the subscription.latest_invoice.payment_intent that I use to get the client_secret to pass to the front end?
Yes, the amount of that payment intent will reflect the total amount of the invoice which includes prorations and everything else in the Invoice.
awesome, thanks ๐
FINAL question! You mention above "I would include always invoice and create_prorations" but I thought those were two possible values of proration_behavior, not two separate things?
Yes, those are both values for proration_behavior, so you would choose between them here based on whether you want to invoice immediately when making this change or not
Ah, gotcha gotcha.
Okay thanks so much for your patience and help!
Is my understanding correct?
always_invoice == charge the full amount for the added item right now and move the billing date
create_prorations == prorate the amount for the added item and charge that right now, keeping the original billing date
Not quite. always_invoice shouldn't move the billing date, it will just make sure that the user is always immediately sent an invoice for the change. create_prorations will always create invoice items for the remaining/unused time and will typically not bill immediately billing cycle was changed as part of the update
There is one other time that create_prorations will invoice immediately. I am blanking on it at the moment but am looking it up again
There we go, it happens when the billing period changes or when you go from an unpaid subscription to a paid subscription https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment
So if I initiate a subscription today (and pay $120) and then a month later I add another $120 price with create_prorations, that charge won't process until a year from the original payment date, and it'll be $110?
that is, assuming I don't change the billing date or go from unpaid to paid
Yes, that proration should create items that charge the user an extra $110 on the next billing cycle. So the next invoice total would be $120 + $110 = $230
Why would it not be $120 (upcoming year of original item) + $120 (upcoming year of added item) + $110 (prorated cost of 11 months of added item)?
Because I forgot basic math and you actually have it right
So yes, next invoice would be 2x$120 + $110 from your update's proration
lolol cool cool ๐
ugh, I hate to ask this: and if they had the initial $120, and then a month later added $120 again that got pro-rated and then pushed to the next billing cycle, what happens when the cancel 11 months after the initial date?
Will it then charge the prorated value when they cancel?
I think there are ways to charge them or not charge them when you cancel. I assume you want to charge for the 11 months in this scenario?
Correct
Or rather, for how many months they ended up having that option (if they bought it one month from the initial purchase, and then cancelled another month later, they'd only be paying for 1 month, not 11)
Oh there we go, the two parameters for the subscription cancel call are prorate - whether you want to prorate the cancelation (not bill for remaining time) and whether, and invoice_now - whether you want to send a final invoice with pending invoice items https://stripe.com/docs/api/subscriptions/cancel
So if you use both you should get the behavior that you want
Awesome, very helpful. Thanks again for all your time, have a great day ๐
Of course, have a great day yourself!