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

# Create a new product

> Creates a new product with optional image uploads.
    
This endpoint allows you to create products with detailed information and multiple images.

## Use Cases
- Add new products to your catalog
- Create products with multiple images
- Set up product pricing and descriptions

## Supported Image Formats
- JPEG/JPG
- PNG
- WebP
- Maximum 10 images per product
- Maximum file size: 5MB per image

## Example Request (multipart/form-data)
```
name: "Premium Widget"
description: "High-quality widget for all your needs"
price: "99.99"
images: [file1.jpg, file2.jpg]  // Optional, up to 10 images
```

## Required Fields
- `name`: Product name
- `price`: Product price (decimal number)

## Optional Fields
- `description`: Detailed product description
- `images`: Product images (up to 10 files)



## OpenAPI

````yaml /swagger.yml post /api/v0/products
openapi: 3.0.0
info:
  title: Devdraft AI Payment & Business Management API
  description: >-

    A comprehensive payment processing and business management API that enables
    seamless integration of cryptocurrency and traditional payment methods.
        
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.devdraft.ai
    description: Production Server
security: []
tags: []
paths:
  /api/v0/products:
    post:
      tags:
        - Products
      summary: Create a new product
      description: >-
        Creates a new product with optional image uploads.
            
        This endpoint allows you to create products with detailed information
        and multiple images.


        ## Use Cases

        - Add new products to your catalog

        - Create products with multiple images

        - Set up product pricing and descriptions


        ## Supported Image Formats

        - JPEG/JPG

        - PNG

        - WebP

        - Maximum 10 images per product

        - Maximum file size: 5MB per image


        ## Example Request (multipart/form-data)

        ```

        name: "Premium Widget"

        description: "High-quality widget for all your needs"

        price: "99.99"

        images: [file1.jpg, file2.jpg]  // Optional, up to 10 images

        ```


        ## Required Fields

        - `name`: Product name

        - `price`: Product price (decimal number)


        ## Optional Fields

        - `description`: Detailed product description

        - `images`: Product images (up to 10 files)
      operationId: ProductController_create
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateProductDto'
      responses:
        '201':
          description: The product has been successfully created.
        '400':
          description: Bad Request - Invalid input data or image format
        '401':
          description: Unauthorized - Invalid API credentials
        '413':
          description: Payload Too Large - Image files too large
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    CreateProductDto:
      type: object
      properties:
        name:
          type: string
          description: >-
            Product name as it will appear to customers. Should be clear and
            descriptive.
          example: Premium Software License
          minLength: 1
          maxLength: 200
        description:
          type: string
          description: >-
            Detailed description of the product. Supports markdown formatting
            for rich text display.
          example: >-
            Annual license for our premium software suite with advanced
            features, priority support, and regular updates.
          maxLength: 2000
        price:
          type: number
          description: Product price in the specified currency. Must be greater than 0.
          example: 299.99
          minimum: 0.01
        currency:
          type: string
          description: Currency code for the price. Defaults to USD if not specified.
          example: USD
          enum:
            - USD
            - EUR
            - GBP
            - CAD
            - AUD
            - JPY
          default: USD
        type:
          type: string
          description: Product type
          example: DIGITAL
        weight:
          type: number
          description: Weight of the product
        unit:
          type: string
          description: Unit of measurement
        quantity:
          type: number
          description: Quantity available
        stockCount:
          type: number
          description: Stock count
        status:
          type: string
          description: Product status
          example: ACTIVE
        productType:
          type: string
          description: Product type
          example: PRODUCT
        images:
          description: Array of image URLs
          type: array
          items:
            type: string
      required:
        - name
        - description
        - price
  securitySchemes:
    x-client-secret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your secret API key. Keep this secure and never expose it in client-side
        code.
    x-client-key:
      type: apiKey
      in: header
      name: x-client-key
      description: Your unique client API key. Obtain this from your Devdraft AI dashboard.

````