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

# Create a product



## OpenAPI

````yaml /openapi.en.json post /api/v2/products/{shopId}
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}:
    post:
      tags:
        - Products
      summary: Create a product
      operationId: ProductController_createProduct
      parameters:
        - name: shopId
          required: true
          in: path
          schema:
            type: string
          description: Shop ID (ObjectId)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductDto'
      responses:
        '201':
          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:
    CreateProductDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Product name
          example: Ranga VIP
        serverId:
          type: string
          description: Server ID (ObjectId)
          example: 664f1a2b3c4d5e6f7a8b9c0e
        price:
          type: number
          minimum: 0
          description: Price
          example: 19.99
        commands:
          minItems: 1
          description: Commands to run (with placeholders)
          example:
            - lp user {PLAYER} parent set vip
          type: array
          items:
            type: string
        description:
          type: string
          minLength: 0
          maxLength: 5000
          description: Description (HTML/markdown)
        shortDescription:
          type: string
          minLength: 0
          maxLength: 500
          description: Short description
        translations:
          type: object
          description: Per-language translations (key = ISO code)
        images:
          description: Direct image links
          type: array
          items:
            type: string
        compareAtPrice:
          type: number
          minimum: 0
          description: Compare-at price
          example: 29.99
        sku:
          type: string
          minLength: 0
          maxLength: 100
          description: SKU
        requirements:
          description: Requirements
          allOf:
            - $ref: '#/components/schemas/RequirementsDto'
        inventory:
          description: Inventory
          allOf:
            - $ref: '#/components/schemas/InventoryDto'
        isActive:
          type: boolean
          description: Active
        isFeatured:
          type: boolean
          description: Featured
        sortOrder:
          type: number
          description: Sort order
        pricingMode:
          enum:
            - variants
            - quantity
          type: string
          description: 'Pricing mode: variants or quantity (slider)'
        minQuantity:
          type: number
          minimum: 1
          description: Minimum quantity (slider)
          example: 1
        maxQuantity:
          type: number
          minimum: 1
          description: Maximum quantity (slider)
          example: 64
        stepQuantity:
          type: number
          minimum: 1
          description: Quantity slider step
          example: 1
        variants:
          description: Selectable variants
          type: array
          items:
            $ref: '#/components/schemas/VariantDto'
        packageSuggestions:
          description: Package suggestion tiles
          type: array
          items:
            $ref: '#/components/schemas/PackageSuggestionDto'
        paymentMethods:
          description: Assigned payment methods
          type: array
          items:
            $ref: '#/components/schemas/ProductPaymentMethodDto'
      required:
        - name
        - serverId
        - price
        - commands
    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

````