#gabor
1 messages · Page 1 of 1 (latest)
Hello!
- You can do that, sure.
- Probably, yes.
- Yes.
- Not sure I understand this question, can you provide more details?
- After release it will continue on based on the final phase of the Schedule.
Hi @olive pulsar, thank you!
I mean, I'd like to increase the number of free months by one when a successful referral was made. I guess the way of doing this is to retrieve the schedule for the subscription, find the phase that is for the free "reward" period, and increment the iterations value by one. I'm not sure how to target this phase.
When I create the schedule from the existing, active subscription, and add the reward phase to the schedule, I assume there will be two phases initially: the current, paid phase, and the upcoming free phase (this includes a 100% off coupon by the way).
Another way to approach this would be to add trial time to the Subscription directly. You can adjust trial_end whenever you want: https://stripe.com/docs/api/subscriptions/update#update_subscription-trial_end
Using Subscription Schedules will also work, but will be more complex. If trial_end adjustments work for your use case I would recommend that as a simpler approach.
Thanks for the tip, I am going to look at the trial way. But I would still like to try the subscription schedules solution with coupons, because it seems just like what wee need.
You can also set metadata on phases within the schedule for example you could set a reward metadata key/value.
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
note that this metadata changes the subscription metadata when the phases are applied
Oh, that seems nice. So, that would make it possible to target the phase easily.
I would expect so, yes
I am not using subscription metadata currently, so it might not be a problem.
right so say you set metadata[phase_type]=reward on that phase, this would be applied to the subscription when that phase starts. you might want to configure metadata[phase_type]=paid or similar after the reward phase so the subscription reflects that the reward phase has ended (if that matters to you)
That sound good, thank you!
- After release it will continue on based on the final phase of the Schedule.
Is it best to copy the current subscription properties as the final phase?
…when creating the schedule
That's up to you, if you want it to go back to the way it was, then yes
Yes, I meant if I want to go back to the original paid subscription after the reward period is over. Thanks!
Thank you again for your help @brisk bramble and @olive pulsar, this was very useful!
you're welcome!