#surajpatidar

1 messages · Page 1 of 1 (latest)

last horizonBOT
sharp bobcat
buoyant dagger
#

stripe.SubscriptionSchedule.create(
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 cant' understand this

#

how ti work

#

it set start_date now

sharp bobcat
#

SubscriptionSchedules are complex and you will have to spend time understanding them before you can use them. If you have specific questions let me know

buoyant dagger
#

for upgrade i have use this it right ?
stripe.Subscription.modify(
subscription.id,
cancel_at_period_end=False,
proration_behavior="always_invoice",
items=[
{
"id": subscription["items"]["data"][0].id,
"price": price_id,
}
],
)

sharp bobcat
#

that will modify a subscription right now

#

which is not the same as " downgrade subscription but end of the current subscription period " as you asked. If you want it to be at the end of the period, then you'd need to use a SubscriptionSchedule to set that up.

buoyant dagger
#

i want if upgrade immedityly but downgrade after end of the period

sharp bobcat
#

cool. Then I think you can use that stripe.Subscription.modify approach for the upgrade and a Schedule for the downgrade.