#Camille-wca
1 messages ยท Page 1 of 1 (latest)
Hello
So in this scenario you are saying you have multiple Prices (Subscription items) and you just want to remove one of them?
And still Invoice when you do so
yes, i have a licensed price + a metered price, and actually want to change the whole subscription to another licensed price
without cancelling the whole subscription if possible
And you want to charge for the usage that has already been accrued, right?
yes, that is correct
I haven't tested this myself in a while so I don't remember exactly how this works. But I do believe that as long as you set proration_behavior: 'always_invoice' on your update then it should do that.
So I'd recommend testing that out and seeing what happens
No, I just tested that ๐
sub_1NvJfqFgEUv1Jmnc2TJbltfP
I used the route DELETE /subscription_items/si_OilCKqPEjXiScQ
Ah okay thanks. So actually in this case I think what you are going to need to do is create an Invoice Item that corresponds with the amount of metered usage and add that Invoice item to the Subscription. Then you can update the Subscription to the new Price and that Invoice Item will be picked up in the new Invoice. You don't need to use the DELETE /subscription_items route btw, you can just do this on a Subscription update request by setting items.deleted: true
Actually, I just saw that I left the clear_usage query param ๐คฆ I will update you with the new test
Hmm the other thing you could do is just not delete that Subscription item at all and just charge for it
Yeah I just noticed that too
Yeah try again because I think the flow you are using should work just fine
Nope, Stripe wants me to clear all usage when deleting a metered item unfortunately
https://dashboard.stripe.com/test/logs/req_NQN1iUOrTS3BVD?t=1695907986
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You do that after the update though
I will think about letting the metered price until the end of the period. Thank you for your help !
So update your Subscription and don't delete the metered portion.
Then delete the metered portion after the Invoice is generated
You mean just adding the delete flag on the subscription ? I thought it waas the same, but I will try !
No sorry that's not what I mean
You want to change the licensed Price, keep the metered Price, and force a reset of the billing cycle anchor which ends the period and should charge the metered Price.
Then after that occurs, remove the metered Price
But I don't want to change the billing cycle anchor ๐
But I thought you wanted to Invoice immediately?
That will always change the billing cycle anchor
I want the metered usage to be invoiced anyway. But it can be immediatly or at the end of the period
Oh
Then just wait until the end of the period to remove the metered Subscription item and just stop adding usage!
I will think about that, but I am afraid it could do some weird things in my application if the subscriptions changes again before the invoice ๐ค
Anyway, thank you for your help ! It is always appreciated ๐