#kanohian
1 messages · Page 1 of 1 (latest)
Hi, you can upgrade or downgrade a subscription by making an Update Subscription request, https://stripe.com/docs/api/subscriptions/update. You can learn more about it here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
yes, I tried upgrade
but it tells me that there is no product with that Id
let me show you
[
'payment_behavior' => 'pending_if_incomplete',
'proration_behavior' => 'always_invoice',
'items' => [
[
'id' => $targetTier->stripe_id,
'price' => $priceId,
],
],
// 'metadata' => $metadata
];
You can share the request id where you're seeing this message. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
On it
req_BLtwa8x50vIYeZ
this is the req
thing is I am changing both: product and price
Taking a look
ok
links you shared me talk about changing the price, but the price must be associated to the product related to this subscription. What I need is to associate this subscription to a different price and product
otherwhise create a new subscription for this other product, but with very same info of original subscription
yeap, the error is due to the product not being related to the subscription. Are you not able to create another price for that product? Can you share more details of your use case?
sure
it works like an upgrade. You have Lite Gold and Platinum plans. Each one with proper addons and other stuff, so they are different from each other and hence with differen prices
the goal is being capable of upfgrading from Lite to Platinum(for example), either by just updating the subscription(if possible) or create a new subscription with same duration, metadata
I want to go for the subscription upgrade path, because is simpler, but....
I see, let me test something on my end. I'll provide an update here when I can.
second path is complex, because, for example, system bills on subscription, once a year, but if I upgrade on middle of year things turn complex
ok thanks
I will keep reading docs
I'm thinking Subscription Schedules, https://stripe.com/docs/billing/subscriptions/subscription-schedules will solve what you're seeking to do. However, testing to confirm
let me check
is a little extensive, I will take some time to check it well. If you have some link close to what I need I preciate it
anyway thanks a lot
Actually, to replace the price, you'd need pass the Subscription Item id: https://stripe.com/docs/api/subscriptions/update?lang=php#update_subscription-items-id. This will resolve for what you're looking when making the Subscription Update request.
'items' => [
[
'id' => $subscription_itemId,
'price' => $priceId,
],
@plush gale let me know if this does not work