#nachofranco14-sub-update

1 messages ยท Page 1 of 1 (latest)

dreamy shale
#

Hey, you can control that to work however you want. What is the desired behaviour and what have you tried so far?

hazy ore
#

I'd like to override the items that are in the subscriptions with a new list of items

dreamy shale
hazy ore
#

they need to be all new, right?

dreamy shale
#

Well you'll likely have at least 1 existing subscription item, so you'd need to pass the si_xxx ID of that one with the new price_xxx

hazy ore
#

it didn't replace the items but added them

dreamy shale
#

Yep, you need to pass items[]id: 'si_xxx' for the Subscription Item you want to change

hazy ore
#

that's not the same

#

as I told you

#

I want to replace the items with a new list of items

#

is that even possible?

dreamy shale
#

Which is basically the same as what I originally told you to do

hazy ore
#

so:

  • I query the current items
  • I update the subscription with the new items
  • I delete the old items
#

would that work?

dreamy shale
#

Yup. Or you can just update the existing si_xxx items with the new Price objects. Either works!

hazy ore
#

that's not optimal because there could be changes to the vat_rate as well

#

and what's the difference between
stripe.SubscriptionItem.delete(sid)
and stripe.Subscription.modify(subscription_id, items={"id": "sid", "deleted"=true})

#

?

dreamy shale
#

Nothing really it's just a different endpoint for a single task

#

You'd still need to call the update endpoint too in your example, so you're better off just doing that

#

Otherwise you'll end up with 1+n requests as opposed to just 1

hazy ore
#

cool

#

thanks

#

I'll let you know if it worked as intended ๐Ÿ™‚

hazy ore
#

I've been trying it out, seems like it will work, will update you once it arrives to the sandbox env ๐Ÿ™‚

#

now I have another question @dreamy shale

#

are you still there?? or should I ask @fickle anchor ?

fickle anchor
#

Hi! I'm taking over this thread.

#

Let me know if you have any questions

hazy ore
#

cool

#

thank you

#

we were talking about subscriptions items update

#

I managed to override the items

#

but the removed items are creating prorations on the current invoice

#

how can I prevent that behavior?

fickle anchor
#

Thanks! Give me a few minutes to look into this.

hazy ore
#

is it fine if I just pass the proration_behavior="none" ?

fickle anchor
#

Sorry for the delay. If you don't want prorations, then yes you should pass proration_behavior="none" during your udpate call.

hazy ore
#

cool, thank you

#

I will let you know how that worked ๐Ÿ™‚