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

# Personenkonto anlegen / aktualisieren

> Erstellt oder aktualisiert einen Geschäftspartner in DATEV Rechnungswesen.

**Kosten:** 1 Credit



## OpenAPI

````yaml POST /v2/datev-rewe/personenkonto
openapi: 3.1.0
info:
  title: Business OS API
  description: >-
    API für Business OS – Zugang zu DATEV und Banking Enterprise-Schnittstellen.
    Alle Endpoints erfordern einen API Key im `x-api-key` Header. Credits werden
    pro API-Call abgezogen.
  version: 2.0.0
  contact:
    name: Business OS Support
    email: impressum@business-os.de
    url: https://business-os.de/kontakt
servers:
  - url: https://api.business-os.de
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: DATEV Allgemein
    description: >-
      Modulübergreifende DATEV-Endpunkte (z. B. Abo-/Service-Diagnose für
      Mandanten)
  - name: DATEV DUO
    description: DATEV Unternehmen Online — Kassenbuch, Belegbilder und Buchungsvorschläge
  - name: DATEV ReWe - Write
    description: 'DATEV Rechnungswesen — Write: Buchungen, Kontakte, Belegtypen, Steuersätze'
  - name: DATEV ReWe - Read
    description: >-
      DATEV Rechnungswesen — Read (Export): Geschäftsjahre und weitere
      Lesemodule
  - name: Banking AIS
    description: >-
      Account Information Services — Verbindungen, Kontostände und Transaktionen
      verwalten
  - name: Banking PIS
    description: Payment Initiation Services — Zahlungen ausführen und Status abrufen
  - name: Banking Webhooks
    description: Webhook-Konfiguration für Echtzeit-Benachrichtigungen
paths:
  /v2/datev-rewe/personenkonto:
    post:
      tags:
        - DATEV ReWe - Write
      summary: Geschäftspartner anlegen / aktualisieren
      description: >-
        Erstellt oder aktualisiert einen Geschäftspartner in DATEV
        Rechnungswesen.


        **Kosten:** 1 Credit
      parameters:
        - $ref: '#/components/parameters/ConnectionIdParam'
        - $ref: '#/components/parameters/CreditQuelleParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - personenkontoNummer
                - kontaktTyp
                - kontenrahmen
                - kontonummernLaenge
                - geschaeftsjahrStartDatum
              properties:
                personenkontoNummer:
                  type: string
                  description: >-
                    Personenkonto-Nummer. Ist die Nummer bereits vergeben, wird
                    der bestehende Kontakt aktualisiert.
                  example: '70001'
                kontaktTyp:
                  type: string
                  enum:
                    - NATUERLICHE_PERSON
                    - UNTERNEHMEN
                  description: >-
                    Art des Geschäftspartners: `NATUERLICHE_PERSON` (z. B.
                    Freelancer) oder `UNTERNEHMEN` (juristische Person).
                  example: UNTERNEHMEN
                firmenname:
                  type: string
                  description: 'Firmenname (für `kontaktTyp: UNTERNEHMEN`).'
                  example: Beispiel GmbH
                ustId:
                  type: string
                  description: Umsatzsteuer-Identifikationsnummer (USt-IdNr.).
                  example: DE123456789
                emailAdressen:
                  type: array
                  description: >-
                    E-Mail-Adressen des Geschäftspartners. **Nur bei
                    `UNTERNEHMEN`** — bei `NATUERLICHE_PERSON` müssen
                    E-Mail-Adressen innerhalb von `kontaktpersonen` angegeben
                    werden.
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        example: info@beispiel.de
                      typ:
                        type: string
                        enum:
                          - GESCHAEFTLICH
                        example: GESCHAEFTLICH
                telefonnummern:
                  type: array
                  description: >-
                    Telefonnummern des Geschäftspartners. **Nur bei
                    `UNTERNEHMEN`** — bei `NATUERLICHE_PERSON` müssen
                    Telefonnummern innerhalb von `kontaktpersonen` angegeben
                    werden.
                  items:
                    type: object
                    properties:
                      nummer:
                        type: string
                        example: +49 89 123456
                      typ:
                        type: string
                        enum:
                          - GESCHAEFTLICH
                          - MOBIL
                        example: GESCHAEFTLICH
                bankkonten:
                  type: array
                  description: Bankverbindungen des Geschäftspartners.
                  items:
                    type: object
                    properties:
                      iban:
                        type: string
                        example: DE89370400440532013000
                      bic:
                        type: string
                        example: COBADEFFXXX
                      name:
                        type: string
                        description: Name der Bank oder des Kontos.
                        example: Geschäftskonto
                      istHauptkonto:
                        type: boolean
                        description: Gibt an, ob dies das Hauptkonto ist.
                        example: true
                kontaktpersonen:
                  type: array
                  description: >-
                    Kontaktpersonen des Geschäftspartners. **Pflicht bei
                    `NATUERLICHE_PERSON`** (mind. 1 Eintrag). **Verboten bei
                    `UNTERNEHMEN`**.
                  minItems: 1
                  items:
                    type: object
                    properties:
                      vorname:
                        type: string
                        example: Max
                      nachname:
                        type: string
                        example: Mustermann
                      anrede:
                        type: string
                        example: Herr
                      emailAdressen:
                        type: array
                        items:
                          type: object
                          properties:
                            email:
                              type: string
                              example: m.mustermann@beispiel.de
                            typ:
                              type: string
                              enum:
                                - GESCHAEFTLICH
                              example: GESCHAEFTLICH
                      telefonnummern:
                        type: array
                        items:
                          type: object
                          properties:
                            nummer:
                              type: string
                              example: +49 89 123456
                            typ:
                              type: string
                              enum:
                                - GESCHAEFTLICH
                                - MOBIL
                              example: MOBIL
                adressen:
                  type: array
                  description: Adressen des Geschäftspartners.
                  items:
                    type: object
                    properties:
                      adresszeile:
                        type: string
                        example: Musterstraße 1
                      postleitzahl:
                        type: string
                        example: '80331'
                      ort:
                        type: string
                        example: München
                      laendercode:
                        type: string
                        description: ISO 3166-1 alpha-2 Ländercode.
                        example: DE
                      typ:
                        type: string
                        enum:
                          - RECHNUNGSADRESSE
                          - GESCHAEFTLICH
                        example: RECHNUNGSADRESSE
                kontenrahmen:
                  type: string
                  description: Kontenrahmen des Mandanten.
                  example: SKR03
                kontonummernLaenge:
                  type: integer
                  description: Länge der Kontonummer des Mandanten.
                  example: 5
                geschaeftsjahrStartDatum:
                  type: string
                  format: date
                  description: >-
                    Erster Tag des Geschäftsjahres (YYYY-MM-DD). Üblicherweise
                    der 1. Januar.
                  example: '2025-01-01'
      responses:
        '200':
          description: Geschäftspartner erfolgreich angelegt / aktualisiert
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        nullable: true
                      kontonummernLaenge:
                        type: integer
                      kontenrahmen:
                        type: string
                      erstelltAm:
                        type: string
                        format: date-time
                      geschaeftsjahrStartDatum:
                        type: string
                        format: date
                      eintraege:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              nullable: true
                            kontaktTyp:
                              type: string
                            personenkontoNummer:
                              type: integer
                            nummer:
                              type: string
                              nullable: true
                            firmenname:
                              type: string
                            ustId:
                              type: string
                              nullable: true
                            aktualisiertAm:
                              type: string
                              format: date-time
                              nullable: true
                            projektId:
                              type: string
                              nullable: true
                            bankkonten:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            emailAdressen:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            telefonnummern:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            kontaktpersonen:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                            adressen:
                              type: array
                              items:
                                type: object
                                additionalProperties: true
                  datevAntwort:
                    type: object
                    nullable: true
                    properties:
                      status:
                        type: string
                      antwortDaten:
                        type: object
                        nullable: true
                      meldungen:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                  business-os:
                    type: object
                    properties:
                      neuesGuthaben:
                        type: integer
                        nullable: true
              example:
                data:
                  id: null
                  kontonummernLaenge: 4
                  kontenrahmen: SKR03
                  erstelltAm: '2025-03-15T10:32:27.122Z'
                  geschaeftsjahrStartDatum: '2025-01-01'
                  eintraege:
                    - id: null
                      kontaktTyp: UNTERNEHMEN
                      personenkontoNummer: 70001
                      nummer: null
                      firmenname: Musterbau GmbH
                      ustId: DE123456789
                      aktualisiertAm: null
                      projektId: null
                      bankkonten:
                        - iban: DE89370400440532013000
                          bic: COBADEFFXXX
                          name: Geschäftskonto
                          istHauptkonto: true
                      emailAdressen:
                        - email: info@musterbau.de
                          typ: GESCHAEFTLICH
                      telefonnummern:
                        - nummer: +49 89 123456
                          typ: GESCHAEFTLICH
                      kontaktpersonen:
                        - vorname: Max
                          nachname: Mustermann
                          anrede: Herr
                          emailAdressen:
                            - email: m.mustermann@musterbau.de
                              typ: GESCHAEFTLICH
                          telefonnummern:
                            - nummer: +49 171 9876543
                              typ: MOBIL
                      adressen:
                        - adresszeile: Musterstraße 12
                          adresszeile2: null
                          postleitzahl: '80331'
                          ort: München
                          laendercode: DE
                          typ: RECHNUNGSADRESSE
                datevAntwort:
                  status: ERFOLGREICH
                  antwortDaten: null
                  meldungen: []
                business-os:
                  neuesGuthaben: 499
        '400':
          description: Fehlende Pflichtfelder oder von DATEV abgewiesene Felder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatevError'
              examples:
                pflichtfelderFehlen:
                  summary: Pflichtfelder fehlen
                  value:
                    error: >-
                      Fehlende Pflichtfelder: kontaktdetails, kontenrahmen,
                      kontonummernLaenge, geschaeftsjahrStartDatum
                datevValidierung:
                  summary: DATEV lehnt die Anfrage ab (optional details)
                  value:
                    error: …
                    details:
                      message: …
        '401':
          $ref: '#/components/responses/DatevUnauthorized'
        '402':
          $ref: '#/components/responses/DatevPaymentRequired'
        '404':
          $ref: '#/components/responses/DatevNoConnection404Rewe'
        '500':
          $ref: '#/components/responses/DatevInternal500'
        '502':
          $ref: '#/components/responses/DatevBadGateway502'
        default:
          $ref: '#/components/responses/DatevServiceError'
components:
  parameters:
    ConnectionIdParam:
      name: connectionId
      in: query
      required: true
      schema:
        type: string
        format: uuid
        example: abbc18fd-ba5e-4dfd-afc4-9dec0c0ad145
      description: >-
        UUID der DATEV-Verbindung. Abrufbar über den `/connections`-Endpunkt des
        jeweiligen Moduls (z. B. `GET /v2/datev-duo/connections`).
    CreditQuelleParam:
      name: quelle
      in: query
      required: false
      schema:
        type: string
        default: API
        example: Make
      description: >-
        Kennzeichnung der Aufrufquelle für die Nutzungsanalyse. Standard bei
        Weglassen: `API` (direkter API-Aufruf). Für Automationen aus Make z. B.
        `Make` angeben.
  schemas:
    DatevError:
      type: object
      description: >-
        JSON-Fehlerantwort. Bei Fehlern der DATEV-Schnittstelle kann zusätzlich
        `details` gesetzt sein. Bei bekannten Fehlerkategorien ist ein stabiler
        `code` gesetzt, anhand dessen Automatisierungen reagieren können.
      required:
        - error
      properties:
        error:
          type: string
          description: Fehlermeldung
        message:
          type: string
          description: >-
            Zusätzliche Erläuterung; wenn der Header `x-api-key` fehlt: Hinweis
            zur erforderlichen Header-Zeile.
        code:
          type: string
          description: >-
            Stabiler, maschinenlesbarer Fehlercode für bekannte
            Fehlerkategorien. Wird nur gesetzt, wenn die Ursache eindeutig
            erkannt wurde.


            - `datev_connection_invalid`: Account-Key ist abgelaufen oder
            widerrufen — Reconnect über das Dashboard nötig. Begleitet von
            `reconnectUrl`.

            - `datev_export_service_missing`: Mandant hat keine relevante
            DATEV-Subscription gebucht (z. B. Belegbilderservice,
            Rechnungsdatenservice, Datenservice Export Rechnungswesen-Familie).
            Begleitet von `activeSubscriptions` mit der Liste der tatsächlich
            aktiven Services.

            - `datev_endpoint_not_authorized`: Subscription am Mandanten ist
            vorhanden und der Token gilt, aber das DATEV-RVO-Schreib-/Leserecht
            für den konkreten Endpoint fehlt für den authentifizierten Nutzer.
            Reconnect hilft hier nicht — der Steuerberater/Mandant-Inhaber muss
            in DATEV RVO das entsprechende Teilrecht freischalten.
          enum:
            - datev_connection_invalid
            - datev_export_service_missing
            - datev_endpoint_not_authorized
        reconnectUrl:
          type: string
          format: uri
          description: >-
            URL zum Business OS Dashboard, über die der Nutzer die
            DATEV-Verbindung erneuern kann. Gesetzt bei `code =
            datev_connection_invalid`.
        activeSubscriptions:
          type: array
          items:
            type: string
          description: >-
            Liste der aktuell aktiven DATEV-Service-Subscriptions des Mandanten
            (z. B. Belegbilderservice, Rechnungsdatenservice 1.0). Gesetzt bei
            `code = datev_export_service_missing`, damit Automationen erkennen,
            welche Services bereits gebucht sind.
        details:
          type: object
          description: >-
            Strukturierte Zusatzinformationen bei Antworten der
            DATEV-Schnittstelle.
          additionalProperties: true
  responses:
    DatevUnauthorized:
      description: >-
        API-Key fehlt, ist ungültig, widerrufen oder abgelaufen. Fehlt der
        Header `x-api-key`, enthält die Antwort zusätzlich `message`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          examples:
            ungueltigerKey:
              summary: Ungültiger oder unbekannter Key
              value:
                error: Ungültiger API-Key
            fehlenderHeader:
              summary: Fehlender x-api-key Header
              value:
                error: Fehlende Header
                message: x-api-key Header ist erforderlich.
    DatevPaymentRequired:
      description: Nicht genügend Credits für diesen Aufruf.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          example:
            error: Nicht genügend Credits
    DatevNoConnection404Rewe:
      description: >-
        Es ist keine gespeicherte DATEV-Verbindung für das gewählte DATEV
        Rechnungswesen-Produkt (Read oder Write) vorhanden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          example:
            error: Keine Verbindung gefunden für DATEV Rechnungswesen - Write
    DatevInternal500:
      description: >-
        Unerwarteter Serverfehler oder fehlende Serverkonfiguration für den
        DATEV-Dienst.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          example:
            error: API-Dienst nicht konfiguriert.
    DatevBadGateway502:
      description: >-
        Die DATEV-Schnittstelle war kurzzeitig nicht erreichbar (Netzwerk- oder
        Verbindungsfehler).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          example:
            error: Die DATEV-Schnittstelle ist vorübergehend nicht erreichbar.
    DatevServiceError:
      description: >-
        Fehlerantwort der DATEV-Schnittstelle (HTTP-Status entspricht der
        DATEV-Antwort). Der Body enthält `error` und optional `details` mit
        Zusatzinformationen. Bei 403 wegen fehlendem DATEV
        Rechnungswesen-Exportservice ist zusätzlich `code =
        datev_export_service_missing` und `activeSubscriptions` gesetzt.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DatevError'
          examples:
            mitDetails:
              summary: Beispiel mit details
              value:
                error: Validierung fehlgeschlagen
                details:
                  message: …
            exportserviceFehlt:
              summary: 403 – DATEV Rechnungswesen-Exportservice nicht abonniert
              value:
                error: >-
                  DATEV Rechnungswesen-Exportservice ist für diesen Mandanten
                  nicht abonniert. Aktive Services: Belegbilderservice,
                  Rechnungsdatenservice 1.0. Bitte den Service über DATEV beim
                  Mandant aktivieren.
                code: datev_export_service_missing
                activeSubscriptions:
                  - Belegbilderservice
                  - Rechnungsdatenservice 1.0
                details:
                  errors:
                    - message: 'RVO-Recht fehlt: Stammdaten'
            verbindungUngueltig:
              summary: 401 – DATEV-Verbindung ungültig (zur Referenz)
              value:
                error: >-
                  Die DATEV-Verbindung ist ungültig oder abgelaufen. Bitte im
                  Business OS Dashboard die Verbindung erneuern.
                code: datev_connection_invalid
                reconnectUrl: https://app.business-os.de/
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Dein Business OS API Key. Erstelle einen unter
        [app.business-os.de](https://app.business-os.de/) → API Keys.

````