#TonyS

1 messages ยท Page 1 of 1 (latest)

sly iceBOT
pearl summit
old hazel
#

Hello ๐Ÿ‘‹
How can I help?

pearl summit
#

Hello Hanzo, as I Mentionned I have an issue with subscription schedule and end_date. it does not seem to work.

#

To sum up, we want to create a schedule for a customer with : 1. A monthly subscription

#
  1. At the end of this subscription switch to a yearly subscription but with a specific end date (less than 1 year, could be 3 month as it could be 7 month)
#

are we doing the right thing?

old hazel
#

I am trying to load up the previous discord thread but the UI is not loading it for me.

Can you give me a short description of what you've tried already?

pearl summit
#

I can you the req_id maybe it will be clearer

old hazel
#

Sure

pearl summit
#

req_SUwhCyHzmN9B1m with the sub_schedule sub_sched_1MsmiODhXwH3fVpP0H8SoyGX

#

{
"phases": {
"0": {
"items": {
"0": {
"tax_rates": {
"0": "txr_1LFG8TDhXwH3fVpP7QeJxpVw"
},
"price": "price_1Mk4ubDhXwH3fVpPum3WDxJd"
}
},
"iterations": "1"
},
"1": {
"end_date": "1707692400",
"items": {
"0": {
"tax_rates": {
"0": "txr_1LFG8TDhXwH3fVpP7QeJxpVw"
},
"price": "price_1Mk4sZDhXwH3fVpPOVfA1ihV"
}
},
"coupon": "SWITCH-BASIC-PRO"
}
},
"start_date": "now",
"customer": "cus_N9mvKlzl2fWHJF"
}

old hazel
#

hmm I see that you're creating two phases with the timestamp calculated accordingly

pearl summit
#

As you see in this example we specified a end_date in the second phase

#

"end_date": "1707692400",

#

which means we want this specific subscription to end the 11 of february

#

but it does not work as intended, the subscription last a full year

#

and does not end at the specific date

#

your colleague advised us to try the strip clock to check if it was an UI issue or a real issue

#

I confirm to you that this is a real issue, the clock does not renew the second subscription at the correct time

old hazel
pearl summit
#

Mmmmm ๐Ÿค”

#

Ok we'll check and get back to you in a minute

old hazel
#

๐Ÿ‘

#

By default the subscription keeps going

pearl summit
#

This is not our issue

#

our issue is the following

#

We want to have a monthly subscription and then a defined yearly subscription that does not last a year

#

But the subscription should still be "renewed"

#

we just want to decide "when"

#

The question is what is end_date used for usually? Are we understing this field the right way?

old hazel
#

end_date specifies the end date of a phase (not a subscription)
It tries to move on to the next phase once the phase reaches the date specified

Not sure what happens if there are no next phases to move on to..

pearl summit
#

It seems it does nothing

#

how can we say that the next subscription linked a specific phase will last X Days? Is there a way of properly doing this?

old hazel
#

The example that you shared above for the subscription schedule is not linked to a test clock as such, can you share the ID that you tested with the test clocks?

pearl summit
#

sure

#

cus_Ne6IjYBv1zuDo2

old hazel
#

With the test clock, the subscription did move to the yearly price

pearl summit
#

yes

#

but it sould have "renews" in march 2024

#

we try to "shorten" the subscription time

#

of the yearly subscription

old hazel
#

You may want to double check how you're calculating the end date

pearl summit
#

Ok I'll do a double check since we did a lot of testing all our customers for this case are a little bit around the place

#

But we did several testing to be sure it wasn't an issue on our end and it was always the same

#

Do you know if specifiying end_date should work or not?

old hazel
#

It should

pearl summit
#

I'll check right now and come back to you in 1 sec

old hazel
#

NP! ๐Ÿ™‚ Take your time

pearl summit
#

could you please check this customer

#

cus_Ne7Fx52FuUTbs8

#

we provided the end_date : 1683724037

#

which is 10 may 2023

old hazel
#

I see the end_date is set correctly on the phase..
Can you forward the clock to May 11th 2023?

pearl summit
#

I did to 17

#

Do you have another solution?

old hazel
pearl summit
#

๐Ÿค”

#

but the user should have a new payment of 180

#

since we want to "renew"

old hazel
#

I think you probably need to add a third-phase that renews the subscription on a given price. The schedule end date only ends the phase. I don't think it modifies/ends the subscription cycle as such

pearl summit
#

Ho ok

#

that would be the best practice ?

old hazel
#

Your usecase is quite niche so there aren't any best practices for this as such ๐Ÿ˜„ As long as it works, its the best option.

pearl summit
#

lol ok

#

thank you so much for your help I'll keep digging

old hazel
#

NP! ๐Ÿ™‚ Sorry for the confusion earlier.

#

took a while to get on the same page

pearl summit
#

np have a great day

old hazel
#

You too, good luck ๐Ÿ˜„