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

# List Variants

> List Variants for a product with pagination, sorting, and property filters.

**Authentication Required**: Requires ``variant:read`` permission.



## OpenAPI

````yaml /openapi/merchantops-public.json get /api/products/{product_key}/variants/
openapi: 3.1.0
info:
  description: >-
    Public API for the MerchantOps product catalog, pricing, and publishing
    surface.
  title: MerchantOps API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.merchantops.ai
security: []
paths:
  /api/products/{product_key}/variants/:
    get:
      tags:
        - Variants
      summary: List Variants
      description: >-
        List Variants for a product with pagination, sorting, and property
        filters.


        **Authentication Required**: Requires ``variant:read`` permission.
      operationId: list_variants
      parameters:
        - in: path
          name: product_key
          required: true
          schema:
            title: Product Key
            type: string
        - description: Maximum results
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Maximum results
            maximum: 500
            minimum: 1
            title: Limit
            type: integer
        - description: Number of results to skip
          in: query
          name: offset
          required: false
          schema:
            default: 0
            description: Number of results to skip
            minimum: 0
            title: Offset
            type: integer
        - description: >-
            Sort field. Top-level: created_at, is_published, key, updated_at.
            Anything else is treated as a property key (e.g., 'color').
          in: query
          name: sort_by
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Sort field. Top-level: created_at, is_published, key, updated_at.
              Anything else is treated as a property key (e.g., 'color').
            title: Sort By
        - in: query
          name: sort_dir
          required: false
          schema:
            default: asc
            pattern: ^(asc|desc)$
            title: Sort Dir
            type: string
        - description: 'Repeatable: key:value. Filters by properties.<key> = value.'
          in: query
          name: property_filter
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: 'Repeatable: key:value. Filters by properties.<key> = value.'
            title: Property Filter
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-Organization-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
        - in: cookie
          name: stytch_session
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Stytch Session
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/merchantops_server__api__routers__variants__models__VariantListResponse
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    merchantops_server__api__routers__variants__models__VariantListResponse:
      description: Paginated response for listing Variants.
      properties:
        items:
          items:
            $ref: '#/components/schemas/VariantResponse'
          title: Items
          type: array
        limit:
          title: Limit
          type: integer
        offset:
          title: Offset
          type: integer
        total:
          title: Total
          type: integer
      required:
        - total
        - items
        - limit
        - offset
      title: VariantsVariantListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    VariantResponse:
      description: Response model for a single Variant.
      properties:
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          description: Creation timestamp
          title: Createdat
        createdBy:
          anyOf:
            - type: string
            - type: 'null'
          description: User who created this
          title: Createdby
        id:
          description: MongoDB ObjectId as string
          title: Id
          type: string
        isPublished:
          default: false
          description: Published status
          title: Ispublished
          type: boolean
        key:
          description: Variant key, unique within a product
          title: Key
          type: string
        lastModifiedAt:
          anyOf:
            - type: string
            - type: 'null'
          description: Last modification timestamp
          title: Lastmodifiedat
        lastModifiedBy:
          anyOf:
            - type: string
            - type: 'null'
          description: User who last modified this
          title: Lastmodifiedby
        productType:
          additionalProperties: true
          description: Product type reference
          title: Producttype
          type: object
        product_key:
          description: Key of the parent Product
          title: Product Key
          type: string
        properties:
          additionalProperties: true
          description: Variant data keyed by PropertyDefinition key
          title: Properties
          type: object
        properties_metadata:
          additionalProperties:
            additionalProperties: true
            type: object
          description: Per-property metadata
          title: Properties Metadata
          type: object
        propertyCount:
          default: 0
          description: Number of properties with values
          title: Propertycount
          type: integer
      required:
        - id
        - key
        - product_key
        - productType
      title: VariantResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````