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

# Update a product



## OpenAPI

````yaml /openapi.en.json put /api/v2/products/{shopId}/{productId}
openapi: 3.0.0
info:
  title: ItemShop v2 API
  description: >-
    REST API platformy ItemShop v2 (NestJS + Fastify). Wszystkie ścieżki mają
    prefiks /api/v2.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.itemshop.dev
    description: Production
  - url: http://localhost:3000
    description: Local
security: []
tags: []
paths:
  /api/v2/products/{shopId}/{productId}:
    put:
      tags:
        - Products
      summary: Update a product
      operationId: ProductController_updateProduct
      parameters:
        - name: shopId
          required: true
          in: path
          schema:
            type: string
          description: Shop ID (ObjectId)
        - name: productId
          required: true
          in: path
          schema:
            type: string
          description: Product ID (ObjectId)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/Product'
                  message:
                    type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    UpdateProductDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        serverId:
          type: string
        price:
          type: number
          minimum: 0
        commands:
          type: array
          items:
            type: string
        description:
          type: string
          minLength: 0
          maxLength: 5000
        shortDescription:
          type: string
          minLength: 0
          maxLength: 500
        translations:
          type: object
        images:
          type: array
          items:
            type: string
        compareAtPrice:
          type: number
          minimum: 0
        sku:
          type: string
          minLength: 0
          maxLength: 100
        requirements:
          $ref: '#/components/schemas/RequirementsDto'
        inventory:
          $ref: '#/components/schemas/InventoryDto'
        isActive:
          type: boolean
        isFeatured:
          type: boolean
        sortOrder:
          type: number
        pricingMode:
          type: string
          enum:
            - variants
            - quantity
        minQuantity:
          type: number
          minimum: 1
        maxQuantity:
          type: number
          minimum: 1
        stepQuantity:
          type: number
          minimum: 1
        variants:
          type: array
          items:
            $ref: '#/components/schemas/VariantDto'
        packageSuggestions:
          type: array
          items:
            $ref: '#/components/schemas/PackageSuggestionDto'
        paymentMethods:
          type: array
          items:
            $ref: '#/components/schemas/ProductPaymentMethodDto'
    Product:
      type: object
      properties:
        _id:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        name:
          type: string
          example: Ranga VIP
        slug:
          type: string
          example: ranga-vip
        price:
          type: number
          example: 19.99
        serverId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        shopId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        commands:
          type: array
          items:
            type: string
          example:
            - lp user {PLAYER} parent set vip
        isActive:
          type: boolean
          example: true
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Error message
        timestamp:
          type: string
          format: date-time
        path:
          type: string
          example: /api/v2/...
    RequirementsDto:
      type: object
      properties:
        requirePlayerOnline:
          type: boolean
          description: Require player online
        minecraftVersion:
          type: string
          description: Minecraft version
        permissions:
          description: Required permissions
          type: array
          items:
            type: string
    InventoryDto:
      type: object
      properties:
        trackQuantity:
          type: boolean
          description: Track quantity
        quantity:
          type: number
          minimum: 0
          description: Available quantity
          example: 100
        allowBackorder:
          type: boolean
          description: Allow backorder
    VariantDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
          description: Variant name
          example: VIP 30 dni
        price:
          type: number
          minimum: 0
          description: Variant price
          example: 19.99
        commands:
          description: Variant commands
          type: array
          items:
            type: string
        description:
          type: string
          minLength: 0
          maxLength: 500
          description: Variant description
        image:
          type: string
          minLength: 0
          maxLength: 2000
          description: Variant image URL
        paymentMethods:
          description: Per-method price overrides
          type: array
          items:
            $ref: '#/components/schemas/ProductPaymentMethodDto'
      required:
        - name
        - price
    PackageSuggestionDto:
      type: object
      properties:
        quantity:
          type: number
          minimum: 1
          description: Package quantity
          example: 50
        bonus:
          type: number
          minimum: 0
          description: Bonus (free extra units)
          example: 5
      required:
        - quantity
    ProductPaymentMethodDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
          description: Payment method name
          example: imojeTransfer
        priceOverride:
          type: number
          minimum: 0
          description: Price override for this method
          example: 12.99
      required:
        - name
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http

````