Attribute Group API
Use the REST API to interact with EverShop product attribute group.
Create an attribute group
Use this endpoint to create an attribute group.
Request Schema (application/json)
Field Name | Field Type | Required |
---|---|---|
group_name | string | Yes |
POST/api/attributeGroups
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/attributeGroups
fetch('https://<your domain>/api/attributeGroups', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"attribute_group_id": 49,
"uuid": "dcc16767a5c311edb46b60d819134f39",
"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
Use this endpoint to update an attribute group.
Request Schema (application/json)
Field Name | Field Type | Required |
---|---|---|
group_name | string | Yes |
PATCH/api/attributeGroups/{id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/attributeGroups/{id}
fetch('https://<your domain>/api/attributeGroups/{id}', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"attribute_group_id": 50,
"uuid": "dcc16767a5c311edb46b60d819134f39",
"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
Use this endpoint to delete an attribute group.
Request Schema (application/json)
No request body requiredDELETE/api/attributeGroups/{id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/attributeGroups/{id}
fetch('https://<your domain>/api/attributeGroups/{id}', {
headers: {
'Accept': 'application/json',
'Cookie': 'asid=<your admin cookie>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"attribute_group_id": 50,
"uuid": "dcc16767a5c311edb46b60d819134f39",
"group_name": "Attribute Group Name",
"created_at": "2023-02-06 09:13:35",
"updated_at": "2023-02-06 09:13:35"
}
}