#daniell_74820
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- daniell_74820, 21 hours ago, 18 messages
- daniell_74820, 23 hours ago, 16 messages
- daniell_74820, 1 day ago, 3 messages
- daniell_74820, 1 day ago, 14 messages
- daniell_74820, 1 day ago, 17 messages
- daniell_74820, 1 day ago, 20 messages
Hi ๐ yes, you can listen to an Event type that provides you with the ID of the Checkout Session, like checkout.session.completed, and then use that ID to retrieve the line items for that Checkout Session and see what it included:
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.
is it also possible to pass custom data to strip checkout session?
Yes, via metadata
https://stripe.com/docs/api/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.
in this case: i have to make one mor request?
Yup
is there any cases to consider, when using metadata? or any example code?
Yup, sample code is in the API reference that I linked (I edited the message so that link wasn't there initially). Can you elaborate on what type of cases you're worried about?
in this link: checkout session is not listed?
Oh, sorry, the metadata field is available and behaves the same on most of our objects, you can use it the same way on Checkout Sessions as you see in the example.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-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.
If I understand it right, the id of stripe event data object can be used for retrieving checkout sessions line items?
No, the ID of the Checkout Session that is contained in the Event's data.object field (when listening for Event types that start with checkout.session.) can be used to retrieve the line items associated with that Checkout Session.
do you mean the id that I get in the webhook to retrieve line items?