#steven-sub
1 messages ยท Page 1 of 1 (latest)
I think I might want to also set a Max number of days that it can be charged. After 14 days then it needs to Auto cancel. I can also do that with the Cron job but I think it would be better to set cancel at period end to true on that last day so it'll automatically do it. Will that work though?
Or is there a way to set number of cycles?
In this case, I suggest creating a subscription with the daily Price object's interval_count set to 3 [0], and setting cancel_at_period_end to true.
[0] https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data-recurring-interval_count
[1] https://stripe.com/docs/api/subscriptions/create#create_subscription-cancel_at_period_end
Interval count is "every x interval" are you saying I should adjust the price to (let's say they wanted 3 days) 3 days worth and do interval count of 3 with cancel at period end?
If you would like to create a 3 day subscription and cancel when the 3 days end, you can use the existing daily price object, then create a subscription with this interval_count=3 and cancel_at_period_end=true, this should do the trick ๐
Ok well I don't know if it will be 3. That could be different.
the interval count can change, as long as Price's interval is day, the number you provide in interval_count will give you a Subscription of 1 day x interval_count
e.g. if you set this interval_count to 14, it will give you a Subscription where the period last for 14 days
Hope this helps ๐