#Torx
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
How do you get the Payment Intent ID from a Payment Link ?
Do you mean after a payment is completed? The best way would be with a webhook eventcheckout.session.completed
Or how do you refund a Payment Link with its ID ?
You call therefundendpoint with the PaymentIntent ID: https://stripe.com/docs/api/refunds/create
I create a payment link using the API to checkout the customer. I'm looking for a way to refund it using the refunds API endpoint, but it asks for a Payment Intent ID and the Payment Link API endpoint doesn't returns it
A PaymentIntent ID will be created only when a customer makes a payment. You can find the PaymentIntent ID directly in the dashboard, or listen to checkout.session.completed to get the ID as soon as the payment is done.
How can I retrieve one of these programmatically from the Payment Link ID ?
Oh, I see! You can use this: https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_link
This way you get all Checkout Session created by a given PaymentLink.
And the Checkout Session will contain the PaymentIntent ID.
Oh, great, I missed it, thanks !