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

# Delete customer

> Deletes a customer. The customer can only be deleted if there are no invoices, active subscriptions or booked payments related to this customer. Otherwise you can only archive the customer.

<sup>Required permissions: `customer:write`</sup>



## OpenAPI

````yaml delete /customers/{id}
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /customers/{id}:
    parameters: []
    delete:
      tags:
        - Customer
      summary: Delete customer
      description: >-
        Deletes a customer. The customer can only be deleted if there are no
        invoices, active subscriptions or booked payments related to this
        customer. Otherwise you can only archive the customer.


        <sup>Required permissions: `customer:write`</sup>
      operationId: deleteCustomer
      parameters:
        - name: id
          in: path
          description: Customer identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      responses:
        '204':
          description: The customer was deleted.
        '404':
          description: Resource not found
        '422':
          description: The customer could not be deleted due missing preconditions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://tools.ietf.org/html/rfc2616#section-10
                  detail:
                    type: string
                    example: >-
                      The customer could not be deleted due missing
                      preconditions.
                  violations:
                    type: array
                    items:
                      type: object
                      properties:
                        propertyPath:
                          type: string
                          example: ''
                        message:
                          type: string
                          example: The customer has active invoices.
                        code:
                          type: string
                          enum:
                            - customer_has_invoices
                            - customer_has_active_subscriptions
                            - customer_has_booked_transactions
                            - customer_has_completed_carts
                            - customer_deletion_error
                          description: >-
                            * `customer_has_invoices`: The customer has
                            invoices.`

                            * `customer_has_active_subscriptions`: The customer
                            has active subscriptions which needs to be canceled
                            before.`

                            * `customer_has_booked_transactions`: The customer
                            has booked transactions.`

                            * `customer_has_completed_carts`: The customer has
                            completed carts.`

                            * `customer_deletion_error`: An error occurred while
                            deleting the customer.
      deprecated: false
      security:
        - JWT:
            - customer:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X DELETE \
             /customers/{id} \
             --header "Authorization: Bearer <token>"
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````