#jcalentine

1 messages · Page 1 of 1 (latest)

lilac pebbleBOT
cursive scarab
#

I look at the documentation and it says by default the description in line items is the product name and I need to use this inside my webhook for a conditional update to the database based on the product name

wary aurora
#

Not quite - I believe stripe.checkout.Session.list_line_items will give you back an array, so you'd need to iterate over each item in the array and get the desscription of each

cursive scarab
#

do you think there is a more efficient way to do so?

#

I mean I know price has a nickname field too. Or is there a way I can just get the product_name easier

#

i mean I guess it does not matter because I only have a few products at this point (early stages)

wary aurora
#

It really depends on what you need - if you only ever want to get the description of the first line item in your checkout session you can do somethign like this: stripe.checkout.Session.list_line_items(session_id, limit=1).data[0].description

#

But if you want the description of each line item you have no choice but to iterate through