# Delete Customer

- Sandbox: `DELETE https://sandbox.payme.io/api/customers/{guid}`
- Production: `DELETE https://live.payme.io/api/customers/{guid}`

## Credentials

- Header `Authorization: Bearer <token>`

Delete a customer by their unique PayMe identifier.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `guid` | path | string | yes | The unique PayMe customer identifier. |

## Code samples

### curl

```bash
curl -X DELETE 'https://sandbox.payme.io/api/customers/<guid>' \
  -H 'Authorization: Bearer <YOUR_TOKEN>'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/customers/<guid>", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <YOUR_TOKEN>",
  },
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.delete(
    "https://sandbox.payme.io/api/customers/<guid>",
    headers={
        "Authorization": "Bearer <YOUR_TOKEN>",
    },
)

print(response.text)
```

### PHP

```php
<?php

$ch = curl_init('https://sandbox.payme.io/api/customers/<guid>');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <YOUR_TOKEN>',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — Customer deleted successfully. (success)

| Field | Type | Description |
| --- | --- | --- |
| `message` | string | The success message. |
| `payme_guid` | string | The unique customer identifier. |

### 400 — Bad Request (error)

| Field | Type | Description |
| --- | --- | --- |
| `message` | string |  |
| `status_error_code` | integer |  |

### 401 — Unauthorized (error)

| Field | Type | Description |
| --- | --- | --- |
| `message` | string |  |
| `status_error_code` | integer |  |

### 500 — Internal Server Error (error)

| Field | Type | Description |
| --- | --- | --- |
| `message` | string |  |
| `status_error_code` | integer |  |
