#yaman_55271

1 messages · Page 1 of 1 (latest)

glossy ploverBOT
wispy peak
#

hi! well the Subscription will eventually be created and you can add metadata then. For example listen to the customer.subscription.created webhook and check if the subscription object has the schedule field set to know that it was created by a certain Schedule.

urban swan
#

so you mean save the metadata in the schdule and when the subscription is created take that metadata and update the new subscription metadata

wispy peak
#

yes that's one way of doing it

urban swan
#

yes but I'm receiving the schedule as null always even when creating a subscription using a schedule

wispy peak
#

that's not correct then, you must be missing something

#

do you have an example you can show me where it was null?

urban swan
#

I created a schedule with the end behavior as release and it creates a subscription but the schedule is null

#

for example try creating a schedule for next month, after creating it make the start date today and make sure to track the webhook events, you will find that the schedule updated and schedule released events are triggerd and right after them a subscription created event is triggerd with a null value for schdule

wispy peak
#

can you share some example IDs of the objects where you tested that?

urban swan
#

sure

#

"sub_sched_1OjKV9AMVM1k0nlvgPZQoAd8"

#

"sub_1OjKVTAMVM1k0nlvNGKTVZ0F"

#

this is a schedule and a subscription id

#

two webhook events right after each other for a schdule being released and a subscription being created with a null schdule

wispy peak
#

but that subscription was not created by that schedule. You created it manually in the Dashboard.

#

it's not related to it at all, so it's normal schedule on it is null

#

sub_sched_1OjKV9AMVM1k0nlvgPZQoAd8 that one never created a Subscription. Its start date is 8pm UTC today, it hasn't happened yet.

urban swan
#

Then how it got released and how the other subsciption was created

#

I'm the only one using it and it created the subscription when I changed the date to today

wispy peak
urban swan
#

So changing the schedule for todays date cancels it

#

and creates a subscription

glossy ploverBOT
wispy peak
#

I don't know how the Dashboard UI does things sorry, we work with developers directly calling the API here

urban swan
#

yes even with api same thing