#srn - subscription updates
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
Thank you
hey there, can you share the request id where you encounter this error?
https://stripe.com/docs/api/request_ids / eg req_1234
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Request req_YQEFOQgkTHHtDj
To clarify, at a high level you never "update a price". Instead, you update a subscription to indicate a new price to use.
See this example:
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
Looking at your request now, thanks
So to "modify" the price, i would need to create a new price and set that as the new default_price for the product?
COrrect. Note the docs say:
The ID of the Price object that is the default price for this product
https://stripe.com/docs/api/products/update#update_product-default_price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
SO this would be an id like price_1234
If the price is modified frequently, wouldn't this result in a number of stray price objects?
Yes, you might have many prices for a given product, this is expected.
Am i supposed to clean up unnecessary price objects?
You don't need to, no, but you can mark prices as inactive if you want to: https://stripe.com/docs/api/prices/update#update_price-active
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if a price is modified and then modified a 2nd time back to the original price, is it better to search and find the initial price and use that or to create an entirely new price with the same numeric value?
so for example if the price is modified $10/month -> $20/month -> $10/month
Should the 3rd step do a search to find the initial price or should i create a new one entirely
That's entirely up to you -- it'll work either way. If it's a current/active price you use you probably want to recycle the existing one.
are there pros/cons to either approach?
Not really, no. Price ids are invisible to customers, they'd never know the difference.