{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-product-search-result-schema.json",
  "title": "ProductSearchResult",
  "description": "Document representing a product search result.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-shopper-search-api-openapi.yml#/components/schemas/ProductSearchResult",
  "allOf": [
    {
      "$ref": "#/$defs/PaginatedResultBase"
    }
  ],
  "properties": {
    "hits": {
      "description": "A sorted array of search hits (`ProductSearchHit` objects). The array can be empty.",
      "type": "array",
      "minLength": 1,
      "items": {
        "$ref": "#/$defs/ProductSearchHit"
      }
    },
    "pageMetaTags": {
      "description": "Page Meta tags associated with the search result.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/PageMetaTag"
      }
    },
    "query": {
      "description": "The query string that was searched for.",
      "type": "string",
      "maxLength": 50
    },
    "searchMode": {
      "description": "The search matching approach the client requested for this search, echoed back from the `searchMode` query parameter. Omitted when the request did not supply one. This is the requested hint, not necessarily the mode that served the result — see `effectiveSearchMode`.",
      "allOf": [
        {
          "$ref": "#/$defs/SearchMode"
        }
      ]
    },
    "effectiveSearchMode": {
      "description": "The search matching approach the platform actually used to serve this result. May differ from the requested `searchMode` when the platform demoted the mode (for example when the semantic index is unavailable).",
      "allOf": [
        {
          "$ref": "#/$defs/SearchMode"
        }
      ]
    },
    "processedQuery": {
      "description": "The result of query processing.",
      "allOf": [
        {
          "$ref": "#/$defs/ProcessedQuery"
        }
      ]
    },
    "refinements": {
      "description": "The sorted array of search refinements. This array can be empty.",
      "type": "array",
      "minLength": 1,
      "items": {
        "$ref": "#/$defs/ProductSearchRefinement"
      }
    },
    "searchPhraseSuggestions": {
      "description": "The suggestion given by the system for the submitted search phrase.",
      "minLength": 1,
      "allOf": [
        {
          "$ref": "#/$defs/Suggestion"
        }
      ]
    },
    "selectedRefinements": {
      "description": "A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.",
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 4000
      }
    },
    "selectedSortingOption": {
      "description": "The ID of the applied sorting option.",
      "type": "string",
      "maxLength": 4000
    },
    "sortingOptions": {
      "description": "The sorted array of search sorting options. This array can be empty.",
      "type": "array",
      "minLength": 1,
      "items": {
        "$ref": "#/$defs/ProductSearchSortingOption"
      }
    }
  },
  "required": [
    "limit",
    "hits",
    "query",
    "refinements",
    "searchPhraseSuggestions",
    "sortingOptions",
    "offset",
    "total"
  ],
  "type": "object",
  "$defs": {
    "AppliedProcessor": {
      "description": "The result of a processor execution.",
      "type": "object",
      "properties": {
        "processorName": {
          "description": "The name of the processor.",
          "type": "string",
          "maxLength": 256
        },
        "result": {
          "$ref": "#/$defs/query"
        },
        "refinements": {
          "description": "The refinements that were applied to the query.",
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "maxLength": 256
          }
        }
      }
    },
    "CurrencyCode": {
      "description": "A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.",
      "pattern": "^([A-Z][A-Z][A-Z]|N/A)$",
      "type": "string"
    },
    "Image": {
      "properties": {
        "alt": {
          "type": "string",
          "maxLength": 4000
        },
        "disBaseLink": {
          "type": "string",
          "maxLength": 4000
        },
        "link": {
          "minLength": 1,
          "type": "string",
          "maxLength": 4000
        },
        "title": {
          "type": "string",
          "maxLength": 4000
        }
      },
      "required": [
        "link"
      ],
      "type": "object"
    },
    "ImageGroup": {
      "description": "Document representing an image group containing a list of images for a particular view type and an optional variation value.",
      "properties": {
        "images": {
          "description": "The images of the image group.",
          "type": "array",
          "minLength": 1,
          "items": {
            "$ref": "#/$defs/Image"
          }
        },
        "variationAttributes": {
          "description": "Returns a list of variation attributes applying to this image group.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/VariationAttribute"
          }
        },
        "viewType": {
          "description": "The image view type.",
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "images",
        "viewType"
      ],
      "type": "object"
    },
    "Offset": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The zero-based index of the first hit/data to include in the result.",
      "type": "integer"
    },
    "PageMetaTag": {
      "description": "Document representing a Page Meta Tag object.",
      "type": "object",
      "properties": {
        "id": {
          "description": "The ID of the Page Meta Tag.",
          "type": "string",
          "maxLength": 100
        },
        "value": {
          "description": "Locale-specific value of the Page Meta Tag, evaluated by resolving the rule set for the given Business Manager ID.",
          "type": "string"
        },
        "type": {
          "description": "The kind of Page Meta Tag, indicating how the storefront should render the value.\nDocumented values are `name`, `property`, `title`, and `jsonld`:\n  * `name` — render as `<meta name=\"...\">`.\n  * `property` — render as `<meta property=\"...\">` (e.g. Open Graph tags).\n  * `title` — render as the HTML `<title>` element.\n  * `jsonld` — JSON-LD structured data, intended for rendering inside `<script type=\"application/ld+json\">`.\nThe field may be absent when the kind cannot be determined. Clients should treat unknown values as opaque so additional kinds can be introduced without breaking the contract.",
          "type": "string",
          "maxLength": 64
        }
      }
    },
    "PaginatedResultBase": {
      "description": "Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. \nIf you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/ResultBase"
        }
      ],
      "properties": {
        "offset": {
          "$ref": "#/$defs/Offset"
        }
      },
      "required": [
        "limit",
        "offset",
        "total"
      ]
    },
    "PriceRange": {
      "description": "Document representing price ranges for a product which happens to be a master product (per Pricebook)",
      "properties": {
        "maxPrice": {
          "format": "double",
          "description": "Maximum price for the given pricebook (usually for a master Product would be the price for the Variant which has the highest price out of all Variants in that pricebook)",
          "type": "number"
        },
        "minPrice": {
          "format": "double",
          "description": "Minimum price for the given pricebook (usually for a master Product would be the price for the Variant which has the least price out of all Variants in that pricebook)",
          "type": "number"
        },
        "pricebook": {
          "description": "The active pricebook from which the min and the max prices are calculated. The pricebook is based on the site context of the request as defined in ECOM.",
          "type": "string",
          "maxLength": 256
        }
      },
      "type": "object"
    },
    "ProcessedQuery": {
      "description": "The result of query processing.",
      "type": "object",
      "properties": {
        "query": {
          "$ref": "#/$defs/query"
        },
        "appliedProcessors": {
          "description": "The processors that were executed for the search query and their results.",
          "type": "array",
          "maxItems": 5,
          "items": {
            "$ref": "#/$defs/AppliedProcessor"
          }
        }
      }
    },
    "ProductPriceTable": {
      "description": "Tiered Price Level Object",
      "properties": {
        "price": {
          "format": "double",
          "description": "Price for the product for the specified tier for the specified pricebook",
          "type": "number"
        },
        "pricebook": {
          "description": "The active pricebook for which this price is defined",
          "type": "string",
          "maxLength": 256
        },
        "quantity": {
          "format": "double",
          "description": "Quantity tier for which the price is defined.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "ProductPromotion": {
      "description": "Document representing a product promotion.",
      "properties": {
        "calloutMsg": {
          "description": "The localized call-out message of the promotion.",
          "minLength": 1,
          "type": "string",
          "maxLength": 4000
        },
        "promotionId": {
          "description": "The unique ID of the promotion.",
          "type": "string",
          "minLength": 1,
          "maxLength": 260
        },
        "promotionalPrice": {
          "format": "double",
          "description": "The promotional price for this product.",
          "type": "number",
          "minLength": 1
        }
      },
      "required": [
        "calloutMsg",
        "promotionId",
        "promotionalPrice"
      ],
      "type": "object"
    },
    "ProductRef": {
      "description": "Document representing a product reference.",
      "properties": {
        "id": {
          "description": "The ID of the product reference.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "ProductSearchHit": {
      "description": "Document representing a product search hit.",
      "properties": {
        "currency": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "hitType": {
          "description": "The type information for the search hit.",
          "type": "string",
          "maxLength": 256
        },
        "image": {
          "description": "The first image of the product hit for the configured viewtype.",
          "allOf": [
            {
              "$ref": "#/$defs/Image"
            }
          ]
        },
        "orderable": {
          "description": "A flag indicating whether the product is orderable.",
          "type": "boolean"
        },
        "price": {
          "format": "double",
          "description": "The sales price of the product. In complex products, like master or set, this is the minimum price of\n related child products.",
          "type": "number"
        },
        "priceMax": {
          "format": "double",
          "description": "The maximum sales of related child products in complex products like master or set.",
          "type": "number"
        },
        "productId": {
          "description": "The ID (SKU) of the product.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "productName": {
          "description": "The localized name of the product.",
          "type": "string",
          "maxLength": 4000
        },
        "productType": {
          "description": "The type information for the product.",
          "allOf": [
            {
              "$ref": "#/$defs/ProductType"
            }
          ]
        },
        "representedProduct": {
          "description": "The first represented product.",
          "allOf": [
            {
              "$ref": "#/$defs/ProductRef"
            }
          ]
        },
        "representedProducts": {
          "description": "All the represented products.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductRef"
          }
        },
        "variationAttributes": {
          "description": "The array of represented variation attributes, for the master product only. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/VariationAttribute"
          }
        },
        "imageGroups": {
          "description": "The array of product image groups.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageGroup"
          }
        },
        "priceRanges": {
          "description": "Array of one or more price range objects representing one or more Pricebooks in context for the site.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceRange"
          }
        },
        "productPromotions": {
          "description": "The array of active customer product promotions for this product. This array can be empty.\n Coupon promotions are not returned in this array.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductPromotion"
          }
        },
        "tieredPrices": {
          "description": "The document represents list of tiered prices if the product is a variant",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductPriceTable"
          }
        },
        "variants": {
          "description": "The array of actual variants. Only for master, variation group, and variant types. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Variant"
          }
        },
        "variationGroups": {
          "description": "The array of actual variation groups. Only for master, variation group, and variant types. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/VariationGroup"
          }
        },
        "slug": {
          "description": "SEO-friendly slug for the product, derived from the site's configured product URL rule.\nThis is the slug segment only, not a full URL. Returned only when `expand=slug` is requested.\nUse the slug to construct user-friendly product detail page URLs (for example,\n/products/{slug}/{productId}).",
          "type": "string",
          "maxLength": 4000
        }
      },
      "required": [
        "productId"
      ],
      "type": "object",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      }
    },
    "ProductSearchRefinement": {
      "description": "Document representing a product search refinement attribute.",
      "properties": {
        "attributeId": {
          "description": "The ID of the search refinement attribute. In the case of an attribute refinement, this is the attribute ID.\n Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a\n category refinement, the ID must be \"cgid\". In the case of a price refinement, the ID must be \"price\".",
          "minLength": 1,
          "type": "string",
          "maxLength": 256
        },
        "label": {
          "description": "The localized label of the refinement.",
          "type": "string",
          "maxLength": 256
        },
        "values": {
          "description": "The sorted array of refinement values. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductSearchRefinementValue"
          }
        }
      },
      "required": [
        "attributeId"
      ],
      "type": "object"
    },
    "ProductSearchRefinementValue": {
      "description": "Document representing a product search refinement value.",
      "properties": {
        "description": {
          "description": "The localized description of the refinement value.",
          "type": "string",
          "maxLength": 4000
        },
        "hitCount": {
          "format": "int32",
          "description": "The number of search hits when selecting the refinement value. Can be 0.",
          "type": "integer",
          "minLength": 1
        },
        "label": {
          "description": "The localized label of the refinement value.",
          "minLength": 1,
          "type": "string",
          "maxLength": 4000
        },
        "presentationId": {
          "description": "The optional presentation ID associated with the refinement value.\n The presentation ID can be used, for example, to associate an ID with\n an HTML widget.",
          "type": "string",
          "maxLength": 256
        },
        "value": {
          "description": "The refinement value. In the case of an attribute refinement, this is the bucket, the attribute value, or a \nvalue range. In the case of a category refinement, this is the category ID. In the case of a price \nrefinement, this is the price range. Ranges are enclosed by parentheses and delimited by \"..\"; for example, \n\"(100..999)\" and \"(Aa..Fa)\" are valid ranges.",
          "type": "string",
          "minLength": 1,
          "maxLength": 4000
        },
        "values": {
          "description": "The array of hierarchical refinement values. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductSearchRefinementValue"
          }
        }
      },
      "required": [
        "hitCount",
        "label",
        "value"
      ],
      "type": "object"
    },
    "ProductSearchSortingOption": {
      "description": "Document representing a product search sorting option.",
      "properties": {
        "id": {
          "description": "The ID of the sorting option.",
          "minLength": 1,
          "maxLength": 256,
          "type": "string"
        },
        "label": {
          "description": "The localized label of the sorting option.",
          "minLength": 1,
          "maxLength": 4000,
          "type": "string"
        }
      },
      "required": [
        "id",
        "label"
      ],
      "type": "object"
    },
    "ProductType": {
      "description": "Document representing a product type.",
      "properties": {
        "bundle": {
          "description": "A flag indicating whether the product is a bundle.",
          "type": "boolean"
        },
        "item": {
          "description": "A flag indicating whether the product is a standard item.",
          "type": "boolean"
        },
        "master": {
          "description": "A flag indicating whether the product is a master.",
          "type": "boolean"
        },
        "option": {
          "description": "A flag indicating whether the product is an option.",
          "type": "boolean"
        },
        "set": {
          "description": "A flag indicating whether the product is a set.",
          "type": "boolean"
        },
        "variant": {
          "description": "A flag indicating whether the product is a variant.",
          "type": "boolean"
        },
        "variationGroup": {
          "description": "A flag indicating whether the product is a variation group.",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "ResultBase": {
      "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
      "type": "object",
      "required": [
        "limit",
        "total"
      ],
      "properties": {
        "limit": {
          "format": "int32",
          "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
          "type": "integer"
        },
        "total": {
          "$ref": "#/$defs/Total"
        }
      }
    },
    "SearchMode": {
      "description": "A search matching approach. `semantic` is meaning-based matching; `lexical` is keyword/token-based matching.",
      "type": "string",
      "enum": [
        "semantic",
        "lexical"
      ]
    },
    "SuggestedPhrase": {
      "description": "Document representing a suggested search phrase.",
      "properties": {
        "exactMatch": {
          "description": "Returns whether this suggested phrase exactly matches the user input search phrase.",
          "type": "boolean",
          "minLength": 1
        },
        "phrase": {
          "description": "Returns the suggested search phrase.",
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "required": [
        "exactMatch",
        "phrase"
      ],
      "type": "object",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      }
    },
    "SuggestedTerm": {
      "description": "Document representing a suggested term.",
      "properties": {
        "completed": {
          "description": "Returns whether this term value is a completion match.",
          "type": "boolean",
          "minLength": 1
        },
        "corrected": {
          "description": "Returns whether this term value is a correction match.",
          "type": "boolean",
          "minLength": 1
        },
        "exactMatch": {
          "description": "Returns whether this term value is a exact match.",
          "type": "boolean",
          "minLength": 1
        },
        "value": {
          "description": "Returns the term value.",
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "required": [
        "completed",
        "corrected",
        "exactMatch",
        "value"
      ],
      "type": "object"
    },
    "SuggestedTerms": {
      "description": "Document representing a list of suggested terms for each term of a search phrase.",
      "properties": {
        "originalTerm": {
          "description": "Returns the original term that the suggested terms relates to.",
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        },
        "terms": {
          "description": "Returns the suggested terms.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SuggestedTerm"
          }
        }
      },
      "required": [
        "originalTerm"
      ],
      "type": "object"
    },
    "Suggestion": {
      "description": "Document representing a suggestion.",
      "properties": {
        "suggestedPhrases": {
          "description": "A list of suggested phrases. This list can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SuggestedPhrase"
          }
        },
        "suggestedTerms": {
          "description": "A list of suggested terms. This list can be empty.",
          "type": "array",
          "minLength": 1,
          "items": {
            "$ref": "#/$defs/SuggestedTerms"
          }
        }
      },
      "required": [
        "suggestedTerms"
      ],
      "type": "object",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      }
    },
    "Total": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
      "type": "integer"
    },
    "Variant": {
      "description": "A product which is a variation within a master product that describes different colors, sizes, or other variation attributes. *Has a SKU.*",
      "properties": {
        "orderable": {
          "description": "A flag indicating whether the variant is orderable.",
          "type": "boolean"
        },
        "price": {
          "format": "double",
          "description": "The sales price of the variant.",
          "type": "number"
        },
        "productId": {
          "minLength": 1,
          "maxLength": 100,
          "description": "The ID (SKU) of the variant.",
          "type": "string"
        },
        "tieredPrices": {
          "description": "List of tiered prices if the product is a variant",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductPriceTable"
          }
        },
        "variationValues": {
          "description": "The actual variation attribute ID - value pairs.",
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "productPromotions": {
          "description": "The array of active customer product promotions for this product. This array can be empty.\n Coupon promotions are not returned in this array.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductPromotion"
          }
        }
      },
      "required": [
        "productId"
      ],
      "type": "object",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      }
    },
    "VariationAttribute": {
      "description": "Document representing a variation attribute.",
      "properties": {
        "id": {
          "minLength": 1,
          "description": "The ID of the variation attribute.",
          "type": "string",
          "maxLength": 256
        },
        "name": {
          "description": "The localized display name of the variation attribute.",
          "type": "string",
          "maxLength": 4000
        },
        "values": {
          "description": "The sorted array of variation values. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/VariationAttributeValue"
          }
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "VariationAttributeValue": {
      "description": "Document representing a variation attribute value.",
      "properties": {
        "description": {
          "description": "The localized description of the variation value.",
          "type": "string",
          "maxLength": 4000
        },
        "image": {
          "description": "The first product image for the configured viewtype and this variation value.",
          "allOf": [
            {
              "$ref": "#/$defs/Image"
            }
          ]
        },
        "imageSwatch": {
          "description": "The first product image for the configured viewtype and this variation value. Typically the swatch image.",
          "allOf": [
            {
              "$ref": "#/$defs/Image"
            }
          ]
        },
        "name": {
          "description": "The localized display name of the variation value.",
          "type": "string",
          "maxLength": 4000
        },
        "orderable": {
          "description": "A flag indicating whether at least one variant with this variation attribute value is available to sell.",
          "type": "boolean"
        },
        "value": {
          "minLength": 1,
          "description": "The actual variation value.",
          "type": "string",
          "maxLength": 4000
        }
      },
      "required": [
        "value"
      ],
      "type": "object"
    },
    "VariationGroup": {
      "description": "Representation of a group of variant products by an attribute. This can't be purchased by a shopper. It provides inheritable attributes for its product variants and is used for navigation. A VariationGroup doesn't have a SKU.",
      "properties": {
        "orderable": {
          "description": "A flag indicating whether the variation group is orderable.",
          "type": "boolean",
          "minLength": 1
        },
        "price": {
          "format": "double",
          "description": "The sales price of the variation group.",
          "type": "number",
          "minLength": 1
        },
        "productId": {
          "minLength": 1,
          "maxLength": 100,
          "description": "The ID (SKU) of the variation group.",
          "type": "string"
        },
        "variationValues": {
          "description": "The actual variation attribute ID - value pairs.",
          "type": "object",
          "minLength": 1,
          "additionalProperties": {
            "type": "string",
            "maxLength": 4000
          }
        }
      },
      "required": [
        "orderable",
        "price",
        "productId",
        "variationValues"
      ],
      "type": "object"
    },
    "query": {
      "description": "The query string that was searched for.",
      "type": "string",
      "maxLength": 50
    }
  }
}