#punitgr_api
1 messages ยท Page 1 of 1 (latest)
๐ 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!
I'm using an old api of stripe
hi there!
how did you retrieve the Checkout Session object?
did you use expand to get the line_items property?
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
can you share the exact error you see?
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'"
what pogramming language is this?
Python
then you are not using expand properly. see examples here: https://docs.stripe.com/expand/use-cases?lang=python
Okay, that worked thanks
stripe.checkout.Session.retrieve(checkout.id, expand=["line_items"]) ๐
I was doing it wrong.
perfect!