Refine By

Description: Provides search refinement options to narrow down results.

API Response Structure:

{
  "refinements": {
    "categories": [
      {
        "name": "Category Name",
        "count": 150,
        "subcategories": [
          {
            "name": "Subcategory",
            "count": 50
          }
        ]
      }
    ],
    "filters": [
      {
        "type": "Price Range",
        "options": [
          {
            "label": "Under $50",
            "value": "0-50",
            "count": 100
          }
        ]
      }
    ],
    "sortOptions": [
      {
        "label": "Most Popular",
        "value": "popularity",
        "default": true
      }
    ]
  },
  "activeRefinements": [
    {
      "type": "Category",
      "value": "Electronics"
    }
  ],
  "type": "refineBy"
}

Fields:

  • refinements (object): Refinement options

    • categories (array): Category filters

    • filters (array): Additional filters

    • sortOptions (array): Sorting options

  • activeRefinements (array): Selected filters

  • type (string): Always "refineBy"