#Honeydewd-subscription-pricechange
1 messages · Page 1 of 1 (latest)
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
you have to do this: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
change "each" Subscription Item and pass the new Price (yearly)
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?
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
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' } ])
yes
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i'm looking at the api but items doesn't seem like a parameter that's allowed
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?
yes it is one request to update all the SubscriptionItems
understood