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

# Abonnement kündigen

Verwenden Sie diesen Endpunkt, um ein bestehendes Abonnement zu kündigen. Dadurch werden alle künftigen wiederkehrenden Zahlungen des Abonnements verhindert.

**Wichtige Hinweise:**

* Eine Kündigung führt nicht unbedingt zu einer Rückerstattung für die verbleibende Abonnementlaufzeit. Einzelheiten zu Rückerstattungen entnehmen Sie bitte Ihren Abonnementbedingungen.
* Kündigen Sie das Abonnement vor dem nächsten Abrechnungsdatum, um unerwünschte Belastungen zu vermeiden.
* Mit dem Endpunkt [Abonnementstatus abrufen](https://docs.localpayment.com/de/reference/transaction-status-error-codes) können Sie die Kündigung überprüfen.

Dieser Endpunkt erfordert eine gültige `subscriptionId`. Ein gekündigtes Abonnement kann nicht fortgesetzt werden. Wenn Sie den Service wieder aktivieren möchten, müssen Sie ein neues Abonnement erstellen.


## OpenAPI

````yaml openapi/de/localpayment.json PATCH /api/payin/subscriptions/{subscriptionId}/status
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/payin/subscriptions/{subscriptionId}/status:
    patch:
      summary: Abonnement kündigen
      operationId: cancel-subscription
      parameters:
        - name: Authorization
          in: header
          description: >-
            Bearer-Zugriffstoken zur Authentifizierung. Dieses Token erhalten
            Sie über die Endpunkte [Zugriffstoken
            abrufen](/de/reference/get-token) oder [Zugriffstoken
            aktualisieren](/de/reference/refresh-token).
          required: true
          schema:
            type: string
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  const: CANCEL
                  description: Ändert den Status auf `CANCELLED`.
              required:
                - status
              x-examples:
                Example 1:
                  status: CANCELLED
            examples:
              CANCELLED:
                value:
                  status: CANCELLED
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: >-
                      Eine von Ihrem System generierte eindeutige Kennung zur
                      Nachverfolgung der Transaktion (alphanumerische Zeichen
                      und Bindestriche). Wir empfehlen UUID4, um die
                      Eindeutigkeit sicherzustellen.
                  subscriptionId:
                    type: string
                    description: Eindeutige Kennung des Abonnements.
                  status:
                    type: object
                    title: status
                    description: Status des Vorgangs.
                    properties:
                      code:
                        type: string
                        description: >-
                          [Statuscode](/de/reference/transaction-status-error-codes).
                      description:
                        type: string
                        description: >-
                          [Statusbeschreibung](/de/reference/transaction-status-error-codes).
                      detail:
                        type: string
                        description: Zusätzliche Statusinformationen.
                  totalPayments:
                    type: integer
                    description: Gesamtzahl der mit dem Abonnement verknüpften Zahlungen.
                  pendingPayments:
                    type: integer
                    description: Anzahl der für das Abonnement noch ausstehenden Zahlungen.
                  creationDate:
                    type: string
                    description: >-
                      Datum und Uhrzeit der Erstellung des Abonnements. Das
                      Format muss eine gültige Datums-/Uhrzeitzeichenfolge sein
                      (z. B. ISO 8601).
                  payments:
                    type: array
                    description: >-
                      Array von Objekten, die die mit dem Abonnement verknüpften
                      Zahlungen darstellen.
                    items:
                      type: object
                  retries:
                    type: integer
                    description: >-
                      Anzahl der Wiederholungsversuche bei der Verarbeitung der
                      Abonnementzahlungen.
                x-examples:
                  Example 1:
                    externalId: '1623451995'
                    subscriptionId: 498e4a08-13a8-405e-96a5-eccb44345ada
                    status:
                      code: '903'
                      description: CANCELLED
                      detail: The subscription was canceled - merchant request
                    totalPayments: 2
                    pendingPayments: 2
                    creationDate: '2021-06-11T22:53:15.622+00:00'
                    payments: []
                    retries: 0
              examples:
                903 - The subscription was canceled:
                  value:
                    externalId: '1623451995'
                    subscriptionId: 498e4a08-13a8-405e-96a5-eccb44345ada
                    status:
                      code: '903'
                      description: CANCELLED
                      detail: The subscription was canceled - merchant request
        '400':
          description: Ungültige Anfrage.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    title: status
                    description: Status des Vorgangs.
                    properties:
                      code:
                        type: string
                        description: >-
                          [Statuscode](/de/reference/transaction-status-error-codes).
                      description:
                        type: string
                        description: >-
                          [Statusbeschreibung](/de/reference/transaction-status-error-codes).
                      detail:
                        type: string
                        description: Zusätzliche Statusinformationen.
                x-examples:
                  Example 1:
                    status:
                      code: '400'
                      description: ERROR
                      detail: Invalid operation
              examples:
                400 - Invalid operation:
                  value:
                    status:
                      code: '400'
                      description: ERROR
                      detail: Invalid operation
        '401':
          description: Nicht autorisiert.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Zusätzliche Informationen zur Antwort.
                  code:
                    type: string
                    description: Statuscode.
                  messages:
                    type: array
                    description: Liste der Meldungen.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token-Klasse.
                        token_type:
                          type: string
                          description: Token-Typ.
                        message:
                          type: string
                          description: Meldung mit zusätzlichen Informationen.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '404':
          description: Nicht gefunden
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    title: status
                    description: Status des Vorgangs.
                    properties:
                      code:
                        type: string
                        description: >-
                          [Statuscode](/de/reference/transaction-status-error-codes).
                      description:
                        type: string
                        description: >-
                          [Statusbeschreibung](/de/reference/transaction-status-error-codes).
                      detail:
                        type: string
                        description: Zusätzliche Statusinformationen.
                x-examples:
                  Example 1:
                    status:
                      code: '404'
                      description: ERROR
                      detail: Subscription not found
              examples:
                404 - Subscription not found:
                  value:
                    status:
                      code: '404'
                      description: ERROR
                      detail: Subscription not found
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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