It seems there’s no way to fetch all the discounts that were created by the app or associated with a specific function. It would be great if we can filter by these fields (at least app), so there’s a way to fetch only the discounts that we created.
Storing the IDs externally works too, but there’s the risk of getting out of sync.