Can the /filters endpoint be used for dynamically fetching deals?

Hi, I plan on fetching deals this way via API:

  1. Create a filter with given criteria (via /filters endpoint)
  2. Get back the ID of the filter
  3. Get deals from this filter (via /deals endpoint)
  4. Delete the filter.

Is this a valid workflow? Asking in case there’s something inherently wrong with it (e.g. a created filter needs time-consuming indexing or something like that).

Hi @darekmmm

The workflow seems reasonable and you will get deals by filter. Also, there is no need to delete a filter if you will need it again.

Ok thanks, @mykhailo

If I don’t delete the filter, and send the same post request to /filters when code is restarted, it will create another filter with the same parameters though, right?

Correct. POST /filter will allow to create a filter with similar conditions.