v2 is generally available. See what changed
Skip to content
Acme Commerce API Menu

Delete a customer

DELETE /api/v2/customers/{customer} Requires authentication v2

Send a bearer token in the Authorization header.

Permanently removes the customer and anonymises their orders. Prefer archiving via the update endpoint.

Full URL: https://api.acme.example/api/v2/customers/{customer}

Path parameters

Name Type Required Description
customer integer yes The customer id.

Responses

204 Deleted.

No response body.

409 The customer has an open order and cannot be deleted.

Example request

cURL
curl -X DELETE 'https://api.acme.example/api/v2/customers/1' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
JavaScript
const response = await fetch('https://api.acme.example/api/v2/customers/1', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Accept': 'application/json'
  }
});

const data = await response.json();
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Authorization' => 'Bearer YOUR_TOKEN',
    'Accept' => 'application/json',
])->delete('https://api.acme.example/api/v2/customers/1');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('DELETE', 'https://api.acme.example/api/v2/customers/1', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_TOKEN',
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);

Free while you are building.

Get an API key

This page as Markdown, or the whole API as OpenAPI. Ask ChatGPT Ask Claude