#varovas

1 messages ยท Page 1 of 1 (latest)

graceful krakenBOT
random oracle
#

Hey! Bit of a broad question! Is there a specific use case you're trying to account for?

sinful bay
#

When customer downgrades subscription, I want that changes would apply only on the next billing cycle. So I need a notification when should I apply changes on my end. I saw that there is subscription_schedule.completed webhook event, but I do not receive it in my local stripe event listener

random oracle
sinful bay
#

I do that. I create a subscription schedule. But when I advance clock time to next billing cycle, I do not receive subscription_schedule.completed webhook event on my local stripe events listener

#

and I dont know if it is because I am using stripe cli for event listening or stripe api do not trigger that event

random oracle
#

The event subscription_schedule.completed is triggered when a Subscription Schedule is completed, but in your case there is only a phase of the Scheduler is completed but not all the schedule.

graceful krakenBOT
brisk flint
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

sinful bay
#

Hmm, But if the last phase of subscription is completed, then the whole schedule is completed? Or I do not understand the principle of subscription schedule?

brisk flint
sinful bay
#

if end behavior is release, then it will not fire subscription_schedule.completed ?

brisk flint
sinful bay
#

Ok. So what would it be the best way to handle my scenario?

brisk flint
#

When customer downgrades subscription, I want that changes would apply only on the next billing cycle.
you don't need subscription schedules for this

sinful bay
#

What do I need?

brisk flint
#

if you have a subscription you can update it and use proration_behavior: 'none' and billing_cycle_anchor: 'unchanged' which doesn't create a proration and the billing cycle will still be the same

sinful bay
#

We are charging customers immediately after upgrade and we do proration none on downgrade. But If customer whats to get back to upgrade then he is charged again. Example:

  1. Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
  2. Tomorrow he downgrades to 1 user. No proration. Subscription unchanges.
  3. He decides to upgrade to 2 users again. He pay 9 euro again, even he already paid for 2 users yesterday
brisk flint
#

then you need to keep track of the changes and see whether the user should be billed or not

sinful bay
#

Yes, but then it comes complicated. The same scenario:

  1. Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
  2. Tomorrow he downgrades to 1 user. No proration. Subscription unchanges.
  3. He decides to upgrade to 3 users. He pays 18 euro instead of 9, because Stripe considers that upgrade is from 1 to 3 users
brisk flint
#

schedules won't change this behavior

sinful bay
#

It helps if I keep a flow like this.

  1. Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
  2. Tomorrow he downgrades to 1 user. I create schedule for next billing cycle to update users to one. So now current stripe subscription still has 2 users.
  3. Customer decides to upgrade to 3 users. Then I release schedule update and protare always invoice for this current upgrade. Then Stripe charges only 9 euro
brisk flint
#

I need to test this to make sure it works

sinful bay
#

I tested, it works. But now I need a way to handle that schedule phase was applied

brisk flint
#

let's say it works with schedules

#

you just need to advance your test clock

#

you don't need a webhook for this

sinful bay
#

yes, but I would like to be informed when that phase was applied. So that I could apply subscription items on my end

brisk flint
#

oh in that case what you need to look at is the invoice.paid events

sinful bay
#

I could, but it does not include information if this payment is for an upgrade or just a billing cycle

brisk flint
#

actually it does with the billing_reason

#

you will get subscription_update

sinful bay
#

ok, it does ๐Ÿ˜„

#

Ok, thank you for your time, I will look in to that

brisk flint
#

let me know if you need any more help