Create Size Guide Endpoint
This endpoint is only available if aerocargo/size-guides is installed.
Structure
Size Guide
| Name |
Type |
Description |
Required |
Version |
id |
int | The id of the size guide | No | >=0.1.0 |
type |
string | The type of the size guide | No | >=2.0.0 |
name |
string | The name for the size guide | Yes | >=0.1.0 |
heading |
string | The heading of the size guide | Yes | >=0.1.0 |
view |
string | The view of the size guide | No | >=0.1.0 |
content |
string | The content of the size guide | If type is rich_text |
>=2.0.0 |
small_image |
object | The Small Image | No | >=0.1.0 |
medium_image |
object | The Medium Image | No | >=0.1.0 |
large_image |
object | The Large Image | No | >=0.1.0 |
products |
array | An array of product ids or models | Conditional * |
>=0.1.0 |
manufacturers |
array | An array of manufacturer ids or names | Conditional * |
>=0.1.0 |
categories |
array | An array of category ids or breadcrumbs | Conditional * |
>=0.1.0 |
tags |
array | An array of tag ids or names | Conditional * |
>=0.1.0 |
groups |
array | An array of Group objects | No | >=0.1.0 |
Valid Types: image, rich_text & legacy (resolved from payload structure if not provided).
* Either products is required or manufacturers and/or categories and/or tags are.
Group
| Name |
Type |
Description |
Required |
Version |
id |
int | The id of the size guide group | No | >=0.1.0 |
heading |
string | The heading of the size guide | Yes | >=0.1.0 |
sections |
array | An array of Section objects | No | >=0.1.0 |
Section
| Name |
Type |
Description |
Required |
Version |
id |
int | The id of the size guide section | No | >=0.1.0 |
heading |
string | The heading of the size guide section | Yes | >=0.1.0 |
content |
string | The content of the size guide section | Yes | >=0.1.0 |
Image
| Name |
Type |
Description |
Required |
Version |
src |
string | The source url of the image | Yes | >=0.1.0 |
Example Request
Example - Version 1.x
POST /api/size-guides/
{
"name": "API Test",
"heading": "Test",
"view": "test",
"products": [],
"manufacturers": [
"Burberry"
],
"categories": [
"Mens > Coats"
],
"tags": [
"Blue"
],
"groups": [
{
"heading": "Group Heading",
"sections": [
{
"heading": "Section Heading",
"content": "Section Content"
}
]
}
]
}
Example - Version 2.x
POST /api/size-guides/
{
"name": "API Test",
"heading": "Test",
"view": "test",
"content": "Section Content",
"products": [],
"manufacturers": [
"Burberry"
],
"categories": [
"Mens > Coats"
],
"tags": [
"Blue"
]
}
Because content is present, the type is automatically resolved as rich_text.
Example Response
{
"sizeGuide": {
"id": 1
}
}