#pavlina_best-practices
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/1336245263492186203
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Can I have the subscription object? It starts with sub_.
Yes, its this one - sub_1QoPnBAZplvGSnJj1FIZWnvy
Hi @rare wing I'm taking over this thread
What you described is the expected behaviour, and it's explained in the public doc here
On future invoices, we reflect only usage that occurs after the update. For example, say you have a monthly subscription that you switch from price A to price B on 16 January. At the end of the month, the invoice includes usage from 16 January to 31 January at price B. Usage from 1 January to 16 January isn’t billed.
https://docs.stripe.com/billing/subscriptions/usage-based/manage-billing-setup#mid-cycle-updates
Okay but what happens when the user decides to downgrade back to his first plan where he had usage?
Same, the usage before the change won't be included in the upcoming invoice.
What I'm experiencing is the following:
plan 1 with usage -> upgrades to plan 2 - usage doesn't show -> downgrades on the same day to plan 1 - usage reported on this plan shows
plan 1 with usage -> upgrades to plan 2 - usage doesn't show -> downgrades on the next day to plan 1 - usage doesn't show
"usage reported on this plan shows" -> which plan?
plan 1
Are you using test clock?
No
What's the subscription ID for the first scenario?
sub_1QohenAZplvGSnJjCpeSsRa1
👋 taking over for my colleague. Let me catch up.
you used proration_behavior: "none" when changing the price which doesn't generate a new invoice https://dashboard.stripe.com/test/logs/req_7zZY4sx0zzR97o and your customer will have access to the new subscription items without being invoiced
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you elaborate more please? I've tested the same scenario with and without using the prorate changes enabled and I still experience the same behavior
And looking at the invoice - he will be invoiced for those
would you mind testing this with a test clock?
and try to do the changes after a certain period of time (by advancing the test clock)
which changes are you referring to?
I mean upgrading the subscription
to see if the usage will show up in the generated invoice?
yes
by using test clock you can advance into the next billing cycle and check how the subscription evolves with time
So I've used the test clock and this is the invoice id in_1QoiP5AZplvGSnJjynHL4zMq
I can see that the usage was charged
as expected right?
by what you mentioned - your customer will have access to the new subscription items without being invoiced - no
he is still invoiced for those
In the case of proration_behavior none, no new invoice will be generated for the current billing cycle
but that doesn't mean that the metered usage won't be charged at the end of the period
but even the usage showing conflicts with what is described in the documentation
and why is there even a difference if I downgrade on the same day versus next day
the usage is aggregated per day
is that the reason that it displays when I go back to plan 1 in the same day?
it depends on the event time window https://docs.stripe.com/api/billing/meter/create#create_billing_meter-event_time_window hourly or daily but yes the logic is the same
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I've set mine up to daily so it makes sense, thank you tarzan
I have other questions regarding the billing, can I share them here or should I create more threads?
yes please do
which one?
I mean please do ask your questions here
I'm currently having a flat fee model and I'm looking to upgrading my current customers to usage based billing. My flat fee was all in $ where now my usage billing has 3 different prices - $, pounds and euros. So basically I have the following situation:
a customer is in the UK and pays in dollars, I need to update him to the pounds price but I have prefiltered options only for his current currency - being dollars. Is there a way I can achieve this - update his price to be in pounds?
you can't change a subscription's currency
or add multiple different currencies on the same subscription
you would have to create a new subscription
So I should cancel his current one and do a new one?
As far as I can see there isn't a proration on cancel, so if I do that I will need to refund him his last payment and create a new one?
You can prorate it, but the funds will be given to the customer as Customer balance and applied automatically to further Invoices.
Otherwise, yes, you will need to calculate the proration amount yourself and partially refund the latest Invoice payment.
how can I do both
- how to prorate it and give him this customer balance
- how to partially refund him
- Set
prorate=truewhen cancelling: https://docs.stripe.com/api/subscriptions/cancel#cancel_subscription-prorate - Create Refund using
payment_intentID from the Subscription's latest Invoice: https://docs.stripe.com/api/refunds/create#create_refund-payment_intent
Can this be done via the Stripe Dashboard?
Yes, you can even refund it in the same step.
Probably because it's exactly one month from the end of current period?
this one has more than one month
Could you please share the Subscription ID?
sub_1QoSOzAZplvGSnJj7VmtWHWi
Hmm. I am not sure. I would suggest asking Stripe Support why this option is not available on the Dashboard for your account specifically: https://support.stripe.com/?contact=true
alright, I will escalate that to them
but when I cancel the subscription, can I after that subscribe them to a new one myself via the dashboard?
Yes, you can create a Subscription via the Dashboard.
okay, I will test that
Another question I have is how to handle upgrades and downgrades via my app - you don't have the capacity to help with 3rd party apps like Cashier, right?
Depends what's the question specifically.
Well with the current implementation having flat fee I do stripe's ->swapAndInvoice() when I upgrade or downgrade
With the usage billing I see I can do ->swapAndInvoice()->addMeteredPrice()
But will this also prorate?
I see. I am not familiar with these methods since this library is not officially supported by Stripe. I can't say what it's doing behind the scenes exactly. I would suggest reaching out to the library developer.
Also can I go back to this and @pale merlin if I'm understanding correctly and this is the expected behavior:
- user is on plan 1 with usage reported -> goes to plan 2 and he doesn't have usage displayed being on plan 2 -> he goes back to plan 1 couple of days later -> there will be no usage displayed
- user is on plan 1 with usage reported -> goes to plan 2 and reports usage -> he goes back to plan 1 couple of days later -> there will be no usage displayed
Thanks for that
More questions incoming:
I see that if a user cancels his subcribtion being usage based he won't be prorated for it https://docs.stripe.com/billing/subscriptions/usage-based/manage-billing-setup#cancellations
how should I handle when he wants to come back and resume his subscription, will this be kept?
there will be no usage displayed
You mean if the usage for the plan 1 will be wiped if they change the Price?
yes
I think usage will always be preserved and prorated based on the time on a given Price.
However, at this point it's very hard to talk about these things in theory, and I would encourage you to try this out in Test mode to be 100% sure we have the same understanding.
It means that we won't calculate the proration the usual way - Price amount multiplied by the percentage of the time on the Price. But rather just bill the customer for the usage they incurred during the shortened period.
You mean that the usage will show if they go back to that initial plan that had usage?
And they will be charged the full flat fee + what's used in the period
hi! I'm taking over this thread.
I recommend testing this in test mode to see exactly how it works. and you can use Test Clocks for this: https://stripe.com/docs/billing/testing/test-clocks
I will, thanks, just wanted to see if the behavior is described anywhere, as it could also be a bug if it shows or doesnt
What about this one
Subscriptions + proration is a complex topic. I see you asked a lot of questions about this since this morning. that's why I'm suggesting to directly do tests in test mode to see how it works exactly.
I’ve been working on it for quite some time now and been doing tests as well
The lack of documentation is bothering me if my work is correct
And what to expect
I can share that feedback with the team working on this. what documentation exactly would you be loking for? How usage based subscriptions work with prorations?
Yes, also how to migrate from one plan to another
and this is specifically for usage based pricing?
Yes, in my case a flat fee to usage based
got it, thanks for the feedback!