djangostripe-paymentspaymentsubscription

I want to update the price for a product on Stripe


When a subscription plan is created in DB, it is synced to create a corresponding product and price on stripe. However, now i want to change the price of a plan. How would I go about changing it on stripe? I have read that we can create a new price and make the old one inactive, but how would we link the new price to the product? And what about existing users? Is it easier done using the dashboard?


Solution

  • Correct, Price objects are generally immutable meaning that fields, such as unit_amount, cannot be updated after creation. If your intention is to create a new plan and migrate all existing user/subscriptions to the new plan then:

    1. Create a new Price in Stripe under the existing Product object by passing the product parameter.
    2. Archive the old Price so that it cannot be used for any new customers. Note that the archival won't affect any existing customer/subscriptions.
    3. To migrate customers from the old Price, you'll need to update each existing Subscription to use the new Price. This can be done via the API, or via the Dashboard.