#classicbrownboy

1 messages · Page 1 of 1 (latest)

buoyant torrentBOT
cursive niche
#

Hi 👋

I'm not quite sure I get what you are asking here. You can use the APIs to retrieve the current state of the Stripe objects on your account prior to perfoming the upgrade. Would that address your needs?

cursive needle
#

I dont think that would help though. i meant more so that because we're going to be looping over all of our members and doing a...

stripe_subscription = stripe.api_client.Subscription.modify(
                member.stripe_subscription_id,
                items=[{
                    'id': stripe_subscription['items']['data'][0].id,
                    'price': recurring_price_id,
                }],
                #billing_cycle_anchor='now',
                billing_cycle_anchor='unchanged',
                proration_behavior='none',  # or 'none' if you don't want prorations
                coupon='' if not discount_id else discount_id
            )

so we're modifying all of their subscriptions to the new prices this way (for all of their future invoices). Is this not the recommended way to update the price?

cursive niche
#

Yes that is the recommended approach

cursive needle
#

is there a way to revert to the state prior to runnign this loop? Like taking a snapshot of our stripe state and database state... we can do a snapshot of our db no problem but we're not sure how we can save and reset to the prior state of stripe

cursive niche
#

What do you mean by the Prior state?

#

You could retrieve the Subscription object with the API before you make the update and store the entire JSON object

cursive needle
#

Okay but by having those prior json objects, how could i use them to return the subscriptions to that ? LIke how could we modify them back such that if something goes wrong with our price updates, we can roll back changes on stripe?

cursive niche
#

You can't just roll back the change, no