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

# Add a variant to a product

> Add a new variant (configuration option) to an existing product.
    
    Variants allow the same product to have different configurations, such as 
    different durations, tiers, or sizes. Each variant can have its own offers.



## OpenAPI

````yaml /api-reference/api-docs.yaml post /v0/products/{productId}/variants/add
openapi: 3.1.0
info:
  title: Fungies API v0
  version: 0.3.5
servers:
  - url: https://api.fungies.io
security: []
tags:
  - name: discounts
    description: Discounts related endpoints
  - name: keys
    description: Offer product keys related endpoints
  - name: orders
    description: Orders related endpoints
  - name: payments
    description: Payments related endpoints
  - name: offers
    description: Offers related endpoints
  - name: products
    description: Products related endpoints
  - name: subscriptions
    description: Subscriptions related endpoints
  - name: tax
    description: Tax calculation related endpoints
  - name: users
    description: Users related endpoints
  - name: variants
    description: Product variants related endpoints
  - name: plans
    description: Product plans related endpoints
  - name: elements
    description: Elements related endpoints
paths:
  /v0/products/{productId}/variants/add:
    post:
      tags:
        - products
        - variants
      summary: Add a variant to a product
      description: |-
        Add a new variant (configuration option) to an existing product.
            
            Variants allow the same product to have different configurations, such as 
            different durations, tiers, or sizes. Each variant can have its own offers.
      operationId: PostV0ProductsProductIdVariantsAdd
      parameters:
        - name: productId
          in: path
          required: true
          description: POST /v0/products/:productId/variants/add Parameter
          schema:
            $ref: >-
              #/components/schemas/PostV0ProductsProductIdVariantsAddParameterProductId
      requestBody:
        description: POST /v0/products/:productId/variants/add Request body
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PostV0ProductsProductIdVariantsAddRequestBody
      responses:
        '200':
          description: POST /v0/products/:productId/variants/add Positive response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV0ProductsProductIdVariantsAddPositiveResponse
        '400':
          description: POST /v0/products/:productId/variants/add Negative response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV0ProductsProductIdVariantsAddNegativeResponse
              examples:
                example1:
                  value:
                    status: error
                    error:
                      message: Sample error message
      security:
        - APIKEY_1: []
          APIKEY_2: []
components:
  schemas:
    PostV0ProductsProductIdVariantsAddParameterProductId:
      type: string
      format: uuid
    PostV0ProductsProductIdVariantsAddRequestBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 150
        description:
          type: string
          default: ''
        features:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
            required:
              - value
        cover:
          type: string
        coverBlurHash:
          type: string
        coverVideo:
          type: string
        externalId:
          type: string
      required:
        - name
    PostV0ProductsProductIdVariantsAddPositiveResponse:
      type: object
      properties:
        status:
          type: string
          const: success
        data:
          type: object
          properties:
            variant:
              type: object
              properties:
                object:
                  type: string
                  enum:
                    - variant
                  default: variant
                id:
                  type: string
                  format: uuid
                internalId:
                  type:
                    - string
                    - 'null'
                  default: null
                name:
                  type: string
                  default: ''
                description:
                  type: string
                  default: ''
                order:
                  type:
                    - number
                    - 'null'
                  format: double
                  minimum: -1.7976931348623157e+308
                  maximum: 1.7976931348623157e+308
                  default: null
              required:
                - id
          required:
            - variant
      required:
        - status
        - data
    PostV0ProductsProductIdVariantsAddNegativeResponse:
      type: object
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - status
        - error
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: header
      name: x-fngs-public-key
    APIKEY_2:
      type: apiKey
      in: header
      name: x-fngs-secret-key

````