How to track when a payment is done using a payment link in stripe

I have created a payment link object with custom metadata, which includes the product ID:

      Metadata = new Dictionary<string, string> { { "product_id", productID } },

When a payment is successfully made, I want to filter the payment intents that have a status of ‘succeeded’ and retrieve the product ID associated with those payment intents. However, when the payment is completed, the payment link object does not pass the metadata into the payment intent. Therefore, I am unable to track whether a payment has been successfully made through a particular payment link or not. Additionally, there is no payment link ID in the payment intent where I can track the payments.

If anyone has any ideas on how to accomplish this, please let me know. (Please provide step-by-step instructions)

This is how I set it up:

New scenario - Stripe - Watch Events - Checkout Session completed successful - Run Once

Now, go to Stripe and create a new payment link with a new product costing 0. “Pay” through this link.

Go back to Make.com and see if it has the output from the checkout session, you can track the link through the payment link id, usually it’s something like plink……

So, from here you can set up a filter, for example payment link and text equal to (your payment link id)

Voila!

Hope it helps