> ## 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.

# Update a product

> Updates an existing product's information and optionally adds new images.
    
This endpoint allows you to modify product details and manage product images.

## Use Cases
- Update product information
- Change product pricing
- Modify product images
- Update product description

## Example Request (multipart/form-data)
```
name: "Updated Premium Widget"
description: "Updated description"
price: "129.99"
images: [file1.jpg, file2.jpg]  // Optional, up to 10 images
```

## Notes
- Only include fields that need to be updated
- New images will replace existing images
- Maximum 10 images per product
- Images are automatically optimized



## OpenAPI

````yaml /swagger.yml put /api/v0/products/{id}
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/{id}:
    put:
      tags:
        - Products
      summary: Update a product
      description: >-
        Updates an existing product's information and optionally adds new
        images.
            
        This endpoint allows you to modify product details and manage product
        images.


        ## Use Cases

        - Update product information

        - Change product pricing

        - Modify product images

        - Update product description


        ## Example Request (multipart/form-data)

        ```

        name: "Updated Premium Widget"

        description: "Updated description"

        price: "129.99"

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

        ```


        ## Notes

        - Only include fields that need to be updated

        - New images will replace existing images

        - Maximum 10 images per product

        - Images are automatically optimized
      operationId: ProductController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Product ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateProductDto'
      responses:
        '200':
          description: The product has been successfully updated.
        '400':
          description: Bad Request - Invalid input data or image format
        '401':
          description: Unauthorized - Invalid API credentials
        '404':
          description: Product not found.
        '413':
          description: Payload Too Large - Image files too large
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    UpdateProductDto:
      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
  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.

````