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

# Create Product



## OpenAPI

````yaml https://app.flowglad.com/api/openapi post /api/v1/products
openapi: 3.1.0
info:
  title: Flowglad API
  version: 0.0.1
servers:
  - url: https://app.flowglad.com
security: []
externalDocs:
  url: https://docs.flowglad.com
paths:
  /api/v1/products:
    post:
      tags:
        - Products
      summary: Create Product
      operationId: products-create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                product:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                    description:
                      anyOf:
                        - type: string
                        - type: 'null'
                    imageURL:
                      anyOf:
                        - type: string
                        - type: 'null'
                    active:
                      type: boolean
                    singularQuantityLabel:
                      anyOf:
                        - type: string
                        - type: 'null'
                    pluralQuantityLabel:
                      anyOf:
                        - type: string
                        - type: 'null'
                    pricingModelId:
                      type: string
                    default:
                      type: boolean
                    slug:
                      description: >-
                        Unique identifier for the product within its pricing
                        model
                      type: string
                      minLength: 1
                      maxLength: 255
                  required:
                    - name
                    - active
                    - pricingModelId
                    - slug
                price:
                  $ref: '#/components/schemas/CreateProductPriceInput'
                featureIds:
                  type: array
                  items:
                    type: string
              required:
                - product
                - price
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  product:
                    $ref: '#/components/schemas/ProductClientSelectSchema'
                required:
                  - product
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateProductPriceInput:
      oneOf:
        - $ref: '#/components/schemas/ProductSubscriptionPriceInsert'
        - $ref: '#/components/schemas/ProductSinglePaymentPriceInsert'
        - $ref: '#/components/schemas/ProductUsagePriceInsert'
      type: object
      discriminator:
        propertyName: type
        mapping:
          subscription:
            $ref: '#/components/schemas/ProductSubscriptionPriceInsert'
          single_payment:
            $ref: '#/components/schemas/ProductSinglePaymentPriceInsert'
          usage:
            $ref: '#/components/schemas/ProductUsagePriceInsert'
    ProductClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        imageURL:
          anyOf:
            - type: string
            - type: 'null'
        organizationId:
          type: string
        active:
          type: boolean
        singularQuantityLabel:
          anyOf:
            - type: string
            - type: 'null'
        pluralQuantityLabel:
          anyOf:
            - type: string
            - type: 'null'
        pricingModelId:
          type: string
        default:
          type: boolean
        slug:
          description: Unique identifier for the product within its pricing model
          type: string
          minLength: 1
          maxLength: 255
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - name
        - description
        - imageURL
        - organizationId
        - active
        - singularQuantityLabel
        - pluralQuantityLabel
        - pricingModelId
        - default
        - slug
      additionalProperties: false
    error.BAD_REQUEST:
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Invalid input data
          type: string
        code:
          description: The error code
          example: BAD_REQUEST
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.UNAUTHORIZED:
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Authorization not provided
          type: string
        code:
          description: The error code
          example: UNAUTHORIZED
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.FORBIDDEN:
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Insufficient access
          type: string
        code:
          description: The error code
          example: FORBIDDEN
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.INTERNAL_SERVER_ERROR:
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Internal server error
          type: string
        code:
          description: The error code
          example: INTERNAL_SERVER_ERROR
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    ProductSubscriptionPriceInsert:
      type: object
      properties:
        intervalUnit:
          type: string
          enum:
            - day
            - week
            - month
            - year
        name:
          anyOf:
            - type: string
            - type: 'null'
        intervalCount:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        type:
          type: string
          const: subscription
        trialPeriodDays:
          description: >-
            The trial period in days. If the trial period is 0 or null, there
            will be no trial period.
          anyOf:
            - anyOf:
                - description: A positive integer
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                - type: number
                  const: 0
            - type: 'null'
        isDefault:
          description: >-
            Whether or not this price is the default price. For product prices,
            this indicates the default price for that product. For usage prices,
            this indicates the default price for that usage meter.
          type: boolean
        unitPrice:
          description: >-
            The price per unit. This should be in the smallest unit of the
            currency. For example, if the currency is USD, GBP, CAD, EUR or SGD,
            the price should be in cents.
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        usageEventsPerUnit:
          description: Omitted.
          type: 'null'
        active:
          type: boolean
        slug:
          anyOf:
            - type: string
            - type: 'null'
        usageMeterId:
          description: Omitted.
          type: 'null'
      required:
        - intervalUnit
        - intervalCount
        - type
        - isDefault
        - unitPrice
    ProductSinglePaymentPriceInsert:
      type: object
      properties:
        intervalUnit:
          description: Omitted.
          type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
        intervalCount:
          description: Omitted.
          type: 'null'
        type:
          type: string
          const: single_payment
        trialPeriodDays:
          description: Omitted.
          type: 'null'
        isDefault:
          description: >-
            Whether or not this price is the default price. For product prices,
            this indicates the default price for that product. For usage prices,
            this indicates the default price for that usage meter.
          type: boolean
        unitPrice:
          description: >-
            The price per unit. This should be in the smallest unit of the
            currency. For example, if the currency is USD, GBP, CAD, EUR or SGD,
            the price should be in cents.
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        usageEventsPerUnit:
          description: Omitted.
          type: 'null'
        active:
          type: boolean
        slug:
          anyOf:
            - type: string
            - type: 'null'
        usageMeterId:
          description: Omitted.
          type: 'null'
      required:
        - type
        - isDefault
        - unitPrice
    ProductUsagePriceInsert:
      type: object
      properties:
        intervalUnit:
          type: string
          enum:
            - day
            - week
            - month
            - year
        name:
          anyOf:
            - type: string
            - type: 'null'
        intervalCount:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        type:
          type: string
          const: usage
        trialPeriodDays:
          description: Omitted.
          type: 'null'
        isDefault:
          description: >-
            Whether or not this price is the default price. For product prices,
            this indicates the default price for that product. For usage prices,
            this indicates the default price for that usage meter.
          type: boolean
        unitPrice:
          description: >-
            The price per unit. This should be in the smallest unit of the
            currency. For example, if the currency is USD, GBP, CAD, EUR or SGD,
            the price should be in cents.
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        usageEventsPerUnit:
          description: >-
            The number of usage events per unit. Used to determine how to map
            usage events to quantities when raising invoices for usage.
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        active:
          type: boolean
        slug:
          anyOf:
            - type: string
            - type: 'null'
        usageMeterId:
          description: >-
            The usage meter that uses this price. All usage events on that meter
            must be associated with a price that is also associated with that
            usage meter.
          type: string
      required:
        - intervalUnit
        - intervalCount
        - type
        - isDefault
        - unitPrice
        - usageEventsPerUnit
        - usageMeterId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````