#kirito
1 messages · Page 1 of 1 (latest)
Hello 👋
You can retrieve the subscription and expand schedule parameter on it
https://stripe.com/docs/api/subscriptions/object#subscription_object-schedule
If its null then there's no schedule attached. If its not null then you should see the schedule object on that property
I understand I have another question, I'm updating subscription schedule using this as params {
phases: [ { items: subscription.items, start_date: subscriptionSchedule.phases[0].start_date, iterations: 12, metadata: subscription.metadata, }, { items: subscription.items, iterations: 12, metadata: subscription.metadata, }, ], })
could I take the common params between phases outside the phases item?
it will be like ? ```
{
metadata: subscription.metadata,
items: subscription.items,
phases: [
{
start_date: subscriptionSchedule.phases[0].start_date,
iterations: 12,
},
{
iterations: 12,
},
],
})
}```
would this give the same result?
~~I don't think metadata is supported parameters on an update call
https://stripe.com/docs/api/subscription_schedules/update~~
nvm metadata is, items isn't.
You'd likely need to do this phase by phase
I understand thank you
Also is it necessary to creat the schedule then update it, cant I create directly those phases to it when creating it using from_subscription?
Ah, good question! The API currently doesn't support defining phases when creating a schedule using from_subscription . So it has to be separate API calls
I understand would creating one directly with from subscription also create a subscription?
No, that parameter is only for existing subscriptions
You can start a subscription with SubscriptionSchedules themselves
https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing
https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#start-subscription-future