#trueinviso

1 messages ยท Page 1 of 1 (latest)

frozen mangoBOT
spark dagger
timid parcel
#

req_LLn4DtnVoUyHT1

spark dagger
#

Thanks!

timid parcel
#

req_FgpbAXgZUWEwol

#

I've tried several different variations

spark dagger
#

So you want to replace the existing phase with the new one, correct?

timid parcel
#

yes at the end of the billing cycle

spark dagger
#

Have you tried only passing the new phase with the start date specified?

timid parcel
#

yes

#

You can not modify the start date of the current phase.

#

that's the error message

timid parcel
#

req_J9kelvjiDQaIzO
for that one

spark dagger
#

I'm testing on my end too

spark dagger
#

Okay I was finally able to get one to work.

#

Lots of issue with testing environments

#

I provided the start_date for the new phase as the same timestamp as the end_date for the previous phase

#

My steps were as follows:

  • Retrieve a Subscription Schedule
  • Get the Phases array from it
  • Add a new phase object with the start_date for the new phase equal to the end_date for the previous phase
  • Update the Subscription Schedule record with the new array of phases
timid parcel
#

What do you do with the phases array on the second step?

tacit surge
#

๐Ÿ‘‹ stepping in as Snufkin had to step away

#

catching up

timid parcel
#

I finally got one to work by adding start_date and end date to the first phase, then adding start_date to the second phase that matches end date of the previous phase

tacit surge
#

Yep

timid parcel
#

but the first phase already had a start date cuz it's an existing subscription, it seems weird to redefine it

tacit surge
#

When updating a Sub Schedule you have to put in the current phase as phase 0

timid parcel
#

so I guess you just do that by pulling the data you need from the existing phase?

tacit surge
#

Yep

timid parcel
#

then adding an end_date

#

which in my case would be the end of the current billing cycle

tacit surge
#

Right

#

The other option is to use iterations

#

You shouldn't need to define an end_date if you have iterations set

timid parcel
#

I don't think I can use iterations if I'm trying to switch plans at the end of the current billing cycle? Or if I put iteration of 1 on the first phase it would know to end it automatically at end of the billing cycle?

tacit surge
#

Yep iterations 1 would mean just cycle that phase one time then move to the next phase at end of billing cycle

#

It should be easier than actually calculating or retrieving the end_date

timid parcel
#

but if the existing subscription is half done, and you schedule a switch, will it switch in 2 weeks at the end of the original billing cycle? Or will it create a phase with a billing cycle of 1 month == 1 iteration?

tacit surge
#

You are just trying to update what happens in the next phase, right?

#

Not the current one

timid parcel
#

I'm trying to schedule a downgrade on the subscription, and want the sub to downgrade when the high subscription they paid for ends

#

I was told the only way to do this was subscription schedules

tacit surge
#

Yep that's correct

#

Are you adding a Schedule here or updating one?

timid parcel
#

well I"m adding one, but I guess I have to create one using from_subscription first then update it. Is there an easier way?

tacit surge
#

No that would be the correct way. When you retrieve it after creating it, what does the current phase look like?

timid parcel
#

here's an example

#

it creates a schedule with a phase matching the existing subscription

tacit surge
#

Okay yeah sorry I believe I was incorrect before. You would need to use end_date not iterations in this case

#

I'll test real quick because I don't remember

timid parcel
#

When I retrieve the schedule after making an update to the phase, I don't see the schedule attached to the subscription in the dashboard, is there a place to view it?

#

well I see this tag here

tacit surge
#

You can't see a schedule details in the Dashboard specifically. You would need to look at the API Request or Events

timid parcel
#

the tag is good enough to verify that it's scheduled, thanks

tacit surge
#

Okay sorry had to step away for a moment. Did you update by setting end_date?