#Uche - Subscription

1 messages · Page 1 of 1 (latest)

low inlet
#

Hi 👋

quick kindle
#

Hi

low inlet
#

You remove a product from a subscription by updating the Subscription items. Have you tested out reseting the items to not include the product?

#

Changing quantity is not a method to remove an item so that would be expected.

quick kindle
#

i updated the subscription item with this code

#
stripe.Subscription.modify("sub_1L6K7FJOFr5bboslb9MIkyu8", items = [{"id": "si_LnvzJju6vEqPnR", "quantity": 0}], prorate=False)
#

is there a specific code in the apis documentation for reseting the items of the subscription?

low inlet
#

So you want to empty the items in this subscription? The customer is subscribed to nothing?

quick kindle
#

nope. i was just doing a spike for multi-product invoicing and i'm trying to figure out how it behaves in certain scenarios

#

so if i drop the quantity of one product to 0 it wont automatically be removed fro the subscription. I understand that now.

low inlet
#

I would try passing a new set of items that doesn't include an object for the item you want to remove

quick kindle
#

oh ok

#

i'll try that out and see what happens

#

but in that case it would mean updating the whole subscription and not just its items

#
stripe.Subscription.modify
#

is this assumption correct?

low inlet
#

Well you are updating the actual subscription by making changes to the items.

#

stripe.Subscription.modify("sub_XXXXX", items=[{'id': 'some_other_thing", "quantity": 2},])

quick kindle
#

thats true.

#

oh wait

#

what if i dont want to add something new

#

just drop one of the existing items

#

what would the request look like

low inlet
#

I haven't tested this (it's been kind of busy) but I would try stripe.Subscription.modify("sub_XXXXX", items=[])

#

And see what you get

#

Also this is Python syntax so if you're using a different language feel free to re-arrange the syntax

quick kindle
#

i use python so its fine

#

i'll try this out

#

thanks