Test the get attribute endpoint with an attribute ID.
Retrieve details of a specific custom attribute
This endpoint allows you to retrieve detailed information about a specific custom attribute by providing its ID or attribute_id.
The response includes the complete attribute configuration including type, scope, options (for select types), and metadata.
GET https://api.commerceclarity.com/api/v1/attributes/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Required | The attribute identifier. Can be either the Attribute ID or the attribute_id field value |
curl -X GET "https://api.commerceclarity.com/api/v1/attributes/color" \
-H "Authorization: Bearer YOUR_API_TOKEN"
$client = new \GuzzleHttp\Client();
$attributeId = 'color';
$response = $client->get("https://api.commerceclarity.com/api/v1/attributes/{$attributeId}", [
'headers' => [
'Authorization' => 'Bearer ' . $apiToken,
]
]);
$data = json_decode($response->getBody(), true);
const attributeId = 'color';
const response = await fetch(`https://api.commerceclarity.com/api/v1/attributes/${attributeId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiToken}`
}
});
const data = await response.json();
{
"status": "success",
"data": {
"_id": "507f1f77bcf86cd799439011",
"attribute_id": "color",
"name": "Color",
"type": "single-select",
"scope": "global",
"is_enabled": true,
"is_essential": false,
"description": "Product color attribute",
"options": ["Red", "Blue", "Green", "Yellow", "Black", "White"],
"user_id": "507f1f77bcf86cd799439010",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:15:00Z"
}
}
{
"status": "error",
"message": "Attribute not found"
}