#vilesa-metadata
1 messages ยท Page 1 of 1 (latest)
Hi vilesa, I'll take a quick look
req_CVHG38MQaeglx0 is basically a subscription
I know there's a common confusion about metadata
you need to know on what object you're setting the metadata
in your case you set the metadata on the subscription while listening to a payment_intent.succeeded event which returns a PaymentIntent
ok so conclusion: there's no way for me to get the metadata feeding into the pi_ ?
actually there is
but just give me a sec I'm retrieving the docs I wanted to share with you
actually there isn't an easy way of solving the issue
but you have 2 options basically
either listen to the invoice.paid event instead of payment_intent.succeeded as we suggest here: https://stripe.com/docs/billing/subscriptions/webhooks#tracking-active-subscriptions--tracking-
and then retrieve the Invoice expanding fields like subscription which gives you access to the metadata you stored
and by the way this is our recommendation
or you could use your payment_intent.charges.data[0].invoice to retrieve the invoice and expand on subscription
thanks, please leave the chat open, i'll come back shortly
No worries I'm here for any other questions you have
awesome thanks for the help ๐
did it work?
haven't tried yet, but i guess it will work ๐