#Mike.7189-checkout
1 messages ยท Page 1 of 1 (latest)
this is on the line_items property of the session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that prop isn't included in the response by default - the request needs to ask for it to be expanded: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
something like that?
const session = await stripe.checkout.sessions.retrieve(
req.query.session_id,
{ expand: ["line_items.object"] }
);
it's node.js with express
I think just "line_items"
it was {expand: ['line_items.data']}. Got the object now ๐ Thanks
ah nice!
StripeInvalidRequestError: This property cannot be expanded (line_items.object). You may want to try expanding 'line_items.data.object' instead.
Had this error, thankfully stripe gives nice errors and so I can figure out what's wrong ๐
That's it. Thanks for you Sunday time ๐
just "line_items" should work also, fwiw