#yogesh_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1310573997632786508
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
taking a look at your request now
this is what you're looking for https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#changing:~:text=Alternatively%2C you can delete the current subscription item and create a new subscription item with the updated price.
I can't pass deleted param since the payment_behavior is pending_if_incomplete
did you try it?
yes, req_mokC7PVXW2CCXA
ok, in this request req_qwFr0mXzqaAvMt you didn't pass the subscription item ID
Oh I see what's happening
I've passed the Item ID
I'm talking about the first request where you're upgrading to another price
the problem in the first request you shared is that the new price you're passing is yearly
whereas the subscription already has another monthly price
you can't have 2 prices with different intervals on the same subscription
correct, basically I want to replace the all line items with new one.
What should I send in API so that it removes all the current line items with only keeping the new one from payload?
That way there will be only one line item of yearly
would you mind trying to delete both existing SIs and adding a new price (instead of updating one and deleting the other)?
So I've to call multiple update calls?
let's first try it with one update call
okay, let me try
hey, just a doubt. When you say delete existing and adding new one, I should send only the new one without subscription item ID?
As I can't pass deleted: true because of payment_behaviour setting
I had to make multiple update API calls, to remove items with deleted with payment_behaviour as default_incomplete and then updating the subscription again with new items.
yes unfortunately I was testing this out in parallel
and there's no way to accomplish this in 1 API call
Not an ideal solution
at least not with pending_if_incomplete
yes, well I'll go with multiple calls for now.
good, one thing you shouldn't forget, is to add the price your removed if the the payment was incomplete