#arrow
1 messages · Page 1 of 1 (latest)
You're listening for checkout.session.completed events, right?
yes
I don't get the name of the product in it. I checked multiple not only on my backend but also in the logs on the website dashboard
Perfect! All that data is on the line_items field which unfortunately is not included in webhook event payloads by default. You'll need to make an additional API call to retrieve them: 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.
cool and it takes session ID as parameter ?
Yep!
and also one more thing which I cannot figure out
where can I get the pricing-table-id ? in webhook ?
I have 3 price table on a single website each is used for selling differect service and I am not sure how to get the pricing table id ? is that possible or I have to create separate products for each table ?
Yeah we don't expose that ID anywhere in the API. Maybe you could utilise the client-reference-id param somehow: https://stripe.com/docs/no-code/pricing-table#handle-fulfillment-with-the-stripe-api
ahh ok cool
Also I was just reading though line item api call ... what is line item ? as it an array so I am not sure why we would have muliple line item of a session ?
It's an array yes, that's just the shape of the Checkout API which pricing table is built on. But in case of pricing table, it'll only ever contain a single item
cool thank you so much for the help