#ajivrajani_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/1270128219009585262
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hello! ๐
Here's how I am appending a new phase to the subscription schedule:
// append new phase to existing phases
phasesForUpdate = append(phasesForUpdate, &stripe.SubscriptionSchedulePhaseParams{
ProrationBehavior: stripe.String(string(stripe.SubscriptionSchedulePhaseProrationBehaviorAlwaysInvoice)),
Items: []*stripe.SubscriptionSchedulePhaseItemParams{
{
Price: stripe.String(increasedPriceID),
// quantity remains unchanged
Quantity: stripe.Int64(schedule.Phases[numberOfPhases-1].Items[0].Quantity),
},
},
EndDate: stripe.Int64(newPhaseEndDateTime),
})
finalUpdatedSchedule, err := sClient.SubscriptionSchedules.Update(schedule.ID, &stripe.SubscriptionScheduleParams{
Phases: phasesForUpdate,
})
yes, it does
Okay, I think this is a known issue. Give me a few more minutes
Thank you ๐
Okay, so the Subscription Schedule's default_settings use collection_method: 'charge_automatically, so I think we're pulling this value for the phase you're adding
If you pass collection_method: 'send_invoice' for the new phase you're creating, do you get the same error?
I am not sure. I need to try. Do you mind leaving this thread open for a few minutes and I can try that?
Sure thing!
Thank you!
Okay I am going to include collection method in the request now:
Looks like I need to specify the days until due as well:
Wohoo! That worked - req_VhwZfOoDNwUmMD. Thanks @silk bear ! If you don't mind, can you sanity check the request I created?
Great! Yep, this looks right
Awesome - thanks a lot! Have a wonderful rest of your week ๐