#doplex

1 messages · Page 1 of 1 (latest)

meager voidBOT
wary orbit
#

How are you adding metadata? What API call are you using to update the metadata?

normal shadow
#

Manually in dashboard. I have try to add it in product and prices and I try to retrieve this information in webhook "customer.subscription.created" (see screen for more details)

wary orbit
#

You are adding metadata after the Subscription is created, so any created events that you receive via webhooks are not going to have that metadata on them

normal shadow
#

Hm ok, I'm having trouble understanding, what is the metadata on the product page ? I saw that we could add metadata based on a context (session), but in my case they are filled out of context, so shouldn't I receive these metadata as default values ?

wary orbit
#

Ah, apologies. I think I misunderstood that page (I only speak english)

#

Just a minute

normal shadow
#

Yeah sorry I don't find where I can select current lang

wary orbit
#

It's all good. So, where are you looking for metadata right now? Which Event? And where in that event are you looking for metadata?

normal shadow
#

I want to retrieve it in customer.subscription.created or checkout.session.completed, but if I can get it in checkout it's better, I use the pricing table web component so I have per default a checkout session

#

I was thinking I could get it from LineItems in checkout object, but I get a empty array in it

wary orbit
#

Checkout sessions have a metadata attribute as well, if that helps. Otherwise, anytime you get an event that has that specific Product (e.g. a Subscription or a Checkout Session) you will need to make a separate API call to get its metadata, since this is not provided by default in the event payload

normal shadow
#

Ok I see, if it's the only way, we'll go on an api call
Thank for your help and your time, have a good day !