#Overflowz - Subscription Schedules

1 messages · Page 1 of 1 (latest)

exotic oriole
primal sparrow
#

I tried it, by first getting the subscription schedule and pass it to the API, however, I'm getting quite errors such as: you cannot have trial and trial_end together, null values must be omitted, etc.

exotic oriole
primal sparrow
#

The thing is, for example when creating a subscription_schedule, you cannot have both "trial" and "trial_end" set together, while I'm retrieving a subscription_schedule, it already has it set. What I'm trying to do is:

retrieve the subscription schedule -> check the current phase if it's trialing:

if yes -- then modify the end_date & trial_end and save all the phases together.

if no -- create a new trial phase (straightforward)

#

is it safe to omit the trial property if trial_end is set?

exotic oriole
#

Yeah, trial and trial_end are mutually exclusive. The trial boolean indicates the entire phase is a trial period. trial_end indicates only part of the phase should be a trial that ends on the provided timestamp.

primal sparrow
#

thanks, so basically i'll remove all the null values returned by the subscription_schedule.retrieve and if there will be any trial & trial_end, it's safe to omit the trial property and increase trial_end

#

will try it, thx

#

it worked, thank you!