#Camille-wca

1 messages ยท Page 1 of 1 (latest)

outer veldtBOT
tepid siren
#

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

rough acorn
#

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

tepid siren
#

And you want to charge for the usage that has already been accrued, right?

rough acorn
#

yes, that is correct

tepid siren
#

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

rough acorn
#

No, I just tested that ๐Ÿ˜ž

tepid siren
#

Ah

#

Can I see the Subscription ID that you tested with?

rough acorn
#

sub_1NvJfqFgEUv1Jmnc2TJbltfP

#

I used the route DELETE /subscription_items/si_OilCKqPEjXiScQ

tepid siren
#

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

rough acorn
#

Actually, I just saw that I left the clear_usage query param ๐Ÿคฆ I will update you with the new test

tepid siren
#

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

rough acorn
tepid siren
#

You do that after the update though

rough acorn
#

I will think about letting the metered price until the end of the period. Thank you for your help !

tepid siren
#

So update your Subscription and don't delete the metered portion.

#

Then delete the metered portion after the Invoice is generated

rough acorn
#

You mean just adding the delete flag on the subscription ? I thought it waas the same, but I will try !

tepid siren
#

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

rough acorn
#

But I don't want to change the billing cycle anchor ๐Ÿ˜…

tepid siren
#

But I thought you wanted to Invoice immediately?

#

That will always change the billing cycle anchor

rough acorn
#

I want the metered usage to be invoiced anyway. But it can be immediatly or at the end of the period

tepid siren
#

Oh

#

Then just wait until the end of the period to remove the metered Subscription item and just stop adding usage!

rough acorn
#

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 ๐Ÿ™‚