#Overflowz - Subscription Schedules
1 messages · Page 1 of 1 (latest)
Hello! You would need to update the Subscription Schedule and pass in the entire phases property with the updates you want to make (with already-past phases omitted): https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases
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.
Those errors should explain what you need to modify to get the request to work. If you have a specific request ID I can take a look at that you're having issues with I can help you with that. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
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?
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.