---
title: "Delete Customer"
source_url: https://docs.rapyd.net/en/delete-customer.html
lang: en
---

# Delete Customer

Delete a customer profile.

This method triggers the [Customer Deleted Webhook](https://docs.rapyd.net/en/customer-deleted-webhook.md "Customer Deleted Webhook"). This webhook contains the same information as the response.

> **Note:**
>
> - The code samples include successful requests (200) and bad requests (400).
>
>   - For error messages that appear due to bad requests (400), see:
>
>     - [General Errors](https://docs.rapyd.net/en/general-errors.md "General Errors")
>     - [Customer Errors](https://docs.rapyd.net/en/customer-errors.md "Customer Errors")
>   - For information about unauthorized request (401) and other authentication errors, see [Troubleshooting Authentication and Authorization Errors](https://docs.rapyd.net/en/troubleshooting-authentication-and-authorization-errors.md "Troubleshooting Authentication and Authorization Errors").

### Parameters

### Request Path Parameters

- - - customer
    - ID of the customer profile. String starting with **cus_**.

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - id
  - The unique identifier (ID) of the customer record that was deleted. Starts with `cus_`.
- - deleted
  - A flag indicating the status of the request. Returns `true` if the customer was successfully removed.

### Code Samples

- - .NET

    - ```csharp
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string customerId = "cus_d0a21d402a105c38f75948d9500d07a1";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/customers/{customerId}");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest(
            'DELETE',
            '/v1/customers/cus_f3923ec56a56578b6a18df24d4f32d54'
          );

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('delete', "/v1/customers/cus_5861b2ec3e7441bfd43756bb491ddf10");
          var_dump($object);
      } catch (Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      result = make_request(method='delete', path=f'/v1/customers/cus_81b7f135ed36ea4f7e897a793394a5b2')
      pprint(result)
      ```

- /v1/customers/:customer

- Delete Customer
- ```curl
  curl -X delete 'https://sandboxapi.rapyd.net/v1/customers/cus_217f61d6757465a9716666ccf4d3ec73' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "20710469-428f-4026-bb34-f1db6acdab7e"
      },
      "data": {
          "deleted": true,
          "id": "cus_710c5b61d429412d50bbd183cb5aeb64"
      }
  }
  ```
