#chris_unexpected
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/1369604719223242773
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Used a Zap to retreive payment details
whzt do you mean by Zap?
we don't know anything about Zapier. do you have a specific question about Stripe?
yes, im pulling data using zapier from stripe
i use both payment id and charge id
but none of them contain details about the product in the payment
my question is what kind of ID do i use to extract product name from a specific payment?
it depends. what do you use to accept payments? Payment Link, Checkout Session, Payment Element, something else?
then the best option is to listen to the checkout.session.created webhook event, which contains a Checkout Session object. from there you can get the product bought by calling this endpoint: https://docs.stripe.com/api/checkout/sessions/line_items
or, using the PaymentIntent ID, you can retrive the associated Checkout Session with this endpoint: https://docs.stripe.com/api/checkout/sessions/list
PaymentIntent ID would look like pi_ and then numbers and letters, correct?
Like this for example
pi_3RLlt4KgmLsDZ13Z0zI7V2ui
yes
i am using the PaymentIntent ID but it doesnt return it to me
I will try with webhook and check the 2 links you sent me
i am using the PaymentIntent ID but it doesnt return it to me
what do you mean by this?
what have you tried exactly?
Let me show you with pictures
Here in the last screenshot where it says Data out it doesnt return the product name used in the payment
that's normal, you didn't follow what I suggested above.
using the PaymentIntent ID, you can retrive the associated Checkout Session with this endpoint: https://docs.stripe.com/api/checkout/sessions/list
the first step is to use the pi_xxx ID to retrive a Checkout Session object
no, with what I shared just above you don't need a webhook, just use the PaymentIntent ID to retrive the Checkout Session.
if not with a webhook, how do i attach it to the process?
As in later steps i will need the data from it
you original question was "with a pi_xxx, how do I see the corresponding products", right?
to answer that specific question, no webhooks are needed. just call https://docs.stripe.com/api/checkout/sessions/list with the pi_xxx you have, and you'll get back the Checkout Session object, and from there you'll be able to see the products
if your question is "how do I know that a payment was successful", then yes, you need to use webhooks and listen to checkout.session.completed