Skip to main content
Create a named criteria set to save frequently used product filter configurations. Once created, reference the criteria set by its ID in any product search request.

Endpoint

POST /v1/discovery/products/criteria-sets
Requires an x-api-key header for authentication.

Request Body

Accepts an AffiliateDiscoveryCriteriaSetInput object.
id
string
required
Unique identifier for the criteria set. Must match ^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$.
name
string
required
Human-readable name for the criteria set. Between 1 and 200 characters.
query
string
Optional free-text filter to include in all searches using this set.
exclude_query
string
Optional negative text filter. Excludes products matching this query.
criteria
object[]
Array of structured filter criteria objects, each with field, operator, and value.

Example Request

curl -X POST https://rewardsbot-prod.liquidrewardsapi.com/v1/discovery/products/criteria-sets \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "summer-sale",
    "name": "Summer Sale Items",
    "query": "summer",
    "exclude_query": "winter",
    "criteria": [
      { "field": "on_sale", "operator": "=", "value": true },
      { "field": "in_stock", "operator": "=", "value": true }
    ]
  }'

Response

Returns the created AffiliateDiscoveryCriteriaSet object with HTTP 201 Created.

Error Responses

StatusDescription
403 ForbiddenMissing or invalid API key.
409 ConflictA criteria set with this ID already exists.
422 Unprocessable EntityValidation error in the request body.
503 Service UnavailableCriteria set storage not configured.