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

# Standort anlegen

> Legt einen Standort für einen Kunden an.



## OpenAPI

````yaml api/openapi.json POST /customer/site
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:
  /customer/site:
    post:
      tags:
        - Kunden & Standorte
      summary: Standort anlegen
      description: >-
        Legt einen Standort für einen bestehenden Kunden an. Ein Standort ist
        ein Ort, an dem Pflanzen stehen und gepflegt werden.
      operationId: createSite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customerId
                - name
                - address
                - needsAppointment
                - hasKey
              properties:
                customerId:
                  type: string
                  format: uuid
                  description: ID des Kunden, zu dem der Standort gehört.
                name:
                  type: string
                  maxLength: 60
                  description: Bezeichnung des Standorts.
                address:
                  $ref: '#/components/schemas/Address'
                needsAppointment:
                  type: boolean
                  description: Ob für diesen Standort Termine geplant werden müssen.
                hasKey:
                  type: boolean
                  description: Ob für den Zugang ein Schlüssel vorhanden ist.
                comment:
                  type: string
                  maxLength: 150
                  description: Freier Hinweis zum Standort.
                appointmentPreparationTimeInMinutes:
                  type: integer
                  minimum: 0
                  description: >-
                    Zeitpuffer in Minuten, den blueplant vor einem Termin an
                    diesem Standort einplant.
                attendingIntervals:
                  type: array
                  description: >-
                    Besuchsintervalle des Standorts. TODO: genaue Struktur der
                    Intervall-Objekte mit dem Dev-Team abstimmen.
                  items:
                    type: object
                openingHours:
                  type: array
                  default: []
                  description: >-
                    Öffnungszeiten des Standorts. TODO: genaue Struktur der
                    Öffnungszeit-Objekte mit dem Dev-Team abstimmen.
                  items:
                    type: object
                serviceRecordRecipientId:
                  type: string
                  format: uuid
                  description: Empfänger der Leistungsnachweise für diesen Standort.
                callOutFee:
                  type: number
                  minimum: 0
                  description: Anfahrtspauschale für diesen Standort.
                assignedEmployeeId:
                  type: string
                  format: uuid
                  description: Standardmäßig zugewiesene mitarbeitende Person.
                contactPersonId:
                  type: string
                  format: uuid
                  description: Ansprechpartner am Standort.
                contractId:
                  type: string
                  format: uuid
                  description: Zugehöriger Vertrag.
                validFrom:
                  type: string
                  format: date
                  description: Beginn der Gültigkeit.
                validUntil:
                  type: string
                  format: date
                  description: Ende der Gültigkeit.
      responses:
        '201':
          description: Standort angelegt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    Address:
      type: object
      description: Postanschrift mit optionaler Geo-Position.
      required:
        - streetName
        - houseNumber
        - zipCode
        - city
      properties:
        streetName:
          type: string
          description: Straße.
        houseNumber:
          type: string
          description: Hausnummer.
        zipCode:
          type: string
          description: Postleitzahl.
        city:
          type: string
          description: Ort.
        location:
          $ref: '#/components/schemas/Location'
    IdResponse:
      type: object
      description: Antwort mit der ID des angelegten Objekts.
      properties:
        id:
          type: string
          format: uuid
          description: ID des angelegten Objekts.
    Location:
      type: object
      description: Geografische Position.
      properties:
        lat:
          type: number
          minimum: -90
          maximum: 90
          description: Breitengrad.
        lng:
          type: number
          minimum: -180
          maximum: 180
          description: Längengrad.
    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`.

````