Skip to main content

Delete Customer

Permanently deletes a customer from the system.

HTTP Request

DELETE/api/customers/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the customer to delete

Example Requests

1import requests
2
3response = requests.delete('http://www.example.com/api/customers/123', 
4  headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.status_code)  # Should be 204 for successful deletion
7
8# Check if customer was deleted
9if response.status_code == 204:
10  print("Customer deleted successfully")
11elif response.status_code == 404:
12  print("Customer not found")
13else:
14  print(f"Error: {response.status_code}")

Status Codes

CodeDescription
204Customer deleted successfully
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Customer not found
409Conflict — customer has active orders or cannot be deleted
500Internal server error

Response Fields

FieldTypeDescription
NoneNoneNo content returned on successful deletion

Notes

    • This action permanently deletes the customer and cannot be undone
    • All customer data including addresses, order history, and personal information will be removed
    • Consider deactivating the customer (setting is_active to false) instead of deletion for data retention
    • Some systems may prevent deletion if the customer has active orders or pending transactions
    • Use this endpoint with extreme caution in production environments