#kanonhian-subscription-cancel
1 messages · Page 1 of 1 (latest)
hi
I mean current_period_ends is, for exmple 2022-31-12
but user wants to cancel subscription at 2022-01-12
this is manager user in paltform, not customer
Are you just looking for cancel_at on the Subscription? When you update a Subscription you can set cancel_at to any timestamp in the future to have the Subscription automatically cancel at that timestamp
already tried
only scheduler can do this
the subscription was previously created
Is there a reason you HAVE to use schedules? You should be able to do this with just the Subscription, unless you have a specific use case that requires you to use schedules
Like what did you try previously that didn't work?
Indeed. Basically an authorized user in platform can manage all customer subscriptions so far, and he can :
1 cancel subcription now
2 cancel it at period end
3 cancel it whenever he wants within current period
1 and 2 are not problem. Thing is with 3, since scheduler does not allow me to update the start_date prop
Again, you should be able to do that with a simple subscription - there's no reason you have to use schedules unless you need to
Have you tried this out in test mode yet?
yes
Can you share a request ID so I can take a look?
yes
this is what happens when I try to do so
Stripe\Error\InvalidRequest : The subscription is managed by the subscription schedule sub_sched_1LmMzrGGCGfoPLShY8ASHBCf, and updating any cancelation behavior directly is not allowed. Please update the schedule instead.
oh maybe since I attached an scheduler it doesn't allow me
Yeah - if you don't need the Schedule then you don't need to add it and then you can update the subscription directly
You can release it (https://stripe.com/docs/api/subscription_schedules/release) if you want to release the subscription from the schedule