#thiagonovato
1 messages · Page 1 of 1 (latest)
What that error is trying to indicate is that you should try setting unit_amount at the top level of arguments for that call. Something like
stripeProductPriceId, {
unit_amount: price
}
}
)```
But unfortunately `unit_amount` is not updatable on our Price objects at the moment. You will need to create a new Price object with similar settings and the new USD price that you want
Ok, because in my case, i have a product with just one price. To update this price, need i to create a new price and change the priceId in product?
ohh.... maybe i can associate the product Id when I create the new price.
unit_amount: 59900,
currency: 'brl',
recurring: {interval: 'year'},
product: 'prod_MiD7soLWvtO1Em',
});```
Yes exactly, you can create a new price on the same product, we just have the restriction that a price amount can't be updated on a price after it is set
great! Thanks
can i set this new price such as default of this product?
or need i update the product after create this price?
Yeah it looks like you need to make a separate call to update the Product after creating the new Price. 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.
ok
It does not look like we have an argument in the Price creation call to automatically set it as the new default