#hassamsaeed-trialing
1 messages · Page 1 of 1 (latest)
Hey there!
Can you elaborate on your Q please?
You can see a trial value on a Price object, but that's to work with subscriptions directly
Yes i see a trial on both Price and Subscription
Lets suppose i created a plan with the trial period of 30 days and subscribe it but if i need to change trial days from 30 to 7 days. Is it possible? If yes then how?
On the resulting subscription?
you'd update the trial_end parameter on the Subscription object: https://stripe.com/docs/api/subscriptions/update#update_subscription-trial_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes on the resulting subcription. So you are saying if i subscribe to ABC plan with default trial of 30 days but i can change it to any value by simple updating the trial of a subscription. It will only effect to a particular subscription. Right?
Yep, that's right
Generally we don't recommend inheriting trial periods from Price/Plan objects, and instead set the trial period when creating the subscription
But i need a plan which has a default 30 days trial but i need to change it for specific subscription but not for all. So what is the good approach?
So i create price which has 30 days trial period but when i create subscription i can change trial days
If you want to inherit the trial period from the Price/Plan, you need to pass trial_from_plan when creating the sub: https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_from_plan
So in the case of the subscription where you want a shorter trial, you'd omit that parameter and instead just use trial_period_days: 7: https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks
np!
In the case of update which parameter i need to pass in update subscription method?
What do you need to update?
You'd set those parameters when creating the subscription. Shouldn't be necessary to update if you're doing it correctly
I think we have some misunderstading
Let me take an example again if you dont mind
I create a price ABC which has 30 days trial. Now i create a subscription by choosing price ABC. By choosing ABC my subscription also has 30 days trial.
After creating a subscription i want to change subscription trial from 30 days to 40 days. Now what should i do?
Hope it makes sense for you
What's the reason for extending the trial?
Is that not something that you would prefer to do instead when creating the subscription?
Yes, but after subscription creation if a customer wants a trial more than 30 days then?
Ok, then as per my original answer you'd call the update endpoint
My other answer was if you wanted to offer a different trial period to the default from creation
np!