#mike-mileiq
1 messages · Page 1 of 1 (latest)
Hello! Give me a few minutes to take a look
I'm still looking, but I think this is a combination of a few different things here - you're on a very old API version 2013-10-29 that was before we made some changes to how trialing work, so in order to maintain that behavior internally we re-pass in whatever trial_end was set on the subscription (even if it was in the past). For most subscriptions (that aren't tied to a subscription) this would work totally fine, but since your subscription IS tied to a schedule it hits an error
The best way to get around it would be to either remove the schedule from the subscription if you don't need it anymore, or to make the changes directly to the schedule instead of updating the subscription
can you tell me more about :
make the changes directly to the schedule instead of updating the subscription
Instead of hitting the /v1/subscriptions/sub_123 endpoint to update the subscription, you'd just update the schedule instead by changing it's current phase - https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-items-quantity
and you can also pass in proration_behavior: always_invoice for subscription schedule updates as well (https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior)
can we modify a specific schedule phase?
I always thought we needed to append a phase
When you update a schedule and pass in phases we expect you to pass in ALL the phases for that subscription - there isn't a way to update a specific one
ok right I see
Yeah for this specific case you'd only need to pass in one phase though (since the schedule only has one phase and that's the one you want to modify)
so in the example I sent you we only passed in this POST payload
{
"proration_behavior": "always_invoice",
"items": {
"0": {
"quantity": "10",
"id": "si_LLOlc5TCs5D8wR"
}
}
}
basically we just wanted to change the quanity
Right, so for the schedule instead of passing in the Subscription Item ID you'd just pass in the new quantity you want, and the price ID
It's not a perfect example for your use case, but you can see an example here: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases
I think that is what we are doing....
but you said maybe this is an API version problem?
I'm wondering why it still references the expired free trial
if you're still having trouble getting the subscription schedule update to work feel free to send me an example request!
and yeah, the api version is what's causing it to reference the expired free trial
ok so mabye we if update our API version this error would go away?
You could, but that's a LOT more work - you're on a very very old version (2013) and our most revent version is from 2022-11-15
well can I reference the new API only for these subscription schedule calls?
You can try it, but I'm not 100% sure it'll work - a lot of our subscriptions/schedules logic checks the default API version of the merchant because so many of those requests/changes are happening async (when the subscriptoin cycles for example)
gotcha
but definitely try it and see if it helps 👍
awesome, thanks so much for the help