#Honeydewd-subscription-pricechange

1 messages · Page 1 of 1 (latest)

dire bear
#

hello, are you doing that via an API request?

molten cedar
#

yes i am

#

so the problem is: i have 2 subscription items which currently have recurring interval of "month" but i want to change both of them to "year" at the same time

dire bear
molten cedar
#

i have done that

#

i did a loop to loop through current subscription items

#

and then pass in the new price id

#

can you check this log for me

#

req_1z4b4MdkvpUIPX

#

hello?

#

is there a way to bulk update subscription itmes?

dire bear
#

just seeing this, one sec

#

no, you're not passing the Subscription Item ID in your code

#

see the link I sent you

#
    {
      price: "price_1LX89BFgd2Izie2bZD3ho8Ky"
    },
    {
      price: "price_1K6KPVFgd2Izie2bY0ONdHZL"
    }
  ],```
you're passing that^
#

what you need to pass is what the docs show:

 items: [
      {
        id: subscription.items.data[0].id,
        price: 'price_123'
      }
    ]
#

and you need to do that for both your SubscriptionItems

molten cedar
#

i see i see...

#

so it'll be something like

#

subscription.update( items: [ { id: subscription.items.data[0].id, price: 'price_123' }, { id: subscription.items.data[1].id, price: 'price_123' } ])

dire bear
#

yes

molten cedar
#

i'm looking at the api but items doesn't seem like a parameter that's allowed

molten cedar
#

ahhh sorry i missed that

#

thanks i'll try this out

#

i think it was because i was updating individually for the subscription items

#

while i need to update all of them in bulk using a subscription update funciton

#

correct?

dire bear
#

yes it is one request to update all the SubscriptionItems

molten cedar
#

understood