#mckeemi_api

1 messages ยท Page 1 of 1 (latest)

pearl spadeBOT
#

๐Ÿ‘‹ 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/1379411341772853390

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

lone meadow
#

๐Ÿ‘‹ happy to help

#

yes unfortunately there's nothing else you can do other than changing the billing_cycle_anchor

graceful laurel
#

var newAnchor = new DateTimeOffset(DateTime.UtcNow.Date.AddDays(-2).AddHours(3)).ToUnixTimeSeconds();
var options = new SubscriptionUpdateOptions
{
BillingCycleAnchor = newAnchor,
ProrationBehavior = "create_prorations",
};
var updatedSubscription = subscriptionService.Update("sub_123", options);

Would that be along the right line?

lone meadow
#

you would need to pass ProrationBehavior = "none"

#

you don't want to charge your customer for a few hours it would sound off

graceful laurel
#

yes sorry just saw that, but that would update it to be 3 hours later?

lone meadow
#

oh sorry didn't see that var newAnchor = new DateTimeOffset(DateTime.UtcNow.Date.AddDays(-2).AddHours(3)).ToUnixTimeSeconds();

graceful laurel
#

I don't have to cancel the original subscription?

lone meadow
#

no you don't want to set an offset

#

this should be an exact timestamp

pearl spadeBOT
graceful laurel
#

ok so create an exact timestamp should work, that'seven better so I can say 3 am on the 1st of the month?

lone meadow
#

yes but that would mean that you would have to use Subscription Schedules

graceful laurel
#

we do use schedules

lone meadow
#

since the update subscription doesn't allow other than now and unchanged for the billing_cycle_anchor

graceful laurel
#

Is it the schedule I need to update instead?

lone meadow
#

you would set the phase to end at the time of your choice (basically 3 hours after the end_period of the current billing cycle) and then in the next phase you would do it for 1 iteration and pass proration_behavior none and set the schedule to release after that

stray wasp
#

hi! I'm taking over this thread. let me know if you have other questions.