#Velix-RetrieveCheckout
1 messages ยท Page 1 of 1 (latest)
Let me try to test it on my end
You're just trying to confirm if the metadata would show when you retrieve a checkout right?
Do you have any request ids that you can share here?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I'm adding each product by price_data.product_data with [name, description, metadata], unit_amount_decimal, currencty.
I just want to confirm where you're passing the metadata
I can see it here: prod_MJQHT8vnX5RYsK
price_data.product_data.metadata - you've mentioned this earlier
for me, that was the only way to give metadata to a line_item.
Is there another way to give metadata to a specific line item?
I guess I need to parse all the products instead of line_items? ๐ฆ
I was unable to find that product.. not sure if there is a missed character from the end.
From looking at our doc., https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items the line_items does not have the metadata
You could pass a metadata on the checkout session but it's not exactly what you're looking for
The problem is, we have highly dynamic prices. And it's hard to identify, which line item belongs to which product.
Or is the order always the same?
Is the first line item from the session object always the first one? and the second is always the second?
yeah, this one is empty, that's my problem.
so you'd want the metadata on the price
not the product object
Can you share the request id for your price creation: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I'm not creating prices. I'm creating a checkout session
price_data itself doesn't have metadata, price_data.product_data only has metadata.
On the Checkout creation when you pass the line_item details are you passing the metadata here, https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-metadata?
ooosp, discord crashed ๐
Let me test this real quick
Interesting, are you on a beta or anything? I can't find the HTML anker you've linked.
No, it's all public. Hand tight.. I also see this, https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-product_data-metadata
So trying to reproduce what you're seeing here
Yeah, that's what I was using. But it appears on the website and on the product automatically created only. Not in the line items
But my docs don't have metadata on price_data.
In the meantime, could you try expanding line_items.price_data.product_data ?
1 sec
essage' => 'This property cannot be expanded (line_items.price_data). You may want to try expanding 'line_items.data.price_data' instead.'
trying...
"metadata": [], <-- empty again
can you share these request ids with me?
session_id: cs_test_b1Cqd7eQmSgTaUtyQfZuBGX9f8msgHF8VLVfPu79rJak4PW1QWnjykcFuJ
line item: li_1LanRCGpmxOlaqx0NQKdkgtu
Can you summarize the issue? Seems you were having a past conversation about it with context before this thread?
I need to attach meta-data to a line-item. Since that's not possible, I tried to do it via price_data.product_data.metadata. This information is shown on stripe's website, but not via Session.Retrieve() with expand line_items
here "metadata": [], is always empty
You are looking to access the metadata set on the Price or on the Product?
With the Product you need to expand it as well.
how can I expand the product?
expand: [line_items.data.price.product]
oh no ... sooo easy.
Thanks a lot ๐
Hey, but that's not in the docs, really not.
meh ๐ Thanks a lot