#iainco
1 messages · Page 1 of 1 (latest)
👋 Hi there, Happy to help!
Yes, the schedule property reference the subscription_schedule attached to the subscription:
https://stripe.com/docs/api/subscriptions/object#subscription_object-schedule
So if no one is attached to the subscription then that property is null/unset
so when a subscription schedule is released the subscription->schedule property is set to null immediately?
Yes, you can test this in test mode.
great, thanks
one last question
$stripe->subscriptionSchedules->all(['customer' => 'cus_xxx']);
would this return schedules that have been previously released?
or all schedules regardless of status: not_started, active, completed, released, and canceled
That will return all schedules regardless of status. You can refer to this link for the filtering options:
https://stripe.com/docs/api/subscription_schedules/list#list_subscription_schedules-customer
Thank you
another question, sorry!
Am I right in thinking that if subscription->schedule is null, a new schedule can always be added to an existing subscription?
I'm sure I've run into the situation where I've tried to create a new schedule but an error occurred since a subscription schedule already existed for the subscription in question
Am I right in thinking that if subscription->schedule is null, a new schedule can always be added to an existing subscription?
Yes you can create a subscription_schedule from a subscription if none is attached to that subscription:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
ok, thank you I think I have everything I need now