# Size Guides

# Size Guide Index Endpoint

<p class="callout warning">This endpoint is only available if `aerocargo/size-guides` is installed.</p>

## Structure

See [View Size Guide Endpoint](https://support.aerocommerce.com/books/api/page/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

```json
{
    "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

<p class="callout warning">This endpoint is only available if `aerocargo/size-guides` is installed.</p>

## Structure

### Size Guide

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide</td></tr><tr><td>`name`</td><td>string</td><td>The name for the size guide</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide</td></tr><tr><td>`view`  
</td><td>string</td><td>The view of the size guide</td></tr><tr><td>`small_image`</td><td>object</td><td>The Small [Image](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-image)</td></tr><tr><td>`medium_image`</td><td>object</td><td>The Medium [Image](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-image)</td></tr><tr><td>`large_image`</td><td>object</td><td>The Large [Image](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-image)</td></tr><tr><td>`products`  
</td><td>array</td><td>An array of [Product](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-product) objects</td></tr><tr><td>`manufacturers`  
</td><td>array</td><td>An array of [Manufacturer](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-manufacturer) objects</td></tr><tr><td>`categories`  
</td><td>array</td><td>An array of [Category](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-category) objects</td></tr><tr><td>`tags`  
</td><td>array</td><td>An array of [Tag](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-tag) objects</td></tr><tr><td>`groups`  
</td><td>array</td><td>An array of [Group](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-group) objects</td></tr></tbody></table>

### Group

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide group</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide</td></tr><tr><td>`sections`  
</td><td>array</td><td>An array of [Section](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-section) objects</td></tr></tbody></table>

### Section

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide section</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide section</td></tr><tr><td>`content`  
</td><td>string</td><td>The content of the size guide section</td></tr></tbody></table>

### Product

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the product</td></tr><tr><td>`model`  
</td><td>string</td><td>The model of the product</td></tr><tr><td>`name`</td><td>string</td><td>The name of the product</td></tr></tbody></table>

### Manufacturer

<table border="1" id="bkmrk-name-type-descriptio-4" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the manufacturer</td></tr><tr><td>`name`</td><td>string</td><td>The name of the manufacturer</td></tr></tbody></table>

### Category

<table border="1" id="bkmrk-name-type-descriptio-5" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the category</td></tr><tr><td>`name`</td><td>string</td><td>The name of the category</td></tr><tr><td>`breadcrumb`  
</td><td>string</td><td>The breadcrumb for the category</td></tr></tbody></table>

### Tag

<table border="1" id="bkmrk-name-type-descriptio-6" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the tag</td></tr><tr><td>`name`</td><td>string</td><td>The name of the tag (e.g., Small or Red)</td></tr><tr><td>`group`</td><td>object</td><td>The tag group, see [Tag Group](https://support.aerocommerce.com/books/api/page/view-size-guide-endpoint#bkmrk-tag-group)</td></tr></tbody></table>

### Tag Group

<table border="1" id="bkmrk-name-type-descriptio-7" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the tag group</td></tr><tr><td>`name`</td><td>string</td><td>The name of the tag group (e.g., Size or Colour)</td></tr></tbody></table>


### Image

<table border="1" id="bkmrk-name-type-descriptio-8" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col><col style="width: 33.3731%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td></tr><tr><td>`url`</td><td>string</td><td>The url of the image</td></tr></tbody></table>


## Example Request

```
GET /api/size-guides/{id}
```

## Example Response

```json
{
    "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"
                }
            ]
        }
    ]
}
```

# Create Size Guide Endpoint

<p class="callout warning">This endpoint is only available if `aerocargo/size-guides` is installed.</p>

## Structure

### Size Guide

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide</td><td>No</td></tr><tr><td>`name`</td><td>string</td><td>The name for the size guide</td><td>Yes</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide</td><td>Yes</td></tr><tr><td>`view`  
</td><td>string</td><td>The view of the size guide</td><td>No</td></tr><tr><td>`small_image`</td><td>object</td><td>The Small [Image](https://support.aerocommerce.com/books/api/page/create-size-guide-endpoint#bkmrk-image)</td><td>No</td></tr><tr><td>`medium_image`</td><td>object</td><td>The Medium [Image](https://support.aerocommerce.com/books/api/page/create-size-guide-endpoint#bkmrk-image)</td><td>No</td></tr><tr><td>`large_image`</td><td>object</td><td>The Large [Image](https://support.aerocommerce.com/books/api/page/create-size-guide-endpoint#bkmrk-image)</td><td>No</td></tr><tr><td>`products`  
</td><td>array</td><td>An array of product ids or models</td><td>Conditional `*`</td></tr><tr><td>`manufacturers`  
</td><td>array</td><td>An array of manufacturer ids or names</td><td>Conditional `*`</td></tr><tr><td>`categories`  
</td><td>array</td><td>An array of category ids or breadcrumbs</td><td>Conditional `*`</td></tr><tr><td>`tags`  
</td><td>array</td><td>An array of tag ids or names</td><td>Conditional `*`</td></tr><tr><td>`groups`  
</td><td>array</td><td>An array of [Group](https://support.aerocommerce.com/books/api/page/create-size-guide-endpoint#bkmrk-group) objects</td><td>No</td></tr></tbody></table>

`*` Either `products` is required or `manufacturers` and/or `categories` and/or `tags` are.

### Group

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide group</td><td>No</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide</td><td>Yes</td></tr><tr><td>`sections`  
</td><td>array</td><td>An array of [Section](https://support.aerocommerce.com/books/api/page/create-size-guide-endpoint#bkmrk-section) objects</td><td>No</td></tr></tbody></table>

### Section

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide section</td><td>No</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide section</td><td>Yes</td></tr><tr><td>`content`  
</td><td>string</td><td>The content of the size guide section</td><td>Yes</td></tr></tbody></table>

### Image

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%; height: 169.578px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`src`</td><td>string</td><td>The source url of the image</td><td>Yes</td></tr></tbody></table>


## Example Request

```
POST /api/size-guides/
```

## Example Response

```json
{
    "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"
                }
            ]
        }
    ]
}
```

# Update Size Guide Endpoint

<p class="callout warning">This endpoint is only available if `aerocargo/size-guides` is installed.</p>

## Structure

### Size Guide

<table border="1" id="bkmrk-name-type-descriptio" style="border-collapse: collapse; width: 100%; height: 436.75px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`name`</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The name for the size guide</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`heading`  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The heading of the size guide</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`view`  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">The view of the size guide</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`small_image`</td><td style="height: 29.7969px;">object</td><td style="height: 29.7969px;">The Small [Image](https://support.aerocommerce.com/books/api/page/update-size-guide-endpoint#bkmrk-image)</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`medium_image`</td><td style="height: 29.7969px;">object</td><td style="height: 29.7969px;">The Medium [Image](https://support.aerocommerce.com/books/api/page/update-size-guide-endpoint#bkmrk-image)</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`large_image`</td><td style="height: 29.7969px;">object</td><td style="height: 29.7969px;">The Large [Image](https://support.aerocommerce.com/books/api/page/update-size-guide-endpoint#bkmrk-image)</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`products`  
</td><td style="height: 46.5938px;">array</td><td style="height: 46.5938px;">An array of product ids or models</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`manufacturers`  
</td><td style="height: 46.5938px;">array</td><td style="height: 46.5938px;">An array of manufacturer ids or names</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`categories`  
</td><td style="height: 46.5938px;">array</td><td style="height: 46.5938px;">An array of category ids or breadcrumbs</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`tags`  
</td><td style="height: 29.7969px;">array</td><td style="height: 29.7969px;">An array of tag ids or names</td><td style="height: 29.7969px;">No</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">`groups`  
</td><td style="height: 29.7969px;">array</td><td style="height: 29.7969px;">An array of [Group](https://support.aerocommerce.com/books/api/page/update-size-guide-endpoint#bkmrk-group) objects</td><td style="height: 29.7969px;">No</td></tr></tbody></table>

### Group

<table border="1" id="bkmrk-name-type-descriptio-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr><td>**Name**  
</td><td>**Type**  
</td><td>**Description**  
</td><td>**Required**  
</td></tr><tr><td>`id`</td><td>int</td><td>The id of the size guide group</td><td>No</td></tr><tr><td>`heading`  
</td><td>string</td><td>The heading of the size guide</td><td>No</td></tr><tr><td>`sections`  
</td><td>array</td><td>An array of [Section](https://support.aerocommerce.com/books/api/page/update-size-guide-endpoint#bkmrk-section) objects</td><td>No</td></tr></tbody></table>

### Section

<table border="1" id="bkmrk-name-type-descriptio-2" style="border-collapse: collapse; width: 100%; height: 169.578px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`id`</td><td style="height: 46.5938px;">int</td><td style="height: 46.5938px;">The id of the size guide section</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`heading`  
</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The heading of the size guide section</td><td style="height: 46.5938px;">No</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">`content`  
</td><td style="height: 46.5938px;">string</td><td style="height: 46.5938px;">The content of the size guide section</td><td style="height: 46.5938px;">No</td></tr></tbody></table>

### Image

<table border="1" id="bkmrk-name-type-descriptio-3" style="border-collapse: collapse; width: 100%; height: 169.578px;"><colgroup><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col><col style="width: 25.0298%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Name**  
</td><td style="height: 29.7969px;">**Type**  
</td><td style="height: 29.7969px;">**Description**  
</td><td style="height: 29.7969px;">**Required**  
</td></tr><tr><td>`src`</td><td>string</td><td>The source url of the image</td><td>Yes</td></tr></tbody></table>


## Example Request

```
PUT /api/size-guides/{id}
```

## Example Response

```json
{
    "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"
                }
            ]
        }
    ]
}
```