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



## OpenAPI

````yaml /openapi.en.json put /api/v2/shops/{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/shops/{shopId}:
    put:
      tags:
        - Shops
      summary: Update a shop
      operationId: ShopController_updateShop
      parameters:
        - name: shopId
          required: true
          in: path
          schema:
            type: string
          description: Shop ID (ObjectId)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateShopDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/Shop'
                  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:
    UpdateShopDto:
      type: object
      properties:
        displayName:
          type: string
          minLength: 1
          maxLength: 100
          description: Display name
          example: Mój Sklep
        frontEndUrl:
          type: string
          format: uri
          description: Shop frontend URL
          example: https://moj-sklep.pl
        discordWebhookUrl:
          type: string
          format: uri
          description: Discord webhook URL
        discordWebhook:
          description: Discord webhook personalization
          allOf:
            - $ref: '#/components/schemas/DiscordWebhookDto'
        discordWebhookDaily:
          description: Daily-report webhook personalization
          allOf:
            - $ref: '#/components/schemas/DiscordWebhookDto'
        dailyReportsEnabled:
          type: boolean
          description: Daily Discord reports
        emailConfig:
          description: Email (SMTP) config for notifications
          allOf:
            - $ref: '#/components/schemas/EmailConfigDto'
    Shop:
      type: object
      properties:
        _id:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        uniqueName:
          type: string
          example: moj-sklep
        displayName:
          type: string
          example: Mój Sklep
        frontEndUrl:
          type: string
          example: https://moj-sklep.pl
        isActive:
          type: boolean
          example: true
        createdAt:
          type: string
          format: date-time
    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/...
    DiscordWebhookDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable order webhook
        title:
          type: string
          minLength: 0
          maxLength: 120
          description: Embed title
        color:
          type: string
          pattern: ^#([0-9a-fA-F]{6})$
          description: Embed color (hex)
          example: '#22c55e'
        username:
          type: string
          minLength: 0
          maxLength: 80
          description: Sender username
        avatarUrl:
          type: string
          format: uri
          description: Sender avatar URL
        customMessage:
          type: string
          minLength: 0
          maxLength: 1500
          description: Message template with placeholders
        fields:
          description: Configurable order-embed fields
          type: array
          items:
            $ref: '#/components/schemas/EmbedFieldDto'
    EmailConfigDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable email notifications
        provider:
          enum:
            - smtp
            - ses
            - resend
            - itemshop
          type: string
          description: Email provider
        host:
          type: string
          minLength: 0
          maxLength: 200
          description: SMTP host
          example: smtp.gmail.com
        port:
          type: number
          minimum: 1
          maximum: 65535
          description: SMTP port
          example: 587
        secure:
          type: boolean
          description: Secure (TLS/SSL)
        username:
          type: string
          minLength: 0
          maxLength: 200
          description: SMTP username
        password:
          type: string
          minLength: 0
          maxLength: 400
          description: SMTP password (blank = keep)
        resendApiKey:
          type: string
          minLength: 0
          maxLength: 400
          description: Resend API key (blank = keep)
        aws:
          description: AWS SES credentials
          allOf:
            - $ref: '#/components/schemas/EmailAwsDto'
        fromEmail:
          type: string
          minLength: 0
          maxLength: 200
          description: From email
        fromName:
          type: string
          minLength: 0
          maxLength: 120
          description: From name
        events:
          description: Email events to send
          allOf:
            - $ref: '#/components/schemas/EmailEventsDto'
        ownerEmail:
          type: string
          format: email
          description: Owner-notification recipient
          maxLength: 200
        subject:
          type: string
          minLength: 0
          maxLength: 200
          description: Custom order-email subject
        template:
          type: string
          minLength: 0
          maxLength: 20000
          description: Custom order-email HTML template
    EmbedFieldDto:
      type: object
      properties:
        key:
          type: string
          description: Catalog field key
          example: nick
        label:
          type: string
          minLength: 0
          maxLength: 80
          description: Field label (blank = default)
        enabled:
          type: boolean
          description: Whether the field is shown
        inline:
          type: boolean
          description: Inline field
    EmailAwsDto:
      type: object
      properties:
        region:
          type: string
          minLength: 0
          maxLength: 60
          description: AWS region
          example: eu-central-1
        accessKeyId:
          type: string
          minLength: 0
          maxLength: 200
          description: AWS Access Key ID
        secretAccessKey:
          type: string
          minLength: 0
          maxLength: 400
          description: AWS secret access key (blank = keep)
    EmailEventsDto:
      type: object
      properties:
        orderConfirmation:
          type: boolean
          description: Buyer order-confirmation email
        ownerNotification:
          type: boolean
          description: Owner sale notification
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http

````