#Overflowz-subscription-extension
1 messages ยท Page 1 of 1 (latest)
Hello ๐
I believe this usecase sounds like it is a better fit for Subscription Schedules.
Let me look into it
Yeah, but I'm limited to set some properties for the subscription object itself ๐ฆ i.e., it's really important for me to set payment_behavior and some metadata properties into it.
I see. Looking into it
thanks a lot!
Apologies for the delay
juggling between multiple threads
no worries, take your time
You can migrate existing subscription to a Subscription Schedule which should theoretically carry over the properties https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
I tried that too, but if I want to add a new phase (i.e., trial period into it) it asks gives me error saying "missing phases[0].items. even I provide it, then it asks me about "missing start_time on a phase". when I provide that, it tells me that "you cannot modify start_date of that current phase" which just drives me crazy.
are you trying to add the phase at the same time as creating the schedule from a subscription?
I mean, if I create a subscription schedule, how can I add the trial period into it (free N months for the user)?
I'd probably divide it in two steps
- You can create a schedule from existing subscription : https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-start_date
- Update the schedule by adding a new phase
I get those errors when I'm trying to update that schedule. I'll try again maybe I'm doing something wrong. thanks, I'll get back to you shortly after I confirm this.
No worries!
If the thread is archived by the time you follow up, you can ask the moderator to reopen it ๐
sure thing, I just need like 5-10 minutes to respond
ah cool
make sure to include current phase while updating the schedule while adding in a new phase
that's the question I have, what should I put in the current phase, just price?
won't it create a new subscription with that phase or just keep the existing one but only plan changes
so, something like this?:
await stripe.subscriptionSchedules.update(schedule.id, {
end_behavior: "release",
phases: [
{
start_date: subscription.current_period_start,
end_date: subscription.current_period_end,
proration_behavior: "none",
items: [
{
price: subscription.plan.id,
quantity: subscription.quantity,
},
],
},
{
start_date: subscription.current_period_end,
trial_end: subscription.current_period_end + 7889400, // 3 months approx
proration_behavior: "none",
items: [
{
price: subscription.plan.id,
quantity: subscription.quantity,
},
],
},
],
});
if I understand it correctly, it means that, it will keep the current subscription active till it's over and before starting a new cycle, it adds a trial period and then just continues with non-trial period
yup
hmm... let me think a bit about this
since this is an internal thing and not a really "trial period" (we don't let users know how we extend those free months) do I still have to be compliant with the notes on the page that if I'm using trial periods or coupons, I have to notify users about trial end date?
also, I have another question regarding to pausing/resuming subscriptions, should I start a new thread about it?
no need for a new thread no
And I don't think you have to do any warnings about trials in that case since you're right you're "abusing trials" just to pause the subscription
If it were me, I wouldn't use schedules, I'd just put them on a trial until their next payment date and pass proration_behavior: 'none'. It's annoying because it's not a real trial, and you lose the ability to do proper proration and stuff, but it's much easier
awesome. so that would be something like set trial period to current_subscription.current_period_end + N months, with proration set to none, is that correct?
the tricky part will be to revert it back to whatever it was before(?) or I can just remove the trial and set the subscription.backdate_start_date = trial.start_date
yeah it will work! And in theory you don't need to end the trial, it will just start again once the trial expires.
But if you want to "unpause" it's going to be ~impossible unfortunately ๐ฆ
Like there are so many edge-cases, I think you're approaching this a bit wrong business wise (though part of it are the limitations of our subscriptions API)
But if I pay for a year on January 1st and you give me 3 extra months in May, the next payment should be April 1st 2023 instead of Jan 1st 2023
And then in October you decide to "unpause", when do I pay? Jan 1st? April 1st? Right now in October?
You kind of need to model all of those edge-cases and grasp when the person is going to have to pay and how much
the whole point is to increase the billing_cycle_anchor to be set to whenever the trial ends
Yes but you just said "revert it back"
This is kinda a manual process where admins give users a free months of whatever, but if they make a mistake (i.e., picking a wrong date) they want to revert back to either original or pick a correct date.
yeah so reverting won't be possible without hacks
changing the trial end to a different date though is easy
yeah, well in that case, I got another question (and it might make things easier)
we don't really rely on the stripe's subscription status. we only listen when subscription invoices get paid. being said, maybe pausing a payment collection would be better pick here? although I'm not certainly sure.
otherwise, the subscription schedules will work for sure.