#pacesetter-session-line-items

1 messages ยท Page 1 of 1 (latest)

sleek seal
#

Hey there ๐Ÿ‘‹

#

Let me double check that

sharp pecan
#

thank you ๐Ÿ™‚

sleek seal
#

While I'm taking a look at our docs, do you happen to have the ID for the line item? I can look this up on our end to ensure I know exactly what field you're referring to.

sharp pecan
#

Yea, one sec, I'll get it...

#

li_1Jm1VA2WjLW3bHKMOGjKGeVA

#

within this object, one of the items is: "description": "TEST ART (Delete if you would like)",

#

This is actually the line item's "name" or I would call it the item Title

#

As an FYI - the description of the item reads: "LE Print by Test Artist 1, Size: 10"x10", PRICE INCLUDES SHIPPING, ALL SALES ARE FINAL"

#

(This is what I can't figure out how to drill down to)

sleek seal
#

Looks like you're only a couple more hops away. From that line item you can find the ID of the product. You can then retrieve the product object and check the description on that, which I'm pretty sure is what you're looking for.
https://stripe.com/docs/api/products/retrieve

sharp pecan
#

Sorry, just jumped off a call - thank you! checking this link out now...

pine sand
#

@sharp pecan you can also use the Expand feature for this https://stripe.com/docs/expand that lets you lists line items on a Session while expanding other properties too.

$session = $stripe->checkout->sessions->retrieve(
  'cs_test_123',
  [
    'expand' => ['line_items.data.price.product'],
  ]
);

cc @sleek seal for awareness

sharp pecan
#

awesome - I'll have to read up on that too! I'll report back how I do here with grabbing that product ID & description...

#

Worked like a charm!

tulip locust
#

@sharp pecan in the existing allLineItems call you have you could also expand there, but the path would be a little different using: data.price.product eg

sharp pecan
#

Thank so much for your help here, that was perfect

#

O

#

O

#

sorry

tulip locust
#

Either retrieve the session like @pine sand shared or using the line items like you had would work ๐Ÿ™‚

sharp pecan
#

I'm going to read more about the expand options after I'm done with this project. Looks interesting.

#

Thank you all again!

tulip locust
#

It's really handy to reduce your overall requests for some nested data, just be aware that it can make larger list requests slower ๐Ÿ‘