> ## 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 plan to a product

> Add a new subscription plan to an existing product.
    
    Plans are variants specifically for subscription products, typically 
    representing different billing intervals or tiers.



## OpenAPI

````yaml /api-reference/api-docs.yaml post /v0/products/{productId}/plans/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: 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}/plans/add:
    post:
      tags:
        - products
        - plans
      summary: Add a plan to a product
      description: |-
        Add a new subscription plan to an existing product.
            
            Plans are variants specifically for subscription products, typically 
            representing different billing intervals or tiers.
      operationId: PostV0ProductsProductIdPlansAdd
      parameters:
        - name: productId
          in: path
          required: true
          description: POST /v0/products/:productId/plans/add Parameter
          schema:
            $ref: >-
              #/components/schemas/PostV0ProductsProductIdPlansAddParameterProductId
      requestBody:
        description: POST /v0/products/:productId/plans/add Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostV0ProductsProductIdPlansAddRequestBody'
      responses:
        '200':
          description: POST /v0/products/:productId/plans/add Positive response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV0ProductsProductIdPlansAddPositiveResponse
        '400':
          description: POST /v0/products/:productId/plans/add Negative response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV0ProductsProductIdPlansAddNegativeResponse
              examples:
                example1:
                  value:
                    status: error
                    error:
                      message: Sample error message
      security:
        - APIKEY_1: []
          APIKEY_2: []
components:
  schemas:
    PostV0ProductsProductIdPlansAddParameterProductId:
      type: string
      format: uuid
    PostV0ProductsProductIdPlansAddRequestBody:
      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
    PostV0ProductsProductIdPlansAddPositiveResponse:
      type: object
      properties:
        status:
          type: string
          const: success
        data:
          type: object
          properties:
            plan:
              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:
            - plan
      required:
        - status
        - data
    PostV0ProductsProductIdPlansAddNegativeResponse:
      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

````