Test the get family endpoint
Retrieve details of a specific family
This endpoint allows you to retrieve detailed information about a specific product family by providing its ID.
The response includes all family data including name, description, and configuration.
GET https://api.commerceclarity.com/api/v1/families/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Required | The unique family identifier (Family ID or family_id) |
curl -X GET "https://api.commerceclarity.com/api/v1/families/507f1f77bcf86cd799439011" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
$client = new \GuzzleHttp\Client();
$familyId = '507f1f77bcf86cd799439011';
$response = $client->get('https://api.commerceclarity.com/api/v1/families/' . $familyId, [
'headers' => [
'Authorization' => 'Bearer ' . $apiToken,
'Accept' => 'application/json',
]
]);
$data = json_decode($response->getBody(), true);
const familyId = '507f1f77bcf86cd799439011';
const response = await fetch(`https://api.commerceclarity.com/api/v1/families/${familyId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiToken}`,
'Accept': 'application/json'
}
});
const data = await response.json();
{
"status": "success",
"data": {
"_id": "507f1f77bcf86cd799439011",
"name": "Electronics",
"family_id": "electronics",
"description": "Electronic devices and accessories",
"is_enabled": true,
"user_id": "507f1f77bcf86cd799439010",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"status": "error",
"message": "Family not found",
"code": 404
}
The response contains complete family information:
| Field | Type | Description |
|---|---|---|
_id |
string | Unique family identifier |
name |
string | Display name of the family |
family_id |
string | Unique identifier string (slug) |
description |
string | Family description |
is_enabled |
boolean | Whether the family is active |
user_id |
string | User ID who owns the family |
created_at |
string | Product creation timestamp (ISO 8601) |
updated_at |
string | Last update timestamp (ISO 8601) |