#manu.elb0507
1 messages ยท Page 1 of 1 (latest)
We have docs on that here ๐
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
oooh okay, ty
I asked that since I currently want to modify a subscription that has a number of tools and I want more to be added to that quantity but I was getting an error
so i thought deleting that item by the stripe id and putting it back would work
You should just be able to update the sub without needing to delete the item explicitly
hmm๐ค
i got this error when i was trying: "Request req_kK2v51jnhuuKsW: Cannot add multiple subscription items with the same plan"
Can you double check the request ID? I'm unable to load it on my end
req_vq9iW2dgWvO5AY
Ah actually, you might need to update the subscription item directly for quantity
https://stripe.com/docs/api/subscription_items/update
I believe updating the subscription with lines will add a new subscription item rather than updating the existing ones
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oooh ok, yeah it makes more sense to me
thank you! ill try it and let you know anything else
๐
If it is for the quantity, it would be done with the SubscriptionItem, but if it is to add a new item, can I do it with the same SubscriptionItem or update the subscription directly with Subscription.modify()?
I haven't tested it myself but you can do either I think
also you can indeed update the subscription quantity by updating the subscription
However, the trick is that you pass the subscription item ID in the items list
https://stripe.com/docs/api/subscriptions/update#update_subscription-items-id
I think that's what you were missing as you were passing in the price ID instead
yes of course, that's exactly how I was sending it but still I kept getting the error that I sent you a while ago
its a list with the dictionary with the price ID and the quantity number
[{"price": price_ID, "quantity": 1 }] <- something like that
If you're trying to update an existing subscription item then you can't pass a price ID in, you'd need to pass in a subscription item ID
like
[{ id: 'si_xxxx', quantity: 10 }]
no, i was talking about updating the subscription with Subscription.modify() not the SubscriptionItem hehe๐
I am talking about the Subscription.modify() too
If you look at the API ref I shared above, you can pass in subscription item ID to subscriptions API endpoint
with the docs you sent about the SubscriptionItem i can update the quantity, thank you so much btw!
Yeah sorry for the confusion earlier ๐
yeah dont worry haha๐