API Playground

Test the delete attribute endpoint - use with caution

Authentication Required

You need to Login to test the API playground

Delete Custom Attribute

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.

Warning: Deleting an attribute will remove it from all products. Essential attributes cannot be deleted.
Note: This operation does not consume credits
Endpoint URL
DELETE https://api.commerceclarity.com/api/v1/attributes/delete/{id}

Path Parameters

Parameter Type Required Description
id string Required The unique attribute identifier (Attribute ID or attribute_id)

Request Examples

Basic Request
curl -X DELETE "https://api.commerceclarity.com/api/v1/attributes/delete/507f1f77bcf86cd799439011" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
PHP Example (Guzzle HTTP Client)
$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);
JavaScript Example (Fetch API)
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();

Response Example

Success Response
{
  "status": "success",
  "message": "Attribute deleted successfully"
}
Error Response - Validation
{
  "status": "error",
  "message": "Attribute not found",
  "code": 404
}
Error Response - Validation - Cannot Delete
{
  "status": "error",
  "message": "Cannot delete essential attribute",
  "code": 403
}