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

# Update Variant



## OpenAPI

````yaml https://api.vellaro.io/openapi.json patch /api/v1/admin/variants/{variant_id}
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/admin/variants/{variant_id}:
    patch:
      tags:
        - admin
        - admin
      summary: Update Variant
      operationId: update_variant_api_v1_admin_variants__variant_id__patch
      parameters:
        - name: variant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductVariantUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_ProductVariantOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ProductVariantUpdate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price
        compare_at_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Compare At Price
        sale_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Sale Price
        sale_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale Start
        sale_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale End
        stock:
          anyOf:
            - type: integer
            - type: 'null'
          title: Stock
        track_inventory:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Track Inventory
        allow_backorder:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Backorder
        weight:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Weight
        barcode:
          anyOf:
            - type: string
            - type: 'null'
          title: Barcode
        attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Attributes
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Active
      type: object
      title: ProductVariantUpdate
    ApiResponse_ProductVariantOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/ProductVariantOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[ProductVariantOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProductVariantOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        sku:
          type: string
          title: Sku
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
        compare_at_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Compare At Price
        sale_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Sale Price
        sale_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale Start
        sale_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale End
        stock:
          type: integer
          title: Stock
        track_inventory:
          type: boolean
          title: Track Inventory
        allow_backorder:
          type: boolean
          title: Allow Backorder
        weight:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Weight
        barcode:
          anyOf:
            - type: string
            - type: 'null'
          title: Barcode
        attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Attributes
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - sku
        - name
        - price
        - compare_at_price
        - sale_price
        - sale_start
        - sale_end
        - stock
        - track_inventory
        - allow_backorder
        - weight
        - barcode
        - attributes
        - is_active
        - created_at
      title: ProductVariantOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````