#d_j_p_3

1 messages ยท Page 1 of 1 (latest)

slow crestBOT
young summit
#

Hello

hollow crystal
#

hi

young summit
#

That property isn't returned by default

#

You need to retrieve the Checkout Session and expand line_items to receive it

hollow crystal
#

okay let me take a look.

#

Okay thanks... This is what I ended up needing in python:
foo = stripe.checkout.Session.list_line_items(session_id)

young summit
#

๐Ÿ‘

#

That works

#

Or you can just retrieve the Session and expand

#

Either way is fine

hollow crystal
#

ahhh... I see. Are those aliases for the same operation or is one more efficient or something?

#

stripe.checkout.Session.retrieve(
'{{SESSION_ID}}',
expand=["customer"],
)
vs
stripe.checkout.Session.list_line_items(session_id)

young summit
#

One only gives you the line items

#

One gives you the whole Checkout Session object and the line items

#

So it just depends on what data you are looking for really

hollow crystal
#

I see, but both require an API call right?

young summit
#

Yes

#

Webhooks never return properties already expanded

hollow crystal
#

great. so I'll just grab the line-items since the basic checkout session is the payload of the webhook

young summit
#

Yep that works here just fine

hollow crystal
#

๐Ÿ™