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

# Post Bestellung

> Send one MaBiS order via the MakoFlow AS4 gateway; the exact
interchange lands in the audit trail. An Ab-/Bestellung of the
aggregation level past its deadline (2 WT before the month) is refused.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/bestellungen
openapi: 3.1.0
info:
  title: n:lead Scheduling Bridge — Internal API
  version: 0.4.0
  description: >-
    Internal API of the n:lead scheduling bridge: the process endpoints that
    drive the day-ahead pipeline (aggregate, publish the open position, submit
    schedules, generate forecasts, orchestrate), the operator console endpoints,
    and the read-only operator-app endpoints under /v1/mobile. The process and
    console endpoints require the process API key, /v1/mobile a device key of
    the mobile scope; not for customer use.
servers:
  - url: https://{host}
    description: Deployed service
    variables:
      host:
        default: api.energy.nlead.ch
        description: >-
          The service hostname - n:lead provides it (see the Base URL on the API
          introduction page)
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/process/bestellungen:
    post:
      summary: Post Bestellung
      description: |-
        Send one MaBiS order via the MakoFlow AS4 gateway; the exact
        interchange lands in the audit trail. An Ab-/Bestellung of the
        aggregation level past its deadline (2 WT before the month) is refused.
      operationId: post_bestellung_v1_process_bestellungen_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BestellungRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BestellungSendResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    BestellungRequest:
      properties:
        prozess:
          type: string
          enum:
            - bilanzkreiszuordnungsliste
            - clearingliste_bas
            - aggregationsebene_rz
          title: Prozess
        modus:
          type: string
          enum:
            - abo_start
            - abo_ende
            - einmalig
          title: Modus
          default: einmalig
        control_area:
          anyOf:
            - $ref: '#/components/schemas/ControlArea'
            - type: 'null'
        receiver_mp_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Receiver Mp Id
        bilanzkreis_eic:
          anyOf:
            - type: string
            - type: 'null'
          title: Bilanzkreis Eic
        ausfuehrung:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Ausfuehrung
          description: >-
            DTM+203: from when a subscription or level change applies (midnight
            Europe/Berlin); the 1st of a month for aggregationsebene_rz
        monat:
          anyOf:
            - type: string
            - type: 'null'
          title: Monat
          description: YYYY-MM - the month of a one-off list or of the BAS
        gebiet_eic:
          anyOf:
            - type: string
            - type: 'null'
          title: Gebiet Eic
        zaehlpunkt:
          anyOf:
            - type: string
            - type: 'null'
          title: Zaehlpunkt
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      type: object
      required:
        - prozess
      title: BestellungRequest
      description: |-
        One of the BKV's three MaBiS orders (ORDERS AHB 1.1b ch. 5).

        * ``bilanzkreiszuordnungsliste`` (PID 17203, to an ÜNB or NB): the list
          of the balance group's active MaBiS-Zählpunkte. ``abo_start`` /
          ``abo_ende`` start or end a subscription from ``ausfuehrung``;
          ``einmalig`` asks once for ``monat`` and one ``gebiet_eic`` (the
          Regelzone for an ÜNB - defaulted - or the NB's Bilanzierungsgebiet).
          Answer: UTILMD 55067.
        * ``clearingliste_bas`` (PID 17204, to the BIKO): the clearing list of
          one BAS version - ``einmalig`` only, with ``monat`` and ``version``;
          ``zaehlpunkt`` defaults to the BAS the BIKO activated for the balance
          group. Answer: UTILMD 55070.
        * ``aggregationsebene_rz`` (PID 17207, to the ÜNB): ``abo_start`` orders
          the BK-SZR (Kategorie B) on control-area level (Z98), ``abo_ende``
          cancels it so it comes per Bilanzierungsgebiet (Z99) only - from
          ``ausfuehrung``, the 1st of a month, sent at the latest 2 WT before
          it. Only a refusal answers (ORDRSP 19204).

        ``receiver_mp_id`` defaults to the ÜNB (17203/17207) or BIKO (17204) of
        ``control_area`` from the BDEW register, ``control_area`` to the home
        control area, ``bilanzkreis_eic`` to our balance group there.
    BestellungSendResponse:
      properties:
        pruefidentifikator:
          type: string
          title: Pruefidentifikator
        prozess:
          type: string
          title: Prozess
        modus:
          type: string
          title: Modus
        receiver_mp_id:
          type: string
          title: Receiver Mp Id
        interchange_ref:
          type: string
          title: Interchange Ref
        document_number:
          type: string
          title: Document Number
        ingress_status:
          type: integer
          title: Ingress Status
        attempt:
          type: integer
          title: Attempt
          default: 0
        status:
          type: string
          const: sent
          title: Status
          default: sent
      type: object
      required:
        - pruefidentifikator
        - prozess
        - modus
        - receiver_mp_id
        - interchange_ref
        - document_number
        - ingress_status
      title: BestellungSendResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ControlArea:
      type: string
      enum:
        - 50Hertz
        - Amprion
        - TenneT
        - TransnetBW
      title: ControlArea
      description: The four German TSO control areas (Regelzonen).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.