#wsnookum_api

1 messages ¡ Page 1 of 1 (latest)

solar wolfBOT
#

👋 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/1318989163428843540

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

warm lion
spice stag
#

If the initial subscription was created with a subscription schedule, how do I edit just phase[1]? I'm using stripe dotnet and I can't seem to properly set phases. Here's a snip of what I tried...

#

if (subscription.ScheduleId != null)
{
var parameters = new SubscriptionScheduleUpdateOptions
{
EndBehavior = "release",
Phases = new()
{
new()
{
Items = new()
{
new() { Price = subscription.Items.Data[0].Plan.Id }
}
},
new()
{
Items = new()
{
new() { Price = planId }
},
StartDate = subscription.CurrentPeriodEnd
},
},
ProrationBehavior = "none",
};

            await subscriptionScheduleService.UpdateAsync(subscription.ScheduleId, parameters);
        }
warm lion
#

When you update a Subscription Schedule you need to pass in all current and future phases in the update. If you want to only change the first phase you still need to supply all following phases. One way to do this would be to fetch the Subscription Schedule before you update it, copy the phase info, modify or replace the first phase, then update it with that new set of phases.

spice stag
#

Which parameters do I need to set (because the phase info is of type SubscriptionSchedulePhase not SubscriptionSchedulePhaseOptions)? For some APIs, the parameter is unchanged if not set, is it not the same behavior for this?

warm lion
#

You need to set everything that's currently set.