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

# Terminate a contract.



## OpenAPI

````yaml /lumx_openapi.yaml post /v3/producers/{userID}/contracts/{contractID}/terminate/
openapi: 3.0.3
info:
  title: Lumenaza external API
  version: 3.8.0 (v3)
  description: Specification of the Lumenaza external API.
servers:
  - url: https://api.lumenaza.de/
    description: Produktivserver
  - url: https://api.test.lumenaza.de/
    description: Testserver
security: []
tags:
  - name: Community Data API
    description: >-
      The API is used to retrieve master data and measurement data for a
      community. A community is defined by all customers that belong to your
      company.
paths:
  /v3/producers/{userID}/contracts/{contractID}/terminate/:
    post:
      tags:
        - producers
      summary: Terminate a contract.
      operationId: producers_contracts_terminate_create
      parameters:
        - in: path
          name: contractID
          schema:
            type: string
            pattern: ^[\w-]+$
          required: true
        - in: path
          name: userID
          schema:
            type: string
            pattern: ^[\w-]+$
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractTerminationAPI'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ContractTerminationAPI'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ContractTerminationAPI'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailResponse'
              examples:
                200OK:
                  value:
                    detail: contract successfully terminated
                  summary: 200 OK
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractTerminationError'
              examples:
                TerminationDeadlinePassed:
                  value:
                    contract_end_date:
                      detail: termination deadline passed
                      possible_termination_date: '2024-12-31'
                  summary: Termination deadline passed
                TerminationDeadlinePassedForDeliveryStart:
                  value:
                    delivery_start:
                      detail: termination deadline passed
                      possible_termination_date: '2024-12-31'
                  summary: Termination deadline passed for delivery start
                TerminationDateHasToBeTheLastDayOfTheMonth:
                  value:
                    contract_end_date:
                      details:
                        - termination date has to be the last day of the month
                  summary: Termination date has to be the last day of the month
                ProvidedTerminationReasonNotAllowed:
                  value:
                    termination_reason:
                      - Invalid termination reason.
                  summary: Provided termination reason not allowed
          description: Invalid contract termination request.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
              examples:
                NotFound:
                  value:
                    detail: Not found.
                  summary: Not Found
          description: The requested contract could not be found.
components:
  schemas:
    ContractTerminationAPI:
      type: object
      properties:
        termination_reason:
          $ref: '#/components/schemas/TerminationReasonEnum'
        contract_end_date:
          type: string
          format: date
        force_contract_end_date:
          type: boolean
          default: false
        special_termination:
          type: boolean
          default: false
      required:
        - contract_end_date
        - termination_reason
    DetailResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    ContractTerminationError:
      oneOf:
        - $ref: '#/components/schemas/ContractTerminationContractEndDateError'
        - $ref: '#/components/schemas/ContractTerminationDeliveryStartError'
        - $ref: '#/components/schemas/ContractTerminationMonthEndError'
        - $ref: '#/components/schemas/ContractTerminationReasonError'
    NotFoundResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    TerminationReasonEnum:
      enum:
        - E01
        - E03
        - ZT4
        - ZT5
      type: string
      description: |-
        * `E01` - Einzug-/Auszug (Umzug) (E01)
        * `E03` - Wechsel (E03)
        * `ZT4` - Ende wegen Kündigung durch LF (ZT4)
        * `ZT5` - Ende wegen Kündigung durch Kunde/LFN (ZT5)
    ContractTerminationContractEndDateError:
      type: object
      properties:
        contract_end_date:
          $ref: '#/components/schemas/ContractTerminationDeadlineError'
      required:
        - contract_end_date
    ContractTerminationDeliveryStartError:
      type: object
      properties:
        delivery_start:
          $ref: '#/components/schemas/ContractTerminationDeadlineError'
      required:
        - delivery_start
    ContractTerminationMonthEndError:
      type: object
      properties:
        contract_end_date:
          $ref: '#/components/schemas/ContractTerminationDetailsError'
      required:
        - contract_end_date
    ContractTerminationReasonError:
      type: object
      properties:
        termination_reason:
          type: array
          items:
            type: string
      required:
        - termination_reason
    ContractTerminationDeadlineError:
      type: object
      properties:
        detail:
          type: string
        possible_termination_date:
          type: string
          format: date
      required:
        - detail
        - possible_termination_date
    ContractTerminationDetailsError:
      type: object
      properties:
        details:
          type: array
          items:
            type: string
      required:
        - details

````

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