#Parthian

1 messages · Page 1 of 1 (latest)

regal flumeBOT
crimson pollen
#

So here, the metadata would be set on the product itself. Even when you are creating products inline like that, there is a product object created by Stripe. If you want to get this, you will likely need to retrieve your Checkout Session's line items and expand the product field on them.

#

Or you can put the metadata at a higher up level on the Checkout Session itself, in which case it will be included as part of that initial webhook event

meager nest
#

I've found Retrieve line-items on Postman. And through that I've realised that product: "prod_blahblah" isn't the same as List all Products - which only shows the 'fixed' products in https://dashboard.stripe.com/test/products?active=true. Which is why I could never see my dynamic products metadata. That's a great help. Magic.

meager nest
#

I don't think I can raise up to the higher metadata as there will be more than one line-item each needing it's own metadata. I've a feeling that none of the Events will transfer over the product directly. Maybe a series of API call from endpoint code?

still jay
#

@meager nest sorry for the confusion

#

the problem here is that you are putting the metadata on the Product itself and not the Session

#

If you put it on the Product, you have to get to that object to see the metadata. A Checkout Session has LineItems in line_items, each LineItem has a Price in price and each Price has a Product in product. It's like a long list of connections/hierarchy

meager nest
#

Found this - Using Expand with Webhooks

You can’t receive webhook events with properties auto-expanded. Objects sent in events are always in their minimal form. To access nested values in expandable properties, you must retrieve the object in a separate call within your webhook handler.

still jay
#

correct you need the extra API request