#Vasil
1 messages · Page 1 of 1 (latest)
Can you explain what exactly you mean by 'upgrading user subscription' and which data you require in your webhook?
We have several monthly pricing plans, let's call it Free, Light, Pro
By upgrading I mean switching between them (https://stripe.com/docs/billing/subscriptions/upgrade-downgrade) according to the doc
Sure! Then a customer.subscription.updated event would fire to reflect those changes made
But should we make sure that it's paid by waiting for invoice.paid? Or customer.subscription.updated - is the correct point when all required actions (user paid etc.) accomplished?
This is why I asked it depends on what data you need and what action you're taking from the event
If you're awaiting payment confirmation following an immediate upgrade, then yes invoice.paid
invoice.paid will always fire, even for zero amount invoices (trials, discounts, etc)
(don't use invoice.payment_succeeded)
ok, now I understand, thank you
one more question: how can I upgrade (not cancel) user subscription in the end of period and not immediately?
I think you can set the billing_cycle_anchor to the timestamp you want duration the update, and also pass proration_behavior: 'none'
and in this case if I request user subscription thru API how can I understand (which fields to examine) which is current price/plan and which one is next month?
Well assuming that update call is successful the items would reflect the new plan(s) and there'd be no reference to the old/current plan(s)
but in this case when I receive customer.subscription.updated? once new plan started?
No, immediately after your API call to update
If you want greater control of this, you could look at schedules: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#upgrading-subscriptions
With a schedule the actual update wouldn't happen until the scheduled start date of that phase
And you can better manage/track which plans a user is on or is going to be on
and in this case what plans will I see if request user subscription thru API ?
let's say user will be switched to new plan in 2 days, but now he is still on old plan
You'd see their current plan. You'd want to query the schedule to see their future upgrades you have schedules
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, thank you