#oftysterista_api

1 messages ยท Page 1 of 1 (latest)

winged sparrowBOT
#

๐Ÿ‘‹ 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/1397509458141118555

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

civic laurel
#

hello tarzan

#

do u understand my question?

shrewd crane
#

๐Ÿ‘‹ happy to help

civic laurel
#

Thanks

shrewd crane
#

your code already does what you're expecting

#

another way to do that is by using subscription schedules

#

to make sure that the change gets applied in the next billing cycle

civic laurel
#

yes previosly your colleague is suggesting me using the schedules

#

but when i try my code actually it is working fine and it is more simple

#

so i am worry if there is anything wrong?

shrewd crane
#

the difference between the 2 approaches is when the customer.subscription.updated event happens

#

your code will automatically change the subscription to the new price, whereas in the schedule you will have the change happen on the next billing cycle

civic laurel
#

yes i know my code is automatically happens

#

but my question is it will not charges the customer immediately?

shrewd crane
#

yes it won't since you used proration_behavior: 'none'

civic laurel
#

Yes, I tried it and it actually works. But if the price I change has a different interval, is it safe?

shrewd crane
#

yes but in that case would you want to start the billing cycle now or keep it as is?

civic laurel
#

let say i want to keep it as it is. for example
current price is 10USD/Month.
and already run half way.

then i want to change it to 100USD/year

#

are u still there?

shrewd crane
#

yes I'm here

#

but do you want the year to start from now or by the end of the cycle?

civic laurel
#

the end of the cycle

shrewd crane
#

in that case you would need to do that with a subscription schedule

#

or actually you don't

#

you just need to pass billing_cycle_anchor: "unchanged"

civic laurel
#

ohh i see so we dont need to use schdule. just put the billing cycle anchor to unchanged?

#

it will keep the current cycle?

shrewd crane
#

yes correct

civic laurel
#

so if i dont pass the billing_cycle_anchor: "unchanged". the cycle will end immediately and start a new cycle with the new period.
and and there will be no refund because I set the proration to none.

#

am i correct?

shrewd crane
#

no

#

the cycle won't technically end

#

let me give you an example so it would be easier to follow

civic laurel
#

sure

shrewd crane
#

so let's say on July 1st you created a subscription for a customer with a 10$/month price. On July 17th you upgraded the subscription to a 100$/year price with proration_behavior: 'none' and billing_cycle_anchor: 'unchanged' what this will result into is the following

#

1- no invoice would be created on the 17th
2- a customer.subscription.updated event will be sent with the new price
3- the current period would be from the 17th till the 31st with the yearly price
4- on Aug 1st a new invoice would be generated for a yearly price that ends on July 31st next year

civic laurel
#

okay i got it.
but what if i dont pass this billing_cycle_anchor: 'unchanged'?

1- new invoice would be created on the 17th?
2- a customer.subscription.updated event will be sent with the new price
3.- what happen to current period? it is end now?

winged sparrowBOT
shrewd crane
#

1- new invoice would be created on the 17th?
no

#

2- a customer.subscription.updated event will be sent with the new price
yes

#

3.- what happen to current period? it is end now?
the yearly plan starts on the 17th

civic laurel
#

how come?

nocturne glacier
#

We'd always generate an invoice immediately for a monthly -> yearly upgrade. I already answered this: https://docs.stripe.com/billing/subscriptions/change-price#billing-periods

However, switching a customer from a monthly subscription to a yearly subscription moves the billing date to the date of the switch.
and
Stripe immediately attempts payment for these subscription changes:

Learn how to upgrade and downgrade subscriptions by changing the price.

#

You really just need to try and use the API to do the flows you want and see how it behaves

civic laurel
civic laurel
#

when i update the price, the invoice created immediately

#

are u still there?

nocturne glacier
#

Yes, can you please have some patience

nocturne glacier
#

The only way to not charge immediately is by using a trial to persist the existing billing anchor

civic laurel
#

by using a trial?

nocturne glacier
civic laurel
#

So you mean I have to make the current period into a trial period?

nocturne glacier
#

What is the actual desired outcome here? The user upgrades from a monthly plan to a yearly plan but keeps billing date as 1st, instead of changing to now?

civic laurel
#

yes correct

nocturne glacier
#

Then yes, use a trial period in your update request to fix the anchor to 1st

civic laurel
#

i see so it is the only option by setting the current period as a trial if I wanted to keep it. otherwise I have to use the schedule?

#

use trial period will make the status into trialing right?

civic laurel
nocturne glacier
civic laurel
#

okay i got it

#

thanks a lot

#

so billing_cycle_anchor is not used here?

nocturne glacier
#

It's ignored yes