#varovas
1 messages ยท Page 1 of 1 (latest)
Hey! Bit of a broad question! Is there a specific use case you're trying to account for?
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
Check this use case it looks simular to your I think:
https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#downgrading-subscriptions
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
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.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
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?
But if the last phase of subscription is completed, then the whole schedule is completed
it depends on the https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if end behavior is release, then it will not fire subscription_schedule.completed ?
if the behavior is release then you will receive https://stripe.com/docs/api/events/types#event_types-subscription_schedule.released
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok. So what would it be the best way to handle my scenario?
When customer downgrades subscription, I want that changes would apply only on the next billing cycle.
you don't need subscription schedules for this
What do I need?
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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:
- Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
- Tomorrow he downgrades to 1 user. No proration. Subscription unchanges.
- He decides to upgrade to 2 users again. He pay 9 euro again, even he already paid for 2 users yesterday
then you need to keep track of the changes and see whether the user should be billed or not
Yes, but then it comes complicated. The same scenario:
- Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
- Tomorrow he downgrades to 1 user. No proration. Subscription unchanges.
- 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
schedules won't change this behavior
It helps if I keep a flow like this.
- Create subscription with 2 per seat users for 9 euro each. Pays 18 euros;
- 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.
- 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
I need to test this to make sure it works
I tested, it works. But now I need a way to handle that schedule phase was applied
let's say it works with schedules
you just need to advance your test clock
you don't need a webhook for this
yes, but I would like to be informed when that phase was applied. So that I could apply subscription items on my end
oh in that case what you need to look at is the invoice.paid events
I could, but it does not include information if this payment is for an upgrade or just a billing cycle
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
actually it does with the billing_reason
you will get subscription_update
let me know if you need any more help