Attribute Group API
Overview
The Attribute Group API allows you to manage product attribute groups in your EverShop store. Attribute groups help organize product attributes into logical categories, making product management more efficient and structured.
Endpoints
Create an Attribute Group
Creates a new attribute group in the system. Attribute groups are used to categorize product attributes for better organization.
| Field Name | Field Type | Required |
|---|---|---|
| group_name | string | Yes |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/attributeGroups
fetch('https://<your domain>/api/attributeGroups', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"attribute_group_id": 49,
"uuid": "363ba97f-8be7-4be9-be3f-a9f341f2b89f",
"group_name": "Attribute Group Name",
"created_at": "2023-02-06 09:13:35",
"updated_at": "2023-02-06 09:13:35"
}
}
Update an Attribute Group
Updates an existing attribute group's information. Use this endpoint to modify the name of an attribute group.
| Field Name | Field Type | Required |
|---|---|---|
| group_name | string | Yes |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/attributeGroups/363ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/attributeGroups/363ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"attribute_group_id": 50,
"uuid": "363ba97f-8be7-4be9-be3f-a9f341f2b89f",
"group_name": "Attribute Group Name",
"created_at": "2023-02-06 09:13:35",
"updated_at": "2023-02-06 09:13:35"
}
}
Delete an Attribute Group
Permanently removes an attribute group from the system. Note that this operation cannot be undone, and any attributes associated with this group may need to be reassigned.
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/attributeGroups/363ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/attributeGroups/363ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"attribute_group_id": 50,
"uuid": "363ba97f-8be7-4be9-be3f-a9f341f2b89f",
"group_name": "Attribute Group Name",
"created_at": "2023-02-06 09:13:35",
"updated_at": "2023-02-06 09:13:35"
}
}
Reading Attribute Groups
GET /api/attributeGroups and GET /api/attributeGroups/{uuid} do not exist. The catalog module registers no GET route for attribute groups — calling either returns a 404.
Read attribute groups through GraphQL. Query.attributeGroups is defined in an .admin.graphql file, so it exists only on the admin schema — send it to the authenticated endpoint POST /admin/graphql:
query AttributeGroups($filters: [FilterInput]) {
attributeGroups(filters: $filters) {
items {
attributeGroupId
uuid
groupName
attributes {
items {
attributeId
attributeCode
attributeName
}
total
}
}
currentPage
total
}
}
See the GraphQL documentation for filters and the full schema.
Error Handling
All endpoints may return the following error responses:
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Attribute group doesn't exist |
| 500 | Server Error - Something went wrong |
Error responses follow this format:
{
"error": {
"status": 404,
"message": "Attribute group not found"
}
}
Best Practices
- Organization: Create logical attribute groups based on product categories or features
- Naming: Use clear, descriptive names for attribute groups
- Maintenance: Regularly review and update attribute groups as product catalogs evolve
- Integration: Use these APIs to integrate EverShop with PIM (Product Information Management) systems