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

# POST /products/{productId}/variant-options

> Assign variant options to a product



## OpenAPI

````yaml /api/openapi/admin-api.json post /products/{productId}/variant-options
openapi: 3.1.0
info:
  description: Admin API for Fanfare
  title: Fanfare Admin API
  version: 1.0.0
servers:
  - description: Production
    url: https://admin.fanfare.io/api
  - description: Local development
    url: http://localhost:4800
security:
  - SecretKeyAuth: []
paths:
  /products/{productId}/variant-options:
    post:
      tags:
        - Products
      description: Assign variant options to a product
      operationId: postProductsByProductIdVariantOptions
      parameters:
        - in: path
          name: productId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                options:
                  items:
                    properties:
                      optionId:
                        format: uuid
                        type: string
                      required:
                        type: boolean
                      sortOrder:
                        type: number
                    required:
                      - optionId
                    type: object
                  type: array
              required:
                - options
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  assignments:
                    items:
                      properties:
                        option:
                          properties:
                            archived:
                              type: boolean
                            createdAt:
                              format: date-time
                              type: string
                            createdBy:
                              type: string
                            displayName:
                              minLength: 1
                              type: string
                            id:
                              format: uuid
                              type: string
                            isRestricted:
                              type: boolean
                            name:
                              minLength: 1
                              type: string
                            organizationId:
                              format: uuid
                              type: string
                            sortOrder:
                              anyOf:
                                - type: number
                                - type: 'null'
                            updatedAt:
                              anyOf:
                                - format: date-time
                                  type: string
                                - type: 'null'
                            updatedBy:
                              anyOf:
                                - type: string
                                - type: 'null'
                          required:
                            - id
                            - organizationId
                            - createdAt
                            - createdBy
                            - archived
                            - name
                            - displayName
                            - isRestricted
                            - sortOrder
                          type: object
                        optionId:
                          format: uuid
                          type: string
                        organizationId:
                          format: uuid
                          type: string
                        productId:
                          format: uuid
                          type: string
                        required:
                          type: boolean
                        sortOrder:
                          anyOf:
                            - type: number
                            - type: 'null'
                        values:
                          items:
                            properties:
                              archived:
                                type: boolean
                              colorHex:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              createdAt:
                                format: date-time
                                type: string
                              createdBy:
                                type: string
                              displayValue:
                                minLength: 1
                                type: string
                              id:
                                format: uuid
                                type: string
                              isCentrallyManaged:
                                type: boolean
                              optionId:
                                format: uuid
                                type: string
                              organizationId:
                                format: uuid
                                type: string
                              sortOrder:
                                anyOf:
                                  - type: number
                                  - type: 'null'
                              updatedAt:
                                anyOf:
                                  - format: date-time
                                    type: string
                                  - type: 'null'
                              updatedBy:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              value:
                                minLength: 1
                                type: string
                            required:
                              - id
                              - organizationId
                              - createdAt
                              - createdBy
                              - archived
                              - optionId
                              - value
                              - displayValue
                              - colorHex
                              - isCentrallyManaged
                              - sortOrder
                            type: object
                          type: array
                      required:
                        - organizationId
                        - productId
                        - optionId
                        - required
                        - sortOrder
                        - option
                        - values
                      type: object
                    type: array
                required:
                  - assignments
                type: object
          description: Variant options assigned successfully
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    const: validation_error
                  issues:
                    items:
                      properties:
                        expected:
                          type: string
                        kind:
                          type: string
                        message:
                          type: string
                        path:
                          items:
                            properties:
                              input: {}
                              key:
                                type: string
                              origin:
                                type: string
                              type:
                                type: string
                            required:
                              - type
                              - origin
                              - input
                              - key
                            type: object
                          type: array
                        received:
                          type: string
                        type:
                          type: string
                      required:
                        - kind
                        - type
                        - expected
                        - received
                        - message
                        - path
                      type: object
                    type: array
                required:
                  - error
                  - issues
                type: object
          description: Bad Request - Invalid input schema
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Unauthorized - Authentication required
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Forbidden - User must be authenticated
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Internal server error
components:
  securitySchemes:
    SecretKeyAuth:
      description: Fanfare secret key. Keep secret credentials on your server.
      scheme: bearer
      type: http

````