# Delete a customer Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: `DELETE https://payme-store-staging.payme.io/api/customers/{guid}` - Production: `DELETE https://payme-store.payme.io/api/customers/{guid}` ## Credentials - Header `Authorization: Bearer ` Deletes one of the seller's customers. Deleted customers no longer appear in lists or reads, and their `guid` returns `404`. The call has no request body and returns `204 No Content`. Send `Authorization: Bearer `, the token from [`POST /auth-tokens`](/products-and-customers/authentication/post-auth-token). Hosts, tokens and the error format: [Hosts, authentication and errors](/products-and-customers/authentication). ## Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `guid` | path | string | yes | The customer `guid` (a UUID) that `POST /customers` returned. Any other format returns `400`. | ## Code samples ### curl ```bash curl -X DELETE 'https://payme-store-staging.payme.io/api/customers/' \ -H 'Authorization: Bearer ' ``` ### Node.js ```javascript const response = await fetch("https://payme-store-staging.payme.io/api/customers/", { method: "DELETE", headers: { "Authorization": "Bearer ", }, }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.delete( "https://payme-store-staging.payme.io/api/customers/", headers={ "Authorization": "Bearer ", }, ) print(response.text) ``` ### PHP ```php '); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ', ], ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 204 — Customer deleted. The response has no body. (success) ### 400 — `guid` isn't a UUID. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Validation failed (uuid is expected)", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 401 — The `Authorization` header is missing, or the access token is invalid or expired. Get a new token with `POST /refresh-exchanges` or `POST /auth-tokens`. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Unauthorized", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 404 — The customer doesn't exist, was deleted, or belongs to another seller. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Customer not found", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 500 — Server error. Contact PayMe support and quote the `session`. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. |