Test the delete attribute endpoint - use with caution
Permanently delete a custom attribute
This endpoint allows you to permanently delete a custom attribute by providing its ID.
Once deleted, the attribute cannot be recovered. All product data using this attribute will no longer have access to it.
DELETE https://api.commerceclarity.com/api/v1/attributes/delete/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Required | The unique attribute identifier (Attribute ID or attribute_id) |
curl -X DELETE "https://api.commerceclarity.com/api/v1/attributes/delete/507f1f77bcf86cd799439011" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
$client = new \GuzzleHttp\Client();
$attributeId = '507f1f77bcf86cd799439011';
$response = $client->delete('https://api.commerceclarity.com/api/v1/attributes/delete/' . $attributeId, [
'headers' => [
'Authorization' => 'Bearer ' . $apiToken,
'Accept' => 'application/json',
]
]);
$data = json_decode($response->getBody(), true);
const attributeId = '507f1f77bcf86cd799439011';
const response = await fetch(`https://api.commerceclarity.com/api/v1/attributes/delete/${attributeId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${apiToken}`,
'Accept': 'application/json'
}
});
const data = await response.json();
{
"status": "success",
"message": "Attribute deleted successfully"
}
{
"status": "error",
"message": "Attribute not found",
"code": 404
}
{
"status": "error",
"message": "Cannot delete essential attribute",
"code": 403
}