#punitgr_api

1 messages ยท Page 1 of 1 (latest)

hallow echoBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212015837993508915

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

faint garden
#

I'm using an old api of stripe

meager socketBOT
runic owl
#

hi there!

#

how did you retrieve the Checkout Session object?

#

did you use expand to get the line_items property?

faint garden
#

I also tried, stripe.checkout.Session.retrieve(checkout_id, {"expand": "line_items"})

#

that gives error for api key

#

if provided the api key

#

in 2nd param, the 3rd one is not accepted.

#

How can I fetch the line_items?

#

It works via cli

runic owl
#

can you share the exact error you see?

faint garden
#

Sure 1 sec

#

Error when I do this: stripe.checkout.Session.retrieve(checkout.id, {"expand": ["line_items"]})

{"IP": "127.0.0.1", "log": "error_code=None error_message=\"Invalid API Key provided: {'expand*************s']}\" error_param=None error_type=invalid_request_error message='Stripe API error received'", "method": "POST", "msg": "unstructured log", "path": "/payments/stripe-webhook/", "request_id": "ca4bd57c-5fc7-44aa-83f3-a10540129701", "username": "None"}
#

And when I try: stripe.checkout.Session.list_line_items(checkout.id)

I see this:
bundle_data = stripe.checkout.Session.list_line_items(checkout.id)\nAttributeError: type object 'Session' has no attribute 'list_line_items'"

runic owl
#

what pogramming language is this?

faint garden
#

Python

runic owl
faint garden
#

Okay, that worked thanks

#

stripe.checkout.Session.retrieve(checkout.id, expand=["line_items"]) ๐Ÿ™‚

#

I was doing it wrong.

runic owl
#

perfect!