#Teelu
1 messages · Page 1 of 1 (latest)
Hello, good question. Checking in to this and will get back to you
Our pending updates doc actually demonstrates this, you can update the existing subscription item to have the new price ID https://stripe.com/docs/billing/subscriptions/pending-updates#update-subscription
{
id: subscription.items.data[0].id,
price: 'price_CBb6IXqvTLXp3f',
},
],```
You could alternatively mark the item as deleted while adding another one https://stripe.com/docs/api/subscriptions/update#update_subscription-items-deleted
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 i mark it as deleted, the pending updates complains that im setting a field which is not possible with pending updates
deleted is not in the supported attributed
so if im going from 2 sub items to 1, i can change the price on item 1, but i need to delete item 2
all i can change is item price/quantity
My apologies for missing that. Have you tried setting the quantity to 0? I'll check if we have other recommendations here but that is worth trying in test mode at least
setting it to 0 does technically work, but then the invoice contains that price as a line item and is still part of their subscription
Gotcha, was going to also suggest an alternative of switching to a $0 and removing later but yes both of those options do make for confusing invoice items
yeahh all those options dont convey the 'correct' subscription after
and we use the subscription items on our backend to map to a plan, so depending on which prices a subscription has, it alters that mapping if a $0/0 quantity item exists
but i also need to make sure subscriptions dont move back to an active state if their payment doesn't go through
Gotcha, I've reached out to my colleagues to see if there is another potential workaround. If not, I would the easiest way to go would be to do the $0 price swap and add logic on your backend to handle that plan and I can put in a feature request to support the deleted param in future
yeah supporting the deleted flag in pending updates seems like it would be the best option, its the same thing as setting the quantity to 0 but actually removes the item if the payment is successful
ill see what i can do to support pending_updates for now, but its definitely way more useful if you can alter the items more than just price and quantity
If there is another workaround, would gladly be willing to listen
A colleague confirmed that we don't currently have another workaround. So I will add to the feedback to support deleted on pending updates but for not those workarounds will be the way to go