> ## 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 Quittung Import

> Import a CONTRL/APERAK a partner forwarded by mail because their AS4
delivery never reached our inbox. The acknowledgment is bound to the
message it answers (UCI / RFF+ACE) exactly like one from the inbox:
the partner book shows the stream acknowledged, a Nachversand
Vormerkung it answers is settled, the search lists it as a mail
attachment. Idempotent per Datenaustauschreferenz.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/edifact/quittung-import
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) and the operator console
    endpoints. Requires the process API key; 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/edifact/quittung-import:
    post:
      summary: Post Quittung Import
      description: |-
        Import a CONTRL/APERAK a partner forwarded by mail because their AS4
        delivery never reached our inbox. The acknowledgment is bound to the
        message it answers (UCI / RFF+ACE) exactly like one from the inbox:
        the partner book shows the stream acknowledged, a Nachversand
        Vormerkung it answers is settled, the search lists it as a mail
        attachment. Idempotent per Datenaustauschreferenz.
      operationId: post_quittung_import_v1_process_edifact_quittung_import_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuittungImportRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuittungImportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    QuittungImportRequest:
      properties:
        edifact:
          type: string
          minLength: 40
          title: Edifact
          description: The complete interchange
      type: object
      required:
        - edifact
      title: QuittungImportRequest
      description: |-
        Import a CONTRL/APERAK that reached us outside AS4 (a partner
        forwarded it by mail). Bound to the message it answers like an inbox
        acknowledgment; keyed by its Datenaustauschreferenz, so re-importing
        is a no-op.
    QuittungImportResponse:
      properties:
        referenz:
          type: string
          title: Referenz
          description: Datenaustauschreferenz of the acknowledgment
        edi_type:
          type: string
          title: Edi Type
        sender:
          type: string
          title: Sender
        recipient:
          type: string
          title: Recipient
        date:
          type: string
          title: Date
        bezug:
          type: string
          title: Bezug
          description: The interchange it answers
        verdict:
          type: string
          title: Verdict
          description: '`positiv` or `negativ`'
        grund:
          type: string
          title: Grund
          default: ''
        nachrichten:
          type: integer
          title: Nachrichten
          description: Messages (UNH) in the interchange
        neu:
          type: boolean
          title: Neu
          description: False when this reference was already imported
      type: object
      required:
        - referenz
        - edi_type
        - sender
        - recipient
        - date
        - bezug
        - verdict
        - nachrichten
        - neu
      title: QuittungImportResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````