{
  "openapi": "3.1.0",
  "info": {
    "title": "START_ENDE_ZUORDNUNG (NB)",
    "version": "202604",
    "description": "Das Ereignis `START_ENDE_ZUORDNUNG` der Marktrolle NB als eigenständige Spezifikation, abgeleitet aus der Auslöser-API der Formatversion 202604. Genau ein Pfad: `POST /inbound`; das Ereignis ergibt sich aus `zusatzdaten.eventname` im Rumpf."
  },
  "servers": [
    {
      "description": "Fake Env",
      "url": "https://api.macoapp.de"
    }
  ],
  "tags": [
    {
      "name": "START_ENDE_ZUORDNUNG"
    }
  ],
  "paths": {
    "/inbound": {
      "post": {
        "deprecated": false,
        "description": "Trigger-Event **START_ENDE_ZUORDNUNG** der Marktrolle NB.\n\n**Startet diese Rollensichten** (5):\n\n- [Fall 2: LF-Zuordnung bei EEG-Marktlokation mit DV-Pflicht — NB](/prozessdoku/202604/NB/GPKE-Teil2-fall-2-lf-zuordnung-bei-eeg-marktlokation-mit-dv-pflicht)\n- [Fall 3: LF-Zuordnung bei KWKG-Marktlokation mit DV-Pflicht bzw. Nicht-EEG-/Nicht-KWKG-Marktlokation und Marktlokation wird nicht-tranchiert abgebildet — NB](/prozessdoku/202604/NB/GPKE-Teil2-fall-3-lf-zuordnung-bei-kwkg-marktlokation-mit-dv-pflicht-bzw-nicht-eeg-nicht-kwkg-marktlokation-und-marktlokation-wird-nicht-tranchiert-abgebildet)\n- [Fall 4: LF-Zuordnung bei KWKG-Marktlokation mit DV-Pflicht bzw. Nicht-EEG-/Nicht-KWKG-Marktlokation und Marktlokation wird tranchiert abgebildet — NB](/prozessdoku/202604/NB/GPKE-Teil2-fall-4-lf-zuordnung-bei-kwkg-marktlokation-mit-dv-pflicht-bzw-nicht-eeg-nicht-kwkg-marktlokation-und-marktlokation-wird-tranchiert-abgebildet)\n- [Lieferbeginn — NB](/prozessdoku/202604/NB/GPKE-Teil2-lieferbeginn)\n- [Lieferende von NB an LF — NB](/prozessdoku/202604/NB/GPKE-Teil2-lieferende-von-nb-an-lf)\n\n<a href=\"/apis/einzeln/202604/nb/START_ENDE_ZUORDNUNG.json\" data-maco=\"einzelschema\" download target=\"_blank\">Schema nur dieses Ereignisses herunterladen</a> (OpenAPI, JSON).\n\n<Hinweisbereich>\n\nDer Aufruf geht tatsächlich an `POST /inbound`; das Event ergibt sich aus `zusatzdaten.eventname` im Rumpf. Diese Seite trennt eine von 105 Rumpfvarianten heraus, damit sie einzeln lesbar und ausprobierbar sind.\n\n</Hinweisbereich>",
        "operationId": "trigger_NB_START_ENDE_ZUORDNUNG",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NB_START_ENDE_ZUORDNUNG"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_responses_success"
                }
              }
            },
            "description": "Erfolg | Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/event_response_fail"
                }
              }
            },
            "description": "Fehler | Fail"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "START_ENDE_ZUORDNUNG (NB)",
        "tags": [
          "START_ENDE_ZUORDNUNG"
        ],
        "x-actual-endpoint": "POST /inbound",
        "x-event-source": "event/202604/[NB]_START_ENDE_ZUORDNUNG.yaml",
        "x-handbuchsatz": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "type": "http"
      }
    },
    "schemas": {
      "Marktrolle": {
        "description": "Diese Rollen kann ein Marktteilnehmer einnehmen",
        "enum": [
          "NB",
          "LF",
          "MSB",
          "MSBA",
          "GMSB",
          "MDL",
          "DL",
          "BKV",
          "BKO",
          "UENB",
          "KUNDE-SELBST-NN",
          "MGV",
          "EIV",
          "RB",
          "KUNDE",
          "INTERESSENT",
          "KN",
          "UBA",
          "BIKO",
          "ESA"
        ],
        "title": "Marktrolle",
        "type": "string"
      },
      "NB_START_ENDE_ZUORDNUNG": {
        "properties": {
          "stammdaten": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PI_55037__stammdaten"
              },
              {
                "$ref": "#/components/schemas/PI_55611__stammdaten"
              }
            ]
          },
          "transaktionsdaten": {
            "properties": {
              "absender": {
                "properties": {
                  "rollencodenummer": {
                    "$ref": "#/components/schemas/rollencodenummer"
                  }
                },
                "type": "object"
              },
              "empfaenger": {
                "properties": {
                  "marktrolle": {
                    "$ref": "#/components/schemas/marktrolle"
                  },
                  "rollencodenummer": {
                    "$ref": "#/components/schemas/rollencodenummer"
                  }
                },
                "type": "object"
              },
              "pruefidentifikator": {
                "description": "Wird dynamisch im Event-Prozess ermittelt (Entscheidungsgrundlage: marktrolle). Ein vom Sender mitgegebener Wert wird ignoriert. Im Topic mögliche Prüfis — 55037, 55611.",
                "examples": [
                  "55037",
                  "55611"
                ]
              },
              "sparte": {
                "$ref": "#/components/schemas/sparte"
              },
              "transaktionsgrund": {
                "$ref": "#/components/schemas/transaktionsgrund"
              },
              "transaktionsgrundergaenzung": {
                "$ref": "#/components/schemas/transaktionsgrundergaenzung"
              }
            },
            "required": [
              "absender",
              "empfaenger",
              "sparte",
              "transaktionsgrund",
              "transaktionsgrundergaenzung"
            ],
            "type": "object"
          },
          "zusatzdaten": {
            "properties": {
              "eventname": {
                "const": "START_ENDE_ZUORDNUNG",
                "default": "START_ENDE_ZUORDNUNG",
                "type": "string"
              },
              "prozessId": {
                "type": "string"
              }
            },
            "required": [
              "prozessId",
              "eventname"
            ],
            "type": "object"
          }
        },
        "required": [
          "stammdaten",
          "transaktionsdaten",
          "zusatzdaten"
        ],
        "type": "object"
      },
      "PI_55037__stammdaten": {
        "properties": {
          "MARKTLOKATION": {
            "items": {
              "$ref": "#/components/schemas/PI_55037__stammdaten__MARKTLOKATION"
            },
            "type": "array"
          },
          "NETZNUTZUNGSVERTRAG": {
            "items": {
              "$ref": "#/components/schemas/PI_55037__stammdaten__NETZNUTZUNGSVERTRAG"
            },
            "type": "array"
          },
          "TRANCHE": {
            "items": {
              "$ref": "#/components/schemas/PI_55037__stammdaten__TRANCHE"
            },
            "type": "array"
          }
        },
        "type": "object",
        "title": "55037"
      },
      "PI_55037__stammdaten__MARKTLOKATION": {
        "properties": {
          "marktlokationsId": {
            "$ref": "#/components/schemas/marktlokationsId",
            "x-edifact-segment": [
              "SG4.IDE+24.SG5.LOC+Z16"
            ]
          }
        },
        "type": "object"
      },
      "PI_55037__stammdaten__NETZNUTZUNGSVERTRAG": {
        "properties": {
          "vertragsende": {
            "$ref": "#/components/schemas/vertragsende",
            "x-edifact-segment": [
              "SG4.IDE+24.DTM+93"
            ]
          }
        },
        "type": "object"
      },
      "PI_55037__stammdaten__TRANCHE": {
        "properties": {
          "tranchenId": {
            "$ref": "#/components/schemas/tranchenId",
            "x-edifact-segment": [
              "SG4.IDE+24.SG5.LOC+Z21"
            ]
          }
        },
        "type": "object"
      },
      "PI_55611__stammdaten": {
        "properties": {
          "MARKTLOKATION": {
            "items": {
              "$ref": "#/components/schemas/PI_55611__stammdaten__MARKTLOKATION"
            },
            "type": "array"
          },
          "MESSLOKATION": {
            "items": {
              "$ref": "#/components/schemas/PI_55611__stammdaten__MESSLOKATION"
            },
            "type": "array"
          },
          "NETZNUTZUNGSVERTRAG": {
            "items": {
              "$ref": "#/components/schemas/PI_55611__stammdaten__NETZNUTZUNGSVERTRAG"
            },
            "type": "array"
          }
        },
        "type": "object",
        "title": "55611"
      },
      "PI_55611__stammdaten__MARKTLOKATION": {
        "properties": {
          "marktlokationsId": {
            "$ref": "#/components/schemas/marktlokationsId",
            "x-edifact-segment": [
              "SG4.IDE+24.SG5.LOC+Z16"
            ]
          }
        },
        "type": "object"
      },
      "PI_55611__stammdaten__MESSLOKATION": {
        "properties": {
          "messlokationsId": {
            "$ref": "#/components/schemas/messlokationsId",
            "x-edifact-segment": [
              "SG4.IDE+24.SG5.LOC+Z17"
            ]
          }
        },
        "type": "object"
      },
      "PI_55611__stammdaten__NETZNUTZUNGSVERTRAG": {
        "properties": {
          "vertragsbeginn": {
            "$ref": "#/components/schemas/vertragsbeginn",
            "x-edifact-segment": [
              "SG4.IDE+24.DTM+92"
            ]
          },
          "vertragsende": {
            "$ref": "#/components/schemas/vertragsende",
            "x-edifact-segment": [
              "SG4.IDE+24.DTM+93"
            ]
          }
        },
        "type": "object"
      },
      "Sparte": {
        "description": "Sparte",
        "enum": [
          "STROM",
          "GAS",
          "FERNWAERME",
          "NAHWAERME",
          "WASSER",
          "ABWASSER"
        ],
        "title": "Sparte",
        "type": "string"
      },
      "event_response_fail": {
        "description": "Fehlermeldung auf Prozessdaten API Aufruf | Error message on process data API call",
        "properties": {
          "errorCode": {
            "description": "Error identifier",
            "example": "400",
            "type": "string"
          },
          "message": {
            "description": "Technische Meldung | Technische Meldung",
            "example": "Validation Failed",
            "type": "string"
          }
        },
        "type": "object"
      },
      "event_responses_success": {
        "description": "Erfolgsmeldung auf Prozessdaten API Aufruf | Success message on process data API call",
        "properties": {
          "businessKey": {
            "description": "Einzigartige Kennung des Geschäftsprozesses | Unique identifier of the business process",
            "format": "uuid",
            "type": "string"
          },
          "message": {
            "description": "Nachricht mit Details zum ausgelösten Event | Message with details about the triggered event",
            "example": "received event XXXXXXXXXXXX with id at 2024-08-08T12:58:22Z and started process with businessKey 4c7170ed-3518-41ee-8582-39ab65b00107",
            "type": "string"
          }
        },
        "required": [
          "businessKey",
          "message"
        ],
        "type": "object"
      },
      "marktlokationsId": {
        "description": "Identifikationsnummer einer Marktlokation, an der Energie entweder\nverbraucht, oder erzeugt wird",
        "type": "string"
      },
      "marktrolle": {
        "$ref": "#/components/schemas/Marktrolle",
        "description": "Gibt im Klartext die Bezeichnung der Marktrolle an."
      },
      "messlokationsId": {
        "description": "Die Messlokations-Identifikation. Das ist die frühere Zählpunktbezeichnung,\nz.B. DE 47108151234567",
        "type": "string"
      },
      "rollencodenummer": {
        "description": "Gibt die Codenummer der Marktrolle an.",
        "type": "string"
      },
      "sparte": {
        "$ref": "#/components/schemas/Sparte",
        "description": "Enthält Informationen über die Sparte"
      },
      "tranchenId": {
        "description": "tranchenId",
        "type": "string"
      },
      "transaktionsgrund": {
        "description": "Der Transaktionsgrund beschreibt den Geschäftsvorfall zur Kategorie genauer / UTILMD STS+7++###+ZW4+E03",
        "type": "string"
      },
      "transaktionsgrundergaenzung": {
        "description": "Ergänzung zum Transaktionsgrund / UTILMD STS+7++E01+###+E03",
        "type": "string"
      },
      "vertragsbeginn": {
        "description": "Gibt an, wann der Vertrag beginnt.",
        "format": "date-time",
        "type": "string"
      },
      "vertragsende": {
        "description": "Datum Vertragsende / DTM+93",
        "format": "date-time",
        "type": "string"
      }
    }
  }
}