Size Guides

Size Guide Index Endpoint

This endpoint is only available if aerocargo/size-guides is installed.

Structure

See View Size Guide Endpoint for the structure of the size guide payload inside the data array.

Example Request

GET /api/size-guides?per_page=2

Example Response

{
    "current_page": 1,
    "data": [
        //...
    ],
    "first_page_url": "http://aero.test/api/size-guides?page=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "http://aero.test/api/size-guides?page=3",
    "next_page_url": "http://aero.test/api/size-guides?page=2",
    "path": "http://aero.test/api/size-guides",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 5
}

View Size Guide Endpoint

This endpoint is only available if aerocargo/size-guides is installed.

Structure

Size Guide

Name
Type
Description
Version
id int The id of the size guide >=0.1.0
type
string The type of the size guide >=2.0.0
name string The name for the size guide >=0.1.0
heading
string The heading of the size guide >=0.1.0
view
string The view of the size guide >=0.1.0
content
string The content of the size guide >=2.0.0
small_image object The Small Image >=0.1.0
medium_image object The Medium Image >=0.1.0
large_image object The Large Image >=0.1.0
products
array An array of Product objects >=0.1.0
manufacturers
array An array of Manufacturer objects >=0.1.0
categories
array An array of Category objects >=0.1.0
tags
array An array of Tag objects >=0.1.0
groups
array An array of Group objects >=0.1.0

Group

Name
Type
Description
Version
id int The id of the size guide group >=0.1.0
heading
string The heading of the size guide >=0.1.0
sections
array An array of Section objects >=0.1.0

Section

Name
Type
Description
Version
id int The id of the size guide section >=0.1.0
heading
string The heading of the size guide section >=0.1.0
content
string The content of the size guide section >=0.1.0

Product

Name
Type
Description
Version
id int The id of the product >=0.1.0
model
string The model of the product >=0.1.0
name string The name of the product >=0.1.0

Manufacturer

Name
Type
Description
Version
id int The id of the manufacturer >=0.1.0
name string The name of the manufacturer >=0.1.0

Category

Name
Type
Description
Version
id int The id of the category >=0.1.0
name string The name of the category >=0.1.0
breadcrumb
string The breadcrumb for the category >=0.1.0

Tag

Name
Type
Description
Version
id int The id of the tag >=0.1.0
name string The name of the tag (e.g., Small or Red) >=0.1.0
group object The tag group, see Tag Group >=0.1.0

Tag Group

Name
Type
Description
Version
id int The id of the tag group >=0.1.0
name string The name of the tag group (e.g., Size or Colour) >=0.1.0

Image

Name
Type
Description
Version
url string The url of the image >=0.1.0

Example Request

GET /api/size-guides/{id}

Example Response

Example - Version 1.x
{
    "id": 1,
    "name": "API Test",
    "heading": "Test",
    "view": "test",
    "small_image": {
        "url": null
    },
    "medium_image": {
        "url": null
    },
    "large_image": {
        "url": null
    },
    "products": [],
    "manufacturers": [
        {
            "id": 1,
            "name": "Burberry"
        }
    ],
    "categories": [
        {
            "id": 1,
            "name": "Coats",
            "breadcrumb": "Mens » Coats"
        }
    ],
    "tags": [
        {
            "id": 1,
            "name": "Blue",
            "group": {
                "id": 1,
                "name": "Colour"
            }
        }
    ],
    "groups": [
        {
            "id": 1,
            "heading": "Group Heading",
            "sections": [
                {
                    "id": 1,
                    "heading": "Section Heading",
                    "content": "Section Content"
                }
            ]
        }
    ]
}
Example - Version 2.x
{
    "id": 1,
    "type": "rich_text",
    "name": "API Test",
    "heading": "Test",
    "view": "test",
    "content": "Section Content",
    "small_image": {
        "url": null
    },
    "medium_image": {
        "url": null
    },
    "large_image": {
        "url": null
    },
    "products": [],
    "manufacturers": [
        {
            "id": 1,
            "name": "Burberry"
        }
    ],
    "categories": [
        {
            "id": 1,
            "name": "Coats",
            "breadcrumb": "Mens » Coats"
        }
    ],
    "tags": [
        {
            "id": 1,
            "name": "Blue",
            "group": {
                "id": 1,
                "name": "Colour"
            }
        }
    ],
    "groups": []
}

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
    }
}

Update Size Guide Endpoint

This endpoint is only available if aerocargo/size-guides is installed.

Structure

Size Guide

Name
Type
Description
Required
Version
type
string The type of the size guide No >=2.0.0
name string The name for the size guide No >=0.1.0
heading
string The heading of the size guide No >=0.1.0
view
string The view of the size guide No >=0.1.0
content
string The content of the size guide No >=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 No >=0.1.0
manufacturers
array An array of manufacturer ids or names No >=0.1.0
categories
array An array of category ids or breadcrumbs No >=0.1.0
tags
array An array of tag ids or names No >=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).

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 No >=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 No >=0.1.0
content
string The content of the size guide section No >=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
PUT /api/size-guides/{id}
{
    "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
PUT /api/size-guides/{id}
{
    "name": "API Test",
    "heading": "Test",
    "view": "test",
    "content": "Section Content"
    "products": [],
    "manufacturers": [
        "Burberry"
    ],
    "categories": [
        "Mens > Coats"
    ],
    "tags": [
        "Blue"
    ]
}

Example Response

{
    "sizeGuide": {
        "id": 1
    }
}