#surajpatidar
1 messages · Page 1 of 1 (latest)
I don't understanding. What do you mean by 'change time'?
i want to work on subscription upgrade and downgrade okay
so i want like that if subscription upgrade Immediate but when user downgrade subscription effect after end of the subscription
it possible to stripe subscription upgrade immediately but downgrade end of the date
You'll need to schedule the downgrade I guess: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#downgrading-subscriptions
but how to i know this subscription downgreade or not
Hi! I'm taking over this thread.
You write the code to upgrade/downgrade the subscription, so you should know if it's an upgrade or downgrade.
i have write this code for upgrade and down grade
subscription.id,
cancel_at_period_end=False,
proration_behavior="always_invoice",
items=[
{
"id": subscription["items"]["data"][0].id,
"price": price_id,
}
],
)```
can it possible to create user request downgreade but plan chnage after and of the priod
If you want the downgrade to happen at a later point (like at the end of the billing cycle), then you need to use subscription schedule as mentioned above: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#downgrading-subscriptions
okay but i have confuse
customer='cus_GBXV9Q95NFT80k',
start_date='now',
end_behavior='release',
phases=[
{
'items': [
{'price': '{{PRICE_DIGITAL}}', 'quantity': 1},
{'price': '{{PRICE_PRINT}}', 'quantity': 1},
],
'iterations': 1,
},
{
'items': [
{'price': '{{PRICE_PRINT}}', 'quantity': 1},
],
'iterations': 11,
},
],
)```
i can't unserstand this
Using subscription schedules is more complex than a simple subscription upgrade/downgrade.
You can learn more about how this works here: https://stripe.com/docs/billing/subscriptions/subscription-schedules
how it possible to upgrade or downgrade in simple way
With stripe.Subscription.modify(...), but the upgrade/download will happen immediately.
it possible to if upgrade with using .Modify but it downgrade with stripe Shedule
Yes, that's completely up to you.
I don't understand your question. What exactly are you trying to do?
can i us this for upgrade ```subscription = subscription.modify(
cancel_at_period_end=False,
proration_behavior='always_invoice',
items=[{
'id': subscription['items']['data'][0].id,
'plan': new_plan_id,
}]
)
and this for downgrade
cancel_at_period_end=True,
items=[{
'id': subscription['items']['data'][0].id,
'plan': new_plan_id,
}]
)```