#baby561
1 messages ยท Page 1 of 1 (latest)
Hi there
So when you receive your checkout.session.completed event you want to retrieve the Session and expand line_items: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
That will give you information on the Product
thank u,
i am checking now
so i think i see the session think you mention.
i think i am printing it.
I am not sure how to expand that though.
based on screenshot 1 , is the id cs_test_a1tAYw9PbqCr4OfzzZ0a81KkPmAuoHWymT21iBG3AfCsm2mUmXQjfx7KrH?
and looking at screenshot 2, is that how i would expand it to the product id?
Hi there ๐ jumping in as my teammate needed to step away. That's corect, Checkout Session IDs will have a cs_test_ prefix in test mode, and a cs_live_ prefix in live mode.
You're also correct about needing to leverage expand here. You will need to use that parameter to pass in the field that you want to expand in the response, which in this case will be line_items. I don't think you will need to also expand prices inside of line_items, but let me know if you're still unable to get to the Product ID and we can talk through that:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is that toby from rick and morty lmao. lit.
ok looking into this now, thanks!
Hehe, toby is me, but I couldn't pass up having Mr. Meeseeks be my avatar here.