#tellelelele
1 messages · Page 1 of 1 (latest)
The error message seems to be fairly clear. Do you have a specific question?
But when I make this update request:
{
"phases": {
"0": {
"end_date": "1684431367",
"start_date": "1681839367",
"proration_behavior": "create_prorations",
"automatic_tax": {
"enabled": "false"
},
"currency": "usd",
"items": {
"0": {
"quantity": "2",
"plan": "price_XXX",
"price": "price_XXX"
}
}
},
"1": {
"end_date": "1687109767",
"proration_behavior": "always_invoice",
"start_date": "1684431367",
"currency": "usd",
"items": {
"0": {
"quantity": "2",
"plan": "price_XXX",
"price": "price_XXX"
}
}
}
}
}
I'm getting "You can not update a phase that has already ended. Trying to update phase 0."
I don't seem to be making any changes to phase 0? What can I be missing?
Do you have a request ID I can look at?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
It seems like you are indeed sending this in your POST request:
phases: { 0: { end_date: "1684431367" , start_date: "1681839367" , proration_behavior: "create_prorations", automatic_tax: { enabled: "false", }, currency: "usd", items: { 0: { quantity: "2", plan: "price_1LPrVPHtd7BvEtxkrPqon6FX", price: "price_1LPrVPHtd7BvEtxkrPqon6FX", }, }, },
So you are updating Phase[0]
Is there a way to update phase 1 without having to add phase 0 in the request?
In this request req_qhsfGbVUKgnHG0
I got an error "If passing an array with explicit keys (e.g. foo[0]=a&foo[1]=b) instead of as an array (e.g. foo[]=a&foo[]=b), the keys must be numeric and sequential starting from 0. You passed the keys 1, we expected to have a key with the value 0."
No - you need to pass them all
https://stripe.com/docs/billing/subscriptions/subscription-schedules#updating
When updating a subscription schedule, you need to pass in all current and future phases that you want to keep.
Hmm, that's what I'm trying to do with req_VG3iNMsUf92YoB but I'm getting the "You can not update a phase that has already ended. Trying to update phase 0." error even if I checked and was not making any changes to phase 0.
For additional context, I'm also retrieving the subscription schedule first, finding phase 1 (through the start date) and only updating the quantity on phase 1.
What happens if you send those two phases as an array, instead of with the 0/1 indexes?
Can you try that?
I tried this but it seems like the ruby SDK adds it automatically when I do
::Stripe::SubscriptionSchedule.update(subscription_schedule_id, { phases: phases })
phases is passed without the 0/1 indexes
Oh, this error doesn't make it obvious, but it looks like you'd already cancelled the subscription:
https://dashboard.stripe.com/test/logs/req_IT6FZdqzt85G37
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.