#-reduce-_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1331167880380813352
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Do you have examples of the charge objects?
Yes Do You want concrete Id of charge?
Yes please
okay one sec
here is PaymentIntent obj
pi_3QfHczJZ9pJk48QC16MCrpKg
sec i will provide charge
or PI is enough?
because I took pi from charge
latest_charge
py_3QfHczJZ9pJk48QC10em4Scl
Does this payment come with the line items you mentioned?
no it does not
and thats the problem because I cant see what it was paid for :/
If there is an invoice in charge -> payment_intent object i can take item.invoice.lines.data and check its price.product or item description
in this case I dont have any data that I can recognize product
Can I have the other payment intent where you have line items?
pi_3ODNF6JZ9pJk48QC1jOTeVPu
Thanks for waiting!
The first payment intent: pi_3QfHczJZ9pJk48QC16MCrpKg was created via a Checkout Session. The best way to get the line item is to expand the Checkout Session's line item: https://docs.stripe.com/api/checkout/sessions/object?lang=python#checkout_session_object-line_items
To make it more generalised you can always create an Invoice for your checkout sessions so you can retrieve the line items the same way as you other payment object: https://docs.stripe.com/api/checkout/sessions/create?create_checkout_session-invoice_creation=#create_checkout_session-invoice_creation-invoice_data
Hmm so should i retrieve checkout session from this payment intent where i dont have invoice?
and there will be line items?
If you are using Checkout Session to create a payment then yes you will need to retrieve the line items for the Checkout Session via this: The first payment intent: pi_3QfHczJZ9pJk48QC16MCrpKg was created via a Checkout Session. The best way to get the line item is to expand the Checkout Session's line item: https://docs.stripe.com/api/checkout/sessions/object?lang=python#checkout_session_object-line_items
okay can I retreive checkout session id by payment intent somehow?
You can list all the checkout sessions related to a Payment Intent: https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.