#stasiekz-subscription
1 messages · Page 1 of 1 (latest)
Hi! That's accurate: the metadata on the subscription schedule stays on the subscription schedule and is not visible on the subscription itself.
However subscription created with a subscription schedule have a schedule property that contains the subscription schedule and should contain the metadata. https://stripe.com/docs/api/subscriptions/object#subscription_object-schedule
Thank you for quick reply, it is true but it seems to be an id (a string) not an object. But having an ID I can request for the object in a separate API call. Seems like it's the easiest way to capture that info, right?
but it seems to be an id (a string) not an object.
That's correct! So you should either make a new API call to retreive the subscription schedule with its ID, or use expand as explained here: https://stripe.com/docs/expand
And if you really want to have the metadata directly on the subscription itself, you could listen to the event customer.subscription.created, retrieve the metadata as explained above, and then update the subscription with the new metadata.
Ok, it looks like expand is not available in webhooks so I would need to do a separate call anyway, That answers my question , thank you.