GuidesInventoryGet Filter Values

How to get filter values for a product

Function getFilterValues

The filter values endpoint returns the available colors, sizes, and other attributes you can use to filter inventory queries. This is useful for building dynamic filter UIs or validating filter parameters before querying inventory.

HTTP VERB: GET

URL: https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/inventory/filter-values/{PRODUCT_ID}/

Query Parameters

ParameterTypeRequiredDescription
product_id_typestringNoType of product ID being used
environmentstringNoEnvironment: PROD or STAGING (default: PROD)

Example Request

curl -X GET "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/filter-values/55414/" \
  -H "X-API-Key: your-api-key"

Example Response

This is the response from calling with: SUPPLIER_CODE = HIT PRODUCT_ID = 55414

{
    "FilterValues": {
        "productId": "55414",
        "Filter": [
            {
                "filterType": "COLOR",
                "filterValue": [
                    "WHITE",
                    "BLACK",
                    "RED",
                    "NAVY BLUE",
                    "SILVER",
                    "TEAL"
                ]
            },
            {
                "filterType": "SIZE",
                "filterValue": [
                    "14OZ"
                ]
            }
        ]
    },
    "ServiceMessageArray": null
}

Response Structure

FieldDescription
productIdProduct identifier
FilterArray of filter types and their available values
filterTypeType of filter (e.g., COLOR, SIZE)
filterValueArray of available values for this filter type

Common Filter Types

TypeDescription
COLORAvailable colors for the product
SIZEAvailable sizes (for apparel, drinkware, etc.)
LABEL_SIZELabel size designations

Typical Workflow

  1. Call this endpoint to get available filter values
  2. Build a filter UI based on the response
  3. Use selected filters when calling Get Inventory Levels
# Example: Build filters and query inventory
import requests
 
# Step 1: Get filter values
filter_response = requests.get(
    "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/filter-values/55414/",
    headers={"X-API-Key": "your-api-key"}
)
filters = filter_response.json()["FilterValues"]["Filter"]
 
# Step 2: User selects "WHITE" color
selected_color = "WHITE"
 
# Step 3: Query inventory with filter
inventory_response = requests.get(
    "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/55414/",
    params={"color": selected_color},
    headers={"X-API-Key": "your-api-key"}
)

Use Cases

  • Dynamic filter UIs: Build dropdown menus based on available options
  • Validation: Ensure filter values are valid before querying
  • Product displays: Show available colors/sizes to customers