Can I obtain the payment_id during checkout?

I am planning to use the Refund Payments API to process refunds for payments made through the URL generated by the “Create Payment Link” on Checkout. In this case, I believe I need to uniquely identify the payment using the payment_id . How can I obtain the payment_id at the time of payment?

You can listen for payment webhooks to be notified when a link generated from CreatePaymentLink is paid for. Once the link is paid for it will trigger an event that will have the payment_id in it. :slightly_smiling_face:

thanks.

Is there a way to obtain the payment_id other than through payment webhooks?

With payment links the payment_id isn’t created till a successful payment has been successfully. With that the only ways to get the payment_id is to either listen to webhook events, poll the Orders API for the Checkout order_id and wait for it to update with a payment_id, or poll the Payments API till a payment with that order_id is returned. :slightly_smiling_face: