#fedeb_api

1 messages ยท Page 1 of 1 (latest)

amber hearthBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

late umbra
#

Hi, release a schedule means that intend to stop scheduling of its phases, but leave any existing subscription in place.

hallow zealot
late umbra
hallow zealot
#

that is the erro that Im having, didt release that. (im first testing on sandbox)

I want to know why I cannot extend trial for this production user req_LwfuPST1TZpNho
I dont want to use the API shedules.

so I was thinling if I do release then I can get the old way to just use the API Subscriptions and not API Subscription Schedules. ?

late umbra
#

Why do you not want to use that API?

hallow zealot
#

because the "update" method sucks.
I need to send the same phases from the response, with any modification.
since the API does't do a Merge, is doing a replace.
If I send only want I want it will delete any other phases logic since the API is doing a replace.

so every time I will need to interprate what the usar has in each phases and add a lot of code logic to mainten the same data plus the thing I want to do.

with the other regular API Subscription I was just doing something like trial_end=xxxx , prorate= false
I didt care what was the subscription content phases etc. just sending and trial_end date.

#

--
Imagine this is a backend process I need tu update phases for customer but each customer is unique has his own phases, each one is different.
can have promo code, can have taxes, can have free trial from before, anything is possible.

how I can handle so much scenarios ? is fck hardd

errant flume
#

is possible to transform the subscription schedules phases that the customer has back to normal subscription?
no, subscriptions dont have "phases" only the current items/price. that functionality is provided by schedules. as indicated, you can release the schedule and just let the subscription continue with the current items from the current phase, then make any updates you want to it. but the future phases will be discarded in that case.

#

because the "update" method sucks
I need to send the same phases from the response, with any modification.
I appreciate that the update for schedules are complex, and i don't disagree

#

But the way this works is that you need to resend those phases to perform the update, because certain kinds of changes also impact other phases, its required to send a complete phase configuration

#

eg, if you changed the start or end of a middle phase, or iterations etc, it could implicitly affect the phase before/after

#

how would we know the right way to merge that? how would we communicate back to you that other phases have also been changed?

#

Its possible we might update this to support a merge-type update in future, but thats currently not supported

#

So you need to retrieve the current schedule and send the complete phases that include any changes you want, trials or otherwise

hallow zealot
#

I see.

what tips can you give me for "send the complete phases that include any changes you want, trials or otherwise"

for example how to loop phase by phase to know what todo.
for example: case one: I want to extend a trial - case two: I want to add a trial

errant flume
#

You're effectively building a new phases array, so that depends on your server SDK, but you'd iterate the existing phases object and reconstruct the new array based on that

#

for example: case one: I want to extend a trial - case two: I want to add a trial
you would need to determine which phase is the trial and then adjust the start/end according to your need, or for a new trial phase you either convert an existing phase to be a trial or more likely insert a new trial phase at the appropriate time

hallow zealot
#

--
other question that by tech lead is asking.
If a subscription does't have an upcoming phases.
https://dashboard.stripe.com/subscriptions/sub_1REdq52hcBjtiCUZ24cXPO48
but updating trial POST /v1/customers/cus_S8vhRSNJgJouE9/subscriptions/sub_1REdq52hcBjtiCUZ24cXPO48
{
"prorate": "false",
"trial_end": "1779572987"
}

req_skeAWyjCFAOiVy

fails for
"The subscription is managed by the subscription schedule"

if we use https://docs.stripe.com/api/subscription_schedules/release?lang=curl
can we then use POST /v1/customers/cus_S8vhRSNJgJouE9/subscriptions/sub_1REdq52hcBjtiCUZ24cXPO48
without issues? or still we need to use subscription schedule?

asking because our backend only do update trials with POST /v1/customers/x/subscriptions/xx
but recently we execute a script migration price plan using subscription schedule API.
but we did't realize that doing this will affect all our current backend that was only using subscription API and not subscription schedule API.

that would be a big issue for use, to go back to backend and update all our code that use regular subscription API to adapt to subscription schedule.
we did't see anywarning that using subscription schedule make you lead to always use that from now in the future.

errant flume
#

schedules are a great way to manage future price migrations, so that's a good setup but yes would require other changes to go through that schedule too.

#

If your subscription has no future phases, ie the current phase is the only/last phase, then yes you can release it to revert to a subscription without a schedule then make updates directly via the subscriptions API

hallow zealot
errant flume
#

Oh yea you are using quite an old api version, from 2014 ๐Ÿ˜„

#

If it works for your version, don't worry about that part

hallow zealot
#

thanks

hallow zealot
errant flume
#

NP!