#devAgam

1 messages ยท Page 1 of 1 (latest)

manic hingeBOT
earnest wolf
#

Hi ๐Ÿ‘‹ can you tell me more about what you're trying to do? What type of object are you trying to update, what error are you encountering, and can you share the ID of a request (req_xxx) where you saw that error returned?

bold isle
#

Yea so i am working with a subscription system

#

and i have a product with two price ids

#

for monthly and yearly subscription

#

i also have a custom backend so i wanted to allow the client to update the price of the subscriptions on will

#

and have to reflect the same on stripe's end and our own databases

#

So when i try to update the price it throws the error that unit_amount is an unknown parameter

#

i thought it might be something Stripe might not be allowing so i tried to update price of the price object on the dashboard and i seem to be able to do that no issues

#

that even triggers a webhook

#

req_W7ODjdisWoT05q

#

that is the req id

earnest wolf
#

Thank you for that clarification, you are correct that it is not possible to update the unit_amount for a Price object via the API. You can see the fields that are supported when updating a Price here:
https://stripe.com/docs/api/prices/update

But there is a larger concern with the approach here, which is that you cannot update the amount of a Price at all once that Price has been used. In order to update the price for a Subscription, you will want to create a new Price object containing your new price, and then update the Subscription by editing items.price so that the subscription item is pointed to the new Price that you created.
https://stripe.com/docs/api/subscriptions/update#update_subscription-items-price

bold isle
#

right

#

thanks!

earnest wolf
#

Happy to help!