---
updatedAt: 2025-08-12T18:55:16.000Z
agentTools:
  projectIndex: https://docs.staxpayments.com/llms.txt
---

# Delete a Customer

To soft delete a customer

The **Delete a Customer** endpoint allows merchants to soft delete a customer from their records. A soft delete means the customer record is not permanently removed from the database but is hidden from general queries and marked as deleted by setting a `deleted_at` timestamp.

***

## Key Features

* **Soft Deletion**: Hides the customer record from standard queries while preserving it in the database.
* **Retrievable**: Deleted customers can still be retrieved using their unique `customer_id`.
* **Auditability**: The `deleted_at` field indicates when the deletion occurred for tracking purposes.

***

## Usage Notes

**One Record Per Call**: This endpoint processes one customer record at a time. Batch deletions are not supported.

**Retrieving Deleted Records**: Use the [Get a Customer's Information](https://docs.staxpayments.com/reference/get-a-customers-information) endpoint with the specific `customer_id` to view deleted records.

**Impact on Transactions**: Deleting a customer does not affect their historical transactions or associated payment methods.

***

## Response Structure

| Code | Response              | Description                                        |
| ---- | --------------------- | -------------------------------------------------- |
| 200  | Success               | The customer was successfully deleted.             |
| 400  | Bad Request           | Invalid or missing fields in the request.          |
| 401  | Unauthorized          | API key invalid or missing.                        |
| 404  | Not Found             | No customer found with the provided `customer_id`. |
| 500  | Internal Server Error | An unexpected error occurred on the server.        |

***

## Important Considerations

**Deleted Status**: A deleted customer record will have a non-null `deleted_at` field.

**Permanence**: Soft deletions can only be reversed by contacting Stax support.

**Associated Data**: Deleting a customer does not delete their payment methods or transactions, ensuring financial records remain intact.

**Access Control**: Only merchants with the appropriate API key for the customer's account can perform deletions.

***

## Best Practices

* Use this endpoint when a customer is no longer active but their records need to remain intact for compliance or audit purposes.
* Keep track of deleted customer records to avoid accidental re-creation or data duplication.
* Log deletion requests for audit and recovery purposes.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "stax-api",
    "version": "0.1"
  },
  "servers": [
    {
      "url": "https://apiprod.fattlabs.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "API key for merchant-level operations. Provides access to merchant-specific endpoints including transactions, payments, customer management, and merchant account settings. This key is scoped to a single merchant account and cannot access partner-level functionality."
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/customer/{id}": {
      "delete": {
        "summary": "Delete a Customer",
        "description": "To soft delete a customer",
        "operationId": "delete-a-customer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"d45ee88c-8b27-4be8-8d81-77dda1b81826\",\n  \"firstname\": \"John\",\n  \"lastname\": \"Smith\",\n  \"company\": \"ABC INC\",\n  \"email\": \"demo@abc.com\",\n  \"cc_emails\": [\n    \"demo1@abc.com\",\n    \"demo2@abc.com\"\n  ],\n  \"phone\": \"1234567898\",\n  \"address_1\": \"123 Rite Way\",\n  \"address_2\": \"Unit 12\",\n  \"address_city\": \"Orlando\",\n  \"address_state\": \"FL\",\n  \"address_zip\": \"32801\",\n  \"address_country\": \"USA\",\n  \"notes\": null,\n  \"reference\": \"BARTLE\",\n  \"options\": null,\n  \"created_at\": \"2017-05-08 19:22:51\",\n  \"updated_at\": \"2017-05-08 19:23:46\",\n  \"deleted_at\": \"2020-03-29 15:46:00\",\n  \"gravatar\": \"//www.gravatar.com/avatar/fe3e929dd80f1653c3a4b82812660061\",\n  \"has_address\": true,\n  \"missing_address_components\": []\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "d45ee88c-8b27-4be8-8d81-77dda1b81826"
                    },
                    "firstname": {
                      "type": "string",
                      "example": "John"
                    },
                    "lastname": {
                      "type": "string",
                      "example": "Smith"
                    },
                    "company": {
                      "type": "string",
                      "example": "ABC INC"
                    },
                    "email": {
                      "type": "string",
                      "example": "demo@abc.com"
                    },
                    "cc_emails": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "demo1@abc.com"
                      }
                    },
                    "phone": {
                      "type": "string",
                      "example": "1234567898"
                    },
                    "address_1": {
                      "type": "string",
                      "example": "123 Rite Way"
                    },
                    "address_2": {
                      "type": "string",
                      "example": "Unit 12"
                    },
                    "address_city": {
                      "type": "string",
                      "example": "Orlando"
                    },
                    "address_state": {
                      "type": "string",
                      "example": "FL"
                    },
                    "address_zip": {
                      "type": "string",
                      "example": "32801"
                    },
                    "address_country": {
                      "type": "string",
                      "example": "USA"
                    },
                    "notes": {},
                    "reference": {
                      "type": "string",
                      "example": "BARTLE"
                    },
                    "options": {},
                    "created_at": {
                      "type": "string",
                      "example": "2017-05-08 19:22:51"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2017-05-08 19:23:46"
                    },
                    "deleted_at": {
                      "type": "string",
                      "example": "2020-03-29 15:46:00"
                    },
                    "gravatar": {
                      "type": "string",
                      "example": "//www.gravatar.com/avatar/fe3e929dd80f1653c3a4b82812660061"
                    },
                    "has_address": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "missing_address_components": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"customer not found\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "customer not found"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```