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

# Delete a Customer

> Deletes a customer with given customer key



## OpenAPI

````yaml DELETE /api/v1/customers/{customer_key}
openapi: 3.0.1
info:
  title: Metrifox API Documentation
  version: v1
  description: >-
    Welcome to Metrifox Platform's API documentation. This comprehensive API
    suite enables seamless integration with our platform, providing secure and
    efficient access to our services.
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.metrifox.com
security:
  - api_key: []
paths:
  /api/v1/customers/{customer_key}:
    delete:
      tags:
        - Customers
      summary: Deletes a customer
      description: >
        Deletes a customer with the given customer key. This action is
        irreversible.


        **Important Notes:**

        - This action permanently removes the customer and all associated data

        - The operation cannot be undone

        - Make sure to backup any important data before deletion
      operationId: deleteCustomer
      parameters:
        - name: customer_key
          in: path
          required: true
          description: Unique identifier of the customer in your application to delete
          schema:
            type: string
          example: acme-corp-001
      responses:
        '200':
          description: Customer deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Customer deleted successfully
              examples:
                delete_success:
                  summary: Customer Deleted Successfully
                  value:
                    message: Customer deleted successfully
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Customer not found
                errors:
                  customer_key:
                    - Customer with key 'acme-corp-001' does not exist
        '409':
          description: Conflict - Customer cannot be deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Customer cannot be deleted
                errors:
                  reason:
                    - Customer has active subscriptions or outstanding invoices
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |
            from metrifox_sdk import MetrifoxClient

            client = MetrifoxClient(api_key="your_api_key")

            # Delete a customer
            customer_key = "your_customer_unique_id"
            response = client.customers.delete(customer_key)
        - lang: javascript
          label: Javascript SDK
          source: |
            import { init } from "metrifox-js";

            const metrifoxClient = init({
              apiKey: process.env.METRIFOX_API_KEY
            });

            // Delete a customer
            const customerKey = 'your_customer_unique_id';
            const response = await metrifoxClient.customers.delete(customerKey);
        - lang: ruby
          label: Ruby SDK
          source: >
            require 'metrifox-sdk'


            # Initialize with configuration

            METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })


            # Delete a customer

            response = METRIFOX_SDK.customers.delete_customer({ customer_key:
            'your_customer_unique_id' })
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: object
          additionalProperties: true
          description: Detailed error information
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````