#Benoît
1 messages · Page 1 of 1 (latest)
There is though it may take another API call. Checking in to this and will get back to you
Thnk you !
Have you tried the price_data parameter? You need to have a Product that already exists but you can create ad hoc Prices with it https://stripe.com/docs/api/subscriptions/update#update_subscription-add_invoice_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I saw it but i don't try it, as i wanted to avoid to make an API call to retrieve the Product ID
I just have the Plan ID i want to add as a subscription item
by using price_data , this price will never really be created, will he ?
If you have a plan ID you can put that anywhere that is expecting a Price ID and it should work
Prices are backwards compatible with Plans
price_data will create a temporary Price object
Yes but the Plan is already added as subscription item, what i need is a calculated one-time fee amount that could vary
I will try price_data , i think it's the solution. It just make me call the API to get the Product ID of my Plan
Yeah that sounds like the best solution. You can also cache the Price->Product relations on your side to avoid API calls
Of course, glad I could help!