> ## Documentation Index
> Fetch the complete documentation index at: https://help-plum.xoxoday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Filter API

> Retrieve available filters for the perks/offers catalog.

**Note:** This endpoint uses `plumProAPI.mutation.fetchFilters` (not `getFilters`) and accepts `categoryType` and `countryIds` fields not present in other categories.

**Real URL:** `POST https://stagingstores.xoxoday.com/chef/v1/oauth/api`


| Field            | Type   | Description                                                                           |
| ---------------- | ------ | ------------------------------------------------------------------------------------- |
| `categoryType`   | String | Defines the product category for which filters are requested.                         |
| `includeFilters` | String | Comma-separated list of filter keys that must be explicitly included in the response. |
| `excludeFilters` | String | Comma-separated list of filter keys that should be excluded from the response.        |
| `countryIds`     | Array  | List of country IDs used to scope filters based on regional availability.             |

## Response Schema

| Field Path                                         | Type   | Description                                                             |
| -------------------------------------------------- | ------ | ----------------------------------------------------------------------- |
| `data.fetchFilters.data.filters`                   | Array  | List of filter values applicable for the requested category and country |
| `data.fetchFilters.data.filters[].filter_value_id` | Number | Unique identifier of the filter value                                   |
| `data.fetchFilters.data.filters[].filter_value`    | String | Display name of the filter value                                        |
| `data.fetchFilters.data.filters[].image`           | String | Image URL associated with the filter value. Empty if not available      |
| `data.fetchFilters.data.filters[].filters`         | Array  | Nested filters under the filter value. Currently empty                  |
| `data.fetchFilters.data.filters[].categoryType`    | String | Category for which the filter applies (e.g. `offers`)                   |
| `data.fetchFilters.data.filters[].count`           | Number | Number of items available for this filter value                         |
| `data.fetchFilters.data.options`                   | Array  | Currently returned as an empty array for offers category                |
| `data.fetchFilters.data.brands`                    | Array  | Currently returned as an empty array for offers category                |
| `data.fetchFilters.data.countries`                 | Array  | Country-wise aggregation of available items                             |
| `data.fetchFilters.data.countries[].countryId`     | Number | Internal country identifier                                             |
| `data.fetchFilters.data.countries[].countryName`   | String | Name of the country                                                     |
| `data.fetchFilters.data.countries[].count`         | String | Total number of items available for the country                         |


## OpenAPI

````yaml specs/rewards-perks.yaml POST /fetchFilters
openapi: 3.0.3
info:
  title: Xoxoday Rewards API – Perks
  version: '1.2'
  description: >
    Perks API endpoints for browsing offers/perks catalog and filtering.


    Both operations dispatch to `POST /v1/oauth/api` on
    `stagingstores.xoxoday.com`.

    Virtual path suffixes are used for playground differentiation.


    **Notable differences from other Rewards API categories:**

    - Fetch Filters uses `plumProAPI.mutation.fetchFilters` (not `getFilters`)
      and accepts `categoryType` and `countryIds` (integer array)
    - Fetch Offers uses `categoryTypes` (plural string, not `categoryType`)

    - No balance, order, or payment report endpoints in this category
servers:
  - url: https://stagingstores.xoxoday.com/chef/v1/oauth/api
    description: Sandbox
  - url: https://accounts.xoxoday.com/chef/v1/oauth/api
    description: Production
  - url: https://canvas.xoxoday.com/chef/v1/oauth/api
    description: Testing
security:
  - BearerAuth: []
tags:
  - name: Catalog
paths:
  /fetchFilters:
    post:
      tags:
        - Catalog
      summary: Fetch Filter API
      description: >
        Retrieve available filters for the perks/offers catalog.


        **Note:** This endpoint uses `plumProAPI.mutation.fetchFilters` (not
        `getFilters`) and accepts `categoryType` and `countryIds` fields not
        present in other categories.


        **Real URL:** `POST https://stagingstores.xoxoday.com/chef/v1/oauth/api`
      operationId: perksGetFilters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - tag
                - variables
              properties:
                query:
                  type: string
                  enum:
                    - plumProAPI.mutation.fetchFilters
                  default: plumProAPI.mutation.fetchFilters
                tag:
                  type: string
                  enum:
                    - plumProAPI
                  default: plumProAPI
                variables:
                  type: object
                  required:
                    - data
                  properties:
                    data:
                      type: object
                      properties:
                        categoryType:
                          type: string
                          enum:
                            - offers
                          default: offers
                          description: Must be `"offers"` for the perks catalog.
                        includeFilters:
                          type: string
                          description: Filter IDs to explicitly include.
                          example: '5647'
                        excludeFilters:
                          type: string
                          description: Filter IDs to explicitly exclude.
                          example: '6444'
                        countryIds:
                          type: array
                          description: List of country IDs to scope filters by.
                          items:
                            type: integer
                          example:
                            - 976
            example:
              query: plumProAPI.mutation.fetchFilters
              tag: plumProAPI
              variables:
                data:
                  categoryType: offers
                  includeFilters: '5647'
                  excludeFilters: '6444'
                  countryIds:
                    - 976
      responses:
        '200':
          description: Filter list returned successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      fetchFilters:
                        type: object
                        properties:
                          status:
                            type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                filterGroupName:
                                  type: string
                                filterGroupDescription:
                                  type: string
                                filterGroupCode:
                                  type: string
                                filters:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      filterValue:
                                        type: string
                                      isoCode:
                                        type: string
                                      filterValueCode:
                                        type: string
              example:
                data:
                  fetchFilters:
                    status: 1
                    data:
                      - filterGroupName: Category
                        filterGroupDescription: Filter by offer category
                        filterGroupCode: voucher_category
                        filters:
                          - filterValue: Food & Restaurant
                            isoCode: FR
                            filterValueCode: food_restaurant
        '401':
          $ref: '#/components/responses/Unauthorized'
        '502':
          $ref: '#/components/responses/BadGateway'
components:
  responses:
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Unauthorized
    BadGateway:
      description: Upstream service error.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <access_token>`'

````