#Ganich - Subscription
1 messages ยท Page 1 of 1 (latest)
Okay well the basic practice would be to represent your annual subscription as a monthly subscription.
How do you currently handle proration?
And when you say merge all invoices, do you want to get paid monthly but invoice annually?
I considered this option, problem is we want to make sure the customer pays the whole year upfront.
So the basic idea is to create a proration when the quantity goes up. So say if I have 7 users on my subscription, a few weeks later I add a new one, I will update the subscription to 8 and create a proration (so at this point the customer is due to pay for this new user the rest of the period)
By that I mean that for each new user added to the subscription, an invoice will be created. But I would like to avoid spamming the customer for each new user he added over the month
Hmmm...okay
I thought of trying to fetch all the open invoices of the customer and creating a new one by gathering all the invoice items from the open ones. Then delete the buffered invoices.
So this is per-seat metered billing?
Sorry for the delay, things got kinda busy for a sec
No prob, yeah it's per seat
But not metered
Or maybe I'm confused as of how to use metered billing for this use case
I'm not sure metered is what I need, but perhaps it is
Because in my case, if a user is added during the year, it is due even if it's removed later on
Okay so the client adds 4 users two months in to their sub. Even if they remove 2 of them a few months later they get billed for all 4 for the remaining 10 months?
And when do you want them to receive the invoice?
It'd great to be able to trigger it at any time. But if a solution exists to do it monthly that'll do
You can trigger this by adjusting the billing cycle
https://stripe.com/docs/billing/subscriptions/billing-cycle
You can also control whether or not prorations are generated by specifying that behavior.
When updating the subscription with a new quantity you can also force the proration invoice with proration_behavior=always_invoice
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment
(rather than waiting to include the proration on the renewal)
From what I understand here, if I change the billing cycle, it will start a new period and charge the customer full price, right? So if at the end of the month I change it, it will charge the customer for the year again.
Yes that's right, so would depend on the behaviour you want
That's what I want to avoid, I'd like not to invoice the customer right away. Setting it to always_invoice will create a new invoice as soon as the customer adds a new user and be charged.
if you just want to bill for the difference, then using always_invoice when updating might be better for you (but you should test this to see the actual behavious)
When do you want to invoice them, if not at the time of the upgrade and not waiting until the renewal?
Ideally anytime, but the goal is to have a trigger every month or two
Learn how to manage subscription invoices.
You can trigger an invoice for pending items on a subscription at your discretion, in that case
Ow it looks exactly like what I just tried to do! The link of the "one-off" invoice is not explaining how to do it, do you have a link to the doc?
I just tried to do this:
const mergedInvoice = await stripe.invoices.create({
customer: subscription.customer,
subscription: subscription.id,
});
From what I read in the doc, it is supposed to do it but I get the following message:
Nothing to invoice for subscription
Despite having the following invoices:
Those existing invoices are unrelated, though, you're trying to create a new one
Did you update the quantity on the subscription first?
Yeah those invoices have been created when adding a user and changing the quantity with payment_behavior set to default_incomplete
Can you share one of those request id?
I mean instead to just update the subscription quantity and change nothing else
this will normally create a proration for the next renewal invoice
req_M59jYfPSVK247W
Okay so I should simply not set the payment_behavior, and set the proration_behavior to create_proration? Then triggering this invoice will work
That's what i expect, yes
Indeed, I just tried and it does what I expect. It's creating a draft invoice, I guess I need to trigger the payment of it right away?
Or whenever you want to, yes. You can finalize and pay or send it.
Excellent - glad that does what you're looking for ๐
๐
I couldn't really get it from the doc tbh
That's fair
It's tough to decide what to cover completely because the API is rich and there are a lot of different flows people want
Thanks a lot both of you ๐
Yeah of course, I mean unless you start noticing a lot of the same case you don't need to do much
Very impressed by the reactivity and the service
I can sleep well tonight thanks to you lmao
Have a nice rest of the day ๐๐ป
You too!