#Rajshree - upgrade and downgrade subscription

1 messages ยท Page 1 of 1 (latest)

snow yew
#

Hello, that definitely may be possible depending on your setup. Can you tell me a bit more about how you are updating these subscriptions now? Are you updating them directly with the API or are you using the Stripe hosted Customer Portal?

mortal relic
#

using API

snow yew
#

Awesome. That should be pretty easy to do as long as your code knows which is an upgrade and which is a downgrade.

mortal relic
#

what happens for double downgrades or double upgrades so we handle that logic at our end too?

#

UPGRADE -

        user['stripe_payment_subscription_id'],
              items=[
            {'id': current_sub['items']['data'][0].id, 'price': new_price},
              ],
        proration_behavior='always_invoice',
        billing_cycle_anchor='now'
    )```
#

DOWNGRADE

    upd_sub = stripe.Subscription.modify(
        user['stripe_payment_subscription_id'],
        items=[
            {'id': current_sub['items']['data'][0].id, 'price': new_price},
        ],
        proration_behavior='none',
        billing_cycle_anchor='unchanged'
    )```
#

downgrade code above doesnt work as expected. we expect that in downgrade it should start a new future subscription and keep the current subscription until next payment date.

snow yew
#

I am not sure I understand what is going wrong in the downgrade situation. Can you explain the behavior that you are seeing there?

mortal relic
#

its currently overriding the current subscription

snow yew
#

As in the actual plan or price that is on the subscription?

mortal relic
#

price on the subscription

snow yew
#

Alternatively, your system doesn't necessarily have to rely what is in the Stripe API. If it is possible, you may find it easier to change the price on the Stripe side but wait to change what product you are giving your user on your side

mortal relic
#

Thank you, One more question. How can we get all the future price setup for a customer ?

snow yew
#

As in how do you check if you have already set up a subscription schedule? Or something else?

mortal relic
#

Nevermind, how does Subscription differ from Subscription Schedule?

#

are they interchangeable or completely different objects

snow yew
#

A Subscription Schedule manages a Subscription. They are completely different objects

mortal relic
#

so subscription schedule can be used instead of subscriptions?

#

If we plan to use only subscription schedule for a given product, that would be sufficient for all the payments?

snow yew
#

They are connected to a Subscription object. So using a schedule is using both.

#

Not sure what you mean there, can you explain?

mortal relic
#

Is subscription schedule superset of subscription ?

snow yew
#

No, a subscription schedule is an object that updates a subscription based on the schedule's configuration

mortal relic
#

Thanks Pompey ๐Ÿ‘

lucid birch
#

@mortal relic is this your thread from before?

mortal relic
#

Thanks

#

So we want to verify the user card without charging them

lucid birch
#

You would use a SetupIntent to gather card details and validate the card

mortal relic
#

How about if we setup a $0 recurring subdcription

#

Would stripe charge us to maintain the $0 payments

lucid birch
#

Okay so if you create a $0 subscription we will actually automatically create a setup_intent that you can use to collect the PaymentMethod

#

And no, we don't charge a fee on $0 payments

mortal relic
#

Thank you @lucid birch !