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

# Produkte anlegen (Bulk)

> Legt mehrere Produkte in einem Aufruf an.



## OpenAPI

````yaml api/openapi.json POST /product/products
openapi: 3.1.0
info:
  title: blueplant API
  version: v1
  description: >-
    Öffentliche REST-API von blueplant zum Anlegen von Stammdaten (Kunden,
    Standorte, Kontaktpersonen, Pflanzen, Behälter und Produkte) aus anderen
    Systemen. Authentifiziert wird mit deinem API-Schlüssel aus den
    Mandanten-Einstellungen.
servers:
  - url: https://api.blueplant.app/api/v1
    description: Produktiv
security:
  - ApiKey: []
paths:
  /product/products:
    post:
      tags:
        - Pflanzen & Produkte
      summary: Produkte anlegen (Bulk)
      description: >-
        Legt mehrere Produkte in einem Aufruf an. Der Request-Body ist ein Array
        von Produkt-Objekten.
      operationId: createProducts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ProductInput'
      responses:
        '201':
          description: >-
            Produkte angelegt. TODO: genaue Erfolgs-Antwort mit dem Dev-Team
            bestätigen – vermutlich ein Array von Objekten mit `id`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IdResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    ProductInput:
      type: object
      required:
        - name
        - customerId
        - plantId
        - siteId
      properties:
        name:
          type: string
          maxLength: 64
          description: Bezeichnung des Produkts.
        customerId:
          type: string
          format: uuid
          description: ID des Kunden.
        plantId:
          type: string
          format: uuid
          description: ID der Pflanzenart.
        siteId:
          type: string
          format: uuid
          description: ID des Standorts.
        containerId:
          type: string
          format: uuid
          description: ID des Pflanzenbehälters.
        containerSizeId:
          type: string
          format: uuid
          description: ID der Behältergröße.
        externalId:
          type: string
          maxLength: 128
          description: Eigene Referenz aus deinem System.
        externalOrderNumber:
          type: string
          maxLength: 128
          description: Bestellnummer aus deinem System.
        initialPrice:
          type: number
          minimum: 0
          description: Anschaffungspreis.
        isInheritedProduct:
          type: boolean
          default: false
          description: Ob das Produkt von einem anderen geerbt wurde.
        locationDetails:
          $ref: '#/components/schemas/LocationDetails'
        notes:
          type: string
          maxLength: 512
          description: Freie Notizen zum Produkt.
        placementDate:
          type: string
          format: date
          description: Datum der Aufstellung.
        validFrom:
          type: string
          format: date
          description: Beginn der Gültigkeit.
        validUntil:
          type: string
          format: date
          description: Ende der Gültigkeit.
    IdResponse:
      type: object
      description: Antwort mit der ID des angelegten Objekts.
      properties:
        id:
          type: string
          format: uuid
          description: ID des angelegten Objekts.
    LocationDetails:
      type: object
      description: Genauer Standort des Produkts innerhalb des Gebäudes.
      properties:
        building:
          type: string
          description: Gebäude.
        floor:
          type: integer
          description: Etage.
        room:
          type: string
          description: Raum.
        detail:
          type: string
          description: Genauere Ortsangabe.
        note:
          type: string
          description: Zusätzlicher Hinweis.
    ValidationError:
      type: object
      description: Validierungsfehler mit feldbezogenen Meldungen.
      properties:
        message:
          type: string
          example: invalid input
        errors:
          type: array
          description: Liste der fehlerhaften Felder mit Meldungen.
          items:
            type: object
  responses:
    ValidationError:
      description: Ungültiges Request-Payload (Validierungsfehler).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    Unauthorized:
      description: Authentifizierung fehlgeschlagen – prüfe deinen API-Schlüssel.
    TooManyRequests:
      description: Zu viele Anfragen – versuche es später erneut.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: ApiKey
      description: >-
        Dein API-Schlüssel aus den Mandanten-Einstellungen, gesendet im Header
        `ApiKey`.

````