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

# Preview Product Rule

> Previews a new product rule by searching for products in the admin index that meet the rule criteria



## OpenAPI

````yaml /openapi/openapi_catalog_storefront.json post /commerce/rules/product/evaluate/preview
openapi: 3.0.1
info:
  description: |-
    <div id="overview_CATALOG_STOREFRONT">
                <h2>CATALOG STOREFRONT</h2>
                <p>The Catalog Storefront APIs are a collection of resources for managing storefront categories, currencies, price lists, products, and
                    product search. This controls how the products in your catalog are organized and displayed on the
                    storefront. See the
                    <a href="/concept-guides/catalog">Catalog user guides</a>
                    for information about the related features in the Unified Commerce Admin.</p>
                <p>Use the <strong>Currencies</strong> resource to retrieve exchange rates for displaying prices on your storefront.</p>
                <p>Use the <strong>Storefront Categories</strong> resource to view the product category hierarchy as it appears to shoppers
                    who are browsing the storefront. The hierarchy can be returned as a flat list or as a category tree.</p>
                <p>Use the <strong>Pricelists</strong> resource to retrieve the details of a price list. The details may contain a hierarchy
                    of ancestor and/or descendant price lists dependening on your configuration.</p>
                <p>Use the <strong>Storefront Products</strong> resource to manage the shopper product selection process during a visit to
                    the web storefront. You can update product options as shoppers pick and choose their product choices. A
                    shopper cannot add a product to a cart until all of its required options have been selected.</p>
                <p>Use the <strong>Product Search</strong> resource to provide dynamic search results to shoppers as they browse and search
                    for products on the web storefront, and to suggest possible search terms as the shopper enters text. The related <strong>Search Redirect</strong>
                    resource allows you to retrieve any search redirect items.</p>
            </div>
  title: Catalog Storefront
  version: 0.0.1
servers:
  - description: Kibo Base URL
    url: '{baseUrl}/api'
    variables:
      baseUrl:
        default: https://t1000000.sb.usc1.gcp.kibocommerce.com
        description: Base URL
security:
  - bearerAuth: []
paths:
  /commerce/rules/product/evaluate/preview:
    post:
      tags:
        - ProductRule
      summary: Preview Product Rule
      description: >-
        Previews a new product rule by searching for products in the admin index
        that meet the rule criteria
      parameters:
        - in: query
          name: sortBy
          schema:
            type: string
        - in: query
          name: pageSize
          schema:
            format: int32
            type: integer
        - in: query
          name: startIndex
          schema:
            default: 0
            format: int32
            type: integer
        - in: query
          name: fieldList
          schema:
            type: string
        - description: limits which fields are returned in the response body
          in: query
          name: responseFields
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogRuntimesProductRule'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductSearchSimplifiedResult'
            text/json:
              schema:
                $ref: '#/components/schemas/ProductSearchSimplifiedResult'
            text/plain:
              schema:
                $ref: '#/components/schemas/ProductSearchSimplifiedResult'
          description: OK
components:
  schemas:
    CatalogRuntimesProductRule:
      properties:
        code:
          description: Unique identifier of the ProductRule. System-supplied and read-only.
          nullable: true
          type: string
        description:
          description: ProductRule description
          nullable: true
          type: string
        expression:
          $ref: '#/components/schemas/CatalogRuntimesDynamicExpression'
        name:
          description: ProductRule name
          nullable: true
          type: string
        scope:
          nullable: true
          type: string
      type: object
    ProductSearchSimplifiedResult:
      properties:
        facets:
          items:
            $ref: '#/components/schemas/CatalogRuntimesFacet'
          nullable: true
          type: array
        items:
          items:
            additionalProperties: {}
            type: object
          nullable: true
          type: array
        nextCursorMark:
          nullable: true
          type: string
        pageCount:
          format: int32
          type: integer
        pageSize:
          format: int32
          type: integer
        searchRedirect:
          nullable: true
          type: string
        startIndex:
          format: int32
          type: integer
        totalCount:
          format: int32
          type: integer
      type: object
    CatalogRuntimesDynamicExpression:
      description: Category
      properties:
        text:
          nullable: true
          type: string
      type: object
    CatalogRuntimesFacet:
      description: >-
        For faceted searches, name of the facet and list of facet values. For
        example, a facet called "Brands" may have the facet values "Apple,"
        "Motorola," and "Samsung."
      properties:
        facetType:
          description: Value, RangeQuery, Hierarchy
          nullable: true
          type: string
        field:
          nullable: true
          type: string
        label:
          nullable: true
          type: string
        values:
          items:
            $ref: '#/components/schemas/FacetValue'
          nullable: true
          type: array
      type: object
    FacetValue:
      description: ''
      properties:
        childrenFacetValues:
          description: When hierarchical Facet
          items:
            type: object
          nullable: true
          type: array
        count:
          description: Number of occurrences of FacetValue in result set.
          format: int32
          type: integer
        filterValue:
          description: Submit this as a facet value filter
          nullable: true
          type: string
        isApplied:
          description: >-
            True if this FacetValue was supplied as a facet value filter in the
            current search
          nullable: true
          type: boolean
        isDisplayed:
          description: Indicates whether the FacetValue should be displayed
          type: boolean
        label:
          nullable: true
          type: string
        parentFacetValue:
          description: When hierarchical Facet
          nullable: true
          type: string
        rangeQueryValueEnd:
          description: When range query Facet
          nullable: true
          type: string
        rangeQueryValueStart:
          description: When range query Facet
          nullable: true
          type: string
        value:
          description: String representation of Facet Value
          nullable: true
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme.
      scheme: bearer
      type: http

````