Attribute Groups
Attribute Group Index Endpoint
Structure
See View Attribute Group Endpoint for the structure of the attribute group payload inside the data array.
Example Request
GET /api/attribute-groups?per_page=2
Example Response
{
"current_page": 1,
"data": [
//...
],
"first_page_url": "http://aero.test/api/attribute-groups?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "http://aero.test/api/attribute-groups?page=3",
"next_page_url": "http://aero.test/api/attribute-groups?page=2",
"path": "http://aero.test/api/attribute-groups",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 5
}
See View Attribute Group Endpoint for the structure of the attribute group payload inside the data array.
View Attribute Group Endpoint
Structure
Attribute Group
Name
|
Type
|
Description
|
name |
string |
The name of the attribute group (e.g., Size or Colour) |
display_as |
string |
The display as of the attribute group (e.g.: dropdown, color_swatches, image_swatches, swatches) |
reference |
string |
The reference of the attribute group |
attributes
|
array |
An array of Attribute objects |
Attribute
Name
|
Type
|
Description
|
name
|
string |
The name of the attribute group (e.g., Size or Colour) |
display_name |
string |
The display name of the attribute |
reference |
string |
The reference of the attribute group |
image |
object |
The Image of the attribute |
tags |
array |
An array of Tag objects |
Tag
Name
|
Type
|
Description
|
name |
string |
The name of the tag (e.g., Small or Red) |
group |
object |
The Tag Group of the tag |
Tag Group
Name
|
Type
|
Description
|
name |
string |
The name of the tag group (e.g., Size or Colour) |
Image
Name
|
Type
|
Description
|
url |
string |
The url of the image |
Example Request
GET /api/attribute-groups/{id|name}
Example Response
{
"id": 1,
"name": "Size",
"display_as": "dropdown",
"reference": null,
"attributes": [
{
"id": 1,
"name": "Small",
"display_name": "",
"reference": null,
"image": {
"url": null
},
"tags": []
}
]
}
Create Attribute Group Endpoint
Structure
Attribute Group
Name
|
Type
|
Description
|
Required
|
id |
int |
The id for the attribute group |
No |
name |
string |
The name of the attribute group (e.g., Size or Colour) |
Yes |
display_as |
string |
The display as of the attribute group (e.g.: dropdown, color_swatches, image_swatches, swatches) |
No |
reference |
string |
The reference of the attribute group |
No |
attributes |
array |
The attributes of the attribute group, see Attribute |
No |
Attribute
Name
|
Type
|
Description
|
Required
|
id |
int |
The id for the attribute |
No |
name |
string |
The name of the attribute (e.g., Small or Red) |
Yes |
display_name |
string |
The display name of the attribute |
No |
reference |
string |
The reference of the attribute |
No |
image |
object |
The Image of the attribute |
No |
tags |
array |
An array of Tag objects |
No |
Image
Name
|
Type
|
Description
|
Required
|
src |
string |
The source url of the image |
Yes |
Tag
Name
|
Type
|
Description
|
Required
|
name |
string |
The name of the tag (e.g., Small or Red) |
Yes |
group |
object |
The tag group, see Tag Group |
Yes |
Tag Group
Name
|
Type
|
Description
|
Required
|
name |
string |
The name of the tag group (e.g., Size or Colour) |
Yes |
Example Request
POST /api/attribute-groups/
{
"name": "Colour",
"attributes": [
{
"name": "Blue",
"reference": "blue"
},
{
"name": "red"
}
]
}
Example Response
{
"attributeGroup": {
"id": 1
}
}
Update Attribute Group Endpoint
Structure
Name
|
Type
|
Description
|
Required
|
name |
string |
The name of the attribute group (e.g., Size or Colour) |
No |
display_as |
string |
The display as of the attribute group (e.g.: dropdown, color_swatches, image_swatches, swatches) |
No |
reference |
string |
The reference of the attribute group |
No |
Example Request
PUT /api/attribute-groups/
{
"name": "Updated Size",
"display_as": "swatches"
}
Example Response
{
"attributeGroup": {
"id": 1
}
}
Delete Attribute Group Endpoint
Example Request
DELETE /api/attribute-groups/{id|name}
Example Response
204 No Content