> ## 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 Quittungs Nachfass

> Mail partners whose delivered message (NRR ok) has neither CONTRL
nor APERAK past the regulatory deadline (CONTRL AHB 2.3.1 / APERAK
AHB 2.4.1) plus the configured Karenz. Recipient: the EDIFACT contact
from their own PARTIN, BDEW list fallback. One mail per partner,
ledger-deduplicated per (partner, stream, sent_at).



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/market-partners/quittungs-nachfass
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/market-partners/quittungs-nachfass:
    post:
      summary: Post Quittungs Nachfass
      description: |-
        Mail partners whose delivered message (NRR ok) has neither CONTRL
        nor APERAK past the regulatory deadline (CONTRL AHB 2.3.1 / APERAK
        AHB 2.4.1) plus the configured Karenz. Recipient: the EDIFACT contact
        from their own PARTIN, BDEW list fallback. One mail per partner,
        ledger-deduplicated per (partner, stream, sent_at).
      operationId: >-
        post_quittungs_nachfass_v1_process_market_partners_quittungs_nachfass_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuittungsNachfassRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuittungsNachfassResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    QuittungsNachfassRequest:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          default: false
        limit:
          type: integer
          minimum: 0
          title: Limit
          default: 0
        lookback_days:
          type: integer
          maximum: 730
          minimum: 1
          title: Lookback Days
          default: 90
      type: object
      title: QuittungsNachfassRequest
      description: |-
        Chase partners whose delivered message (NRR ok) has neither CONTRL
        nor APERAK past the regulatory deadline plus Karenz.

        Deadlines per EDI@Energy: CONTRL 6h (CONTRL AHB Kap. 2.3.1); APERAK
        naechster Werktag 12 Uhr, UTILMD 45 Minuten (APERAK AHB Kap. 2.4.1).
        ``dry_run`` lists without mailing; ``limit`` caps mails per run
        (0 = uncapped).
    QuittungsNachfassResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
        lookback_days:
          type: integer
          title: Lookback Days
        limit:
          type: integer
          title: Limit
        targets:
          items:
            $ref: '#/components/schemas/QuittungsNachfassTarget'
          type: array
          title: Targets
        sent:
          items:
            $ref: '#/components/schemas/QuittungsNachfassTarget'
          type: array
          title: Sent
        skipped:
          items:
            $ref: '#/components/schemas/QuittungsNachfassTarget'
          type: array
          title: Skipped
      type: object
      required:
        - dry_run
        - lookback_days
        - limit
        - targets
        - sent
        - skipped
      title: QuittungsNachfassResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QuittungsNachfassTarget:
      properties:
        mp_id:
          type: string
          title: Mp Id
        name:
          type: string
          title: Name
        faelle:
          items:
            $ref: '#/components/schemas/QuittungsNachfassFall'
          type: array
          title: Faelle
        email:
          type: string
          title: Email
        kontakt_quelle:
          type: string
          enum:
            - partin
            - bdew
            - ''
          title: Kontakt Quelle
          default: ''
        skip:
          type: string
          title: Skip
          default: ''
      type: object
      required:
        - mp_id
        - name
        - faelle
        - email
      title: QuittungsNachfassTarget
    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
    QuittungsNachfassFall:
      properties:
        stream:
          type: string
          enum:
            - partin
            - zuordnung
          title: Stream
        sent_at:
          type: string
          title: Sent At
        frist:
          type: string
          title: Frist
        referenz:
          type: string
          title: Referenz
          description: Datenaustauschreferenz of the sent file
          default: ''
        nrr_at:
          type: string
          title: Nrr At
          description: Transport receipt timestamp
          default: ''
        nrr_id:
          type: string
          title: Nrr Id
          description: Transport receipt identifier
          default: ''
      type: object
      required:
        - stream
        - sent_at
        - frist
      title: QuittungsNachfassFall
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````