#pavlina_best-practices

1 messages · Page 1 of 1 (latest)

upper grailBOT
#

👋 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.

dire karma
#

Hi! Can I have the subscription object? It starts with sub_.

rare wing
#

Yes, its this one - sub_1QoPnBAZplvGSnJj1FIZWnvy

upper grailBOT
kindred harbor
#

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

Use Stripe Billing to create your usage-based billing model and then handle related tasks, such as canceling subscriptions, making mid-cycle updates, and backdating subscriptions when you create them.

rare wing
#

Okay but what happens when the user decides to downgrade back to his first plan where he had usage?

kindred harbor
#

Same, the usage before the change won't be included in the upcoming invoice.

rare wing
#

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

kindred harbor
#

"usage reported on this plan shows" -> which plan?

rare wing
#

plan 1

kindred harbor
#

Are you using test clock?

rare wing
#

No

kindred harbor
#

What's the subscription ID for the first scenario?

rare wing
#

sub_1QohenAZplvGSnJjCpeSsRa1

upper grailBOT
pale merlin
#

👋 taking over for my colleague. Let me catch up.

pale merlin
rare wing
#

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

pale merlin
#

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)

rare wing
#

which changes are you referring to?

pale merlin
#

I mean upgrading the subscription

rare wing
#

to see if the usage will show up in the generated invoice?

pale merlin
#

yes

#

by using test clock you can advance into the next billing cycle and check how the subscription evolves with time

rare wing
#

So I've used the test clock and this is the invoice id in_1QoiP5AZplvGSnJjynHL4zMq

#

I can see that the usage was charged

pale merlin
#

as expected right?

rare wing
#

by what you mentioned - your customer will have access to the new subscription items without being invoiced - no

#

he is still invoiced for those

pale merlin
#

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

rare wing
#

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

pale merlin
#

the usage is aggregated per day

rare wing
#

is that the reason that it displays when I go back to plan 1 in the same day?

pale merlin
rare wing
#

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?

pale merlin
#

yes please do

rare wing
#

which one?

pale merlin
#

I mean please do ask your questions here

rare wing
#

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?

pale merlin
#

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

upper grailBOT
rare wing
#

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?

inland egret
#

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.

rare wing
#

how can I do both

  • how to prorate it and give him this customer balance
  • how to partially refund him
inland egret
rare wing
#

Can this be done via the Stripe Dashboard?

inland egret
#

Yes, you can even refund it in the same step.

rare wing
#

I can't seem to find this option though

#

only a full refund or no refund

inland egret
#

Probably because it's exactly one month from the end of current period?

rare wing
#

this one has more than one month

inland egret
#

Could you please share the Subscription ID?

rare wing
#

sub_1QoSOzAZplvGSnJj7VmtWHWi

inland egret
rare wing
#

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?

inland egret
#

Yes, you can create a Subscription via the Dashboard.

rare wing
#

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?

inland egret
#

Depends what's the question specifically.

rare wing
#

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?

inland egret
#

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.

rare wing
# rare wing I've set mine up to daily so it makes sense, thank you tarzan

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
rare wing
#

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?

Use Stripe Billing to create your usage-based billing model and then handle related tasks, such as canceling subscriptions, making mid-cycle updates, and backdating subscriptions when you create them.

inland egret
#

there will be no usage displayed
You mean if the usage for the plan 1 will be wiped if they change the Price?

rare wing
#

yes

inland egret
#

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.

inland egret
rare wing
upper grailBOT
rare wing
shrewd coral
#

hi! I'm taking over this thread.

rare wing
#

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

shrewd coral
#

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.

rare wing
#

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

shrewd coral
#

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?

rare wing
#

Yes, also how to migrate from one plan to another

shrewd coral
#

and this is specifically for usage based pricing?

rare wing
#

Yes, in my case a flat fee to usage based

shrewd coral
#

got it, thanks for the feedback!