> ## 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.

# Update Variant

> Update a Variant's properties.

**Authentication Required**: Requires ``variant:write`` permission.
Only provided fields will be updated.



## OpenAPI

````yaml /openapi/merchantops-public.json put /api/products/{product_key}/variants/{variant_key}
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/{variant_key}:
    put:
      tags:
        - Variants
      summary: Update Variant
      description: |-
        Update a Variant's properties.

        **Authentication Required**: Requires ``variant:write`` permission.
        Only provided fields will be updated.
      operationId: variants_update_variant
      parameters:
        - in: path
          name: product_key
          required: true
          schema:
            title: Product Key
            type: string
        - in: path
          name: variant_key
          required: true
          schema:
            title: Variant Key
            type: string
        - 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/merchantops_server__api__routers__variants__models__VariantUpdateRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariantResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    merchantops_server__api__routers__variants__models__VariantUpdateRequest:
      description: Request model for updating a Variant (partial update).
      properties:
        isPublished:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ispublished
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
        properties_metadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Properties Metadata
      title: VariantsVariantUpdateRequest
      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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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

````