#Karan S
1 messages · Page 1 of 1 (latest)
Hi there!
Like the error message says, you can't directly cancel this subscription. You need to either:
- cancel the subscription schedule https://stripe.com/docs/api/subscription_schedules/cancel
- or release the schedule and then cancel the subscription https://stripe.com/docs/api/subscription_schedules/release
But why ,
Like I want to understand this,
I schedules a subscription on one specific date,
And when that date arrives default end_behaviour is release so at that time schedule will be release.
And subscription will be created
but at any point if payment fails will this go back to schedule ?
sub_1Lg5TnSDKDxgNBOJTjz3uFmY this is Id. Please check
This subscription is still managed by the schedule. If needed, you can release it from the schedule using this https://stripe.com/docs/api/subscription_schedules/release
Yes I got your point but when i created schedule its end_behaviour is release
so again need to release ?
Can you please explain me this ?
I think the subscription will be automatically released at the end of the current billing period.
Even after creation of subscription, it will always be managed by subscription_schedule ?
In every case ?
Do we have any documentation for this question ?
@high surge ?
if I have created a schedule , when will it gets released?
When scheduled date arrives ?
Please help
Sorry for the delay, Discord is a little busy. Please be patient. Having a look now.
ok
So it looks like you didn't specify an number of iterations or an end_date to your subscription schedule. So that just inherits the interval from the single line item, which is a month.
The subscription will be released at the end of the defined phase iterations. In this case, the end of the initial 1 month billing cycle.
So the subscription schedule will be release after first phase of subscription,
Let's say
If I schedule monthly subscription ,it will be released after 1 month and if its yearly schedule will gets released after 1 year ?
Yes I think so. You can test that yourself in test mode with Test Clocks: https://stripe.com/docs/billing/testing/test-clocks
Hi @high surge
But those iterations in subscription schedule are for actual subscriptions ?
And not for schedule ?
I'm not sure I understand your question. Can you rephrase?
ok
So what I want is, create a subscription from a future start date to end_date as forever until cancelled.
What I'm doing is creating a schedule with start date as future date when I want to start that subscription.
Payload I'm passing is
customer,
start_date: new Date(`${body.start_date}`) > new Date() ?
(new Date(body.start_date).getTime()) / 1000 :
Math.floor(new Date().getTime() / 1000), //converting to timestamp
phases: [
{
items: plans.data.map(x => ({ price: x.price })),
proration_behavior: 'none'
},
],
default_settings: {
default_payment_method: body.payment_method
}
};```
When this future date arrives, I try to cancel subscription after 2-3 days ,But it don't let me do that as schedule is attached to same.
Then you can cancel the associated schedule instead: https://stripe.com/docs/api/subscription_schedules/cancel
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That will also cancel the associated subscription
But I can't directly cancel the subscription ?
Like I'm not sure about this phases concept,
If I don't specify any iterations and pass items and create new subscription at scheduled date from schedule API. And release schedule subscription on webhook call ,then will this line items be attached to subscriptions OR just this schedule ?
Can I release schedule on subscription creation ?
But I can't directly cancel the subscription ?
Not without manually releasing the subscription first
If I don't specify any iterations and pass items and create new subscription at scheduled date from schedule API. And release schedule subscription on webhook call ,then will this line items be attached to subscriptions OR just this schedule ?
Can I release schedule on subscription creation ?
Can I release schedule on subscription creation ?
There's no parameter for that, no
Like manually on webhook
Yep: https://stripe.com/docs/api/subscription_schedules/release (please check the API reference)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
At the end of the initial billing period as @high surge stated earlier
ok