#aileen-sub-pending-updates
1 messages ยท Page 1 of 1 (latest)
Hey! Can you share the ID of a failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
It's this one req_LO1kToXTRne6ZK
Thanks, taking a look
Have you instead tried deleteing the Subscription Items directly? https://stripe.com/docs/api/subscription_items/delete
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How would this work as a pending update usage? Wouldn't that mean that I delete the item for good, no matter the pending update outcome?
Right, got it. Oversight on my part. Looking at this some more
I just had a go and tried with setting the quantity to 0, which seem to work but it's not an ideal solution imo. (see req_3oXdfcABv2KhpJ)
Got it, how is that reflected on the resulting Invoice?
It's just being prorated. If there's no other way, I'd imagine to actually delete the item once the pending update is applied. But it's a weird workaround. Deleting the item just like it's possible when receiving upcoming invoices or updating the subscription with other payment behaviours would be much better.
The idea of pending updates is great and would be fantastic for our use case, but that workaround seems a bit dodgy.... ๐ค
Got it, how is that reflected on the resulting Invoice?
Just saw that it also created a pending invoice item, which we want to avoid as well.
The only immediate solution I can think of is to update the subscription as you have (quantity: 0) and then delete the item following the successful pending update
Let me check and see if there's a better solution
To be clear, do you want the deleted items to be prorated on the resulting invoice?
Yes, that is correct
It e. g. applies to adding and removing additional add ons to products. And in general we use proration for all changes
Got it. Just following up on the resulting Invoice object from https://dashboard.stripe.com/test/logs/req_3oXdfcABv2KhpJ (https://dashboard.stripe.com/test/invoices/in_1K4PsNF2yKngx0eU0DHKRwMb). I can only see a single invoice item which is for the other subscription item, right?
i.e the item where you set quantity: 0 has gone
That invoice is the item where I actually set quantity: 0 . This is how the subscription looks like now https://dashboard.stripe.com/test/subscriptions/sub_1K4PZRF2yKngx0eU17DBOqhw (I cancelled it now in the meantime, as I'm exploring other ways as well)
Is it though? In your call your set the item to update to price_1Jk8beF2yKngx0eUblOPiKW4, which is the only Price object on the result Invoice object
https://dashboard.stripe.com/test/logs/req_3oXdfcABv2KhpJ
Look at the items field on the returned Subscription object
Yeah, it does look like intended. The one subscription item gets changed to a different price and the other item is supposed to be deleted, aka set the quantity to 0.
https://dashboard.stripe.com/test/events/evt_1K4PsPF2yKngx0eUYW9yz7Dm
Maybe I'm not following...
Well there is proration there, no?
For the one where the quantity was set to 0
I realise it's not deleted, but at least the proration is working as needed
That's true. Well, I think the only way forward is either that Stripe allows the deletion of subscription items when using pending updates, or we have to use the workaround of using quantity and deleting after the pending update got applied. Would be cool if you could communicate this use case internally. Maybe it'll be changed someday ๐
Thanks for your help!
Let me check to see if there's another way
Thanks for your patience here. This is indeed not supported currently.
One other potential workaround is just to omit the subscription item that you want to delete from the update call
However that is heavily reliant on the ordering of the subscription items array
i.e. it only really works if you're deleting and switching the price of an existing item
Yeah, that's another approach. But that will fail when the subscription update also includes a billing cycle update, afaik
e. g. can't have one sub item with a monthly recurring and the other one is yearly
which is one of the main reasons why we have to use delete
Well that's true regardless of the pending update. You can't have a single subscription with prices/items of differing intervals
catch-22 ๐