Discount Filtering based on Title

I want to return discounts based on title given as an input from the user. That is for example if a user input “flat” then it should return all the discounts having “flat” in their titles (eg. FLAT50OFF,FLAT100). So is their any way I can implement this using REST or GraphQL admin APIs. I have seen a query like this requirement for products:

products(first: 10, query: "title:*searched_text*")

So is there anything like this for discounts.

Hi @sandeepks23

I don’t know if I am missing something here but why are you looking for discounts on the products API?

I think the appropriate API would be the discounts and marketing (Admin API) and you can query for something like discountNodes with the filters as specified here

Hope this helps