#Velix-RetrieveCheckout

1 messages ยท Page 1 of 1 (latest)

sharp apex
#

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?

bronze moon
#

I'm adding each product by price_data.product_data with [name, description, metadata], unit_amount_decimal, currencty.

sharp apex
#

I just want to confirm where you're passing the metadata

bronze moon
#

I can see it here: prod_MJQHT8vnX5RYsK

sharp apex
#

price_data.product_data.metadata - you've mentioned this earlier

bronze moon
#

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? ๐Ÿ˜ฆ

sharp apex
#

I was unable to find that product.. not sure if there is a missed character from the end.

sharp apex
#

You could pass a metadata on the checkout session but it's not exactly what you're looking for

bronze moon
#

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?

sharp apex
#

line_items.data.price.metadata hash

bronze moon
#

yeah, this one is empty, that's my problem.

sharp apex
#

so you'd want the metadata on the price

bronze moon
#

I've set it and I can see it one the website.

#

Yeah, I did that.

sharp apex
#

not the product object

bronze moon
#

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.

sharp apex
bronze moon
#

ooosp, discord crashed ๐Ÿ˜„

sharp apex
#

Let me test this real quick

bronze moon
#

Interesting, are you on a beta or anything? I can't find the HTML anker you've linked.

sharp apex
#

So trying to reproduce what you're seeing here

bronze moon
#

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.

sharp apex
#

In the meantime, could you try expanding line_items.price_data.product_data ?

bronze moon
#

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

sharp apex
#

can you share these request ids with me?

bronze moon
#

session_id: cs_test_b1Cqd7eQmSgTaUtyQfZuBGX9f8msgHF8VLVfPu79rJak4PW1QWnjykcFuJ

#

line item: li_1LanRCGpmxOlaqx0NQKdkgtu

heavy orbit
#

๐Ÿ‘‹ stepping in here as pgskc needs to step away

#

catching up

bronze moon
#

priece object: price_1LanRCGpmxOlaqx0PsSoQet3

#

ok

heavy orbit
#

Can you summarize the issue? Seems you were having a past conversation about it with context before this thread?

bronze moon
#

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

heavy orbit
#

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.

bronze moon
#

how can I expand the product?

heavy orbit
#

expand: [line_items.data.price.product]

bronze moon
#

oh no ... sooo easy.

#

Thanks a lot ๐Ÿ™‚

#

Hey, but that's not in the docs, really not.

heavy orbit
#

It is in the docs

#

There is the EXPANDABLE tag next to that property

bronze moon
#

meh ๐Ÿ™‚ Thanks a lot