#mr_pablo-events
1 messages ยท Page 1 of 1 (latest)
Hi Tarzan
if you're using Checkout Sessions then you are in the right place
on the Checkout Session Object you could access the Price metadata like so https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-metadata
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 would be in the items of the subscription (the expandable property of the checkout session)
I'm looking at a checkout.session.completed event in Stripe, and it does not have any line items
could you please share the event id evt_xxx?
sure, it's evt_1LNHSELEsMFdv4uUZ0cjG6dz
got another here, evt_1LNZZgLEsMFdv4uU65ZHONbk
sorry about that, I just realized that the line_items is an expandable field and doesn't really show unless you specify it
which means that once you receive the event you'd have to retrieve the session https://stripe.com/docs/api/checkout/sessions/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and add the expand param for line_items
but you dont have to do that for a subscription, so why is a session different?
I need the line item data to be in the webhook. Whats the point of a webhook if you have to do a secondary look up for data?
I totally agree, and this has been raised internally as a pain point, and unfortunately today we don't have any work arounds
Also, your documentation for retrieving a session does not mention any parameters
most of our API have the ability to send an expand parameter
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.
ah, you linked the wrong thing thats all, its https://stripe.com/docs/api/checkout/sessions/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.
you can do both
either expand on the checkout session itself
or get the line items alone
I prefer the first approach since you also need to expand on subscription
so why not do that in one time
for both one-off and recurring payments
unless you have more than 10 line items you don't really need to use that API
but if you do since this is a paginated list you'd have to use that API to get the next page of line_items
I dont have to expadn the subscription though. The price item data is included n the webhook payload.
I've ended up using the "stripe.checkout.sessions.listLineItems()" method form the nodejs package
you could use that as well
We only have a single line item for one off purchases you see
both methods are valid
Any ETA on when line items might be added to the checkout session data by default?
no idea tbh
you can send a request on https://support.stripe.com/?contact=true and ask them to raise the feature request for you and to update you if/when they have any news
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
ok, ta
if you have any more questions you can ask them here
When viewing a webhook and the events that passed through, there is "All", "Succeeded" and "Failed". "All" is not showing all. It's showing old data. If I click "Succeeded" I can see todays data.
I'm not sure about this since it's more on the dashboard, you'd have to contact support
๐
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!