# Attributes

# Create Attribute Endpoint

## Structure

### Attribute

<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 for the attribute</td><td>No</td></tr><tr><td>`name`</td><td>string</td><td>The name of the attribute (e.g., Small or Red)</td><td>Yes</td></tr><tr><td>`display_name`</td><td>string</td><td>The display name of the attribute</td><td>No</td></tr><tr><td>`reference`</td><td>string</td><td>The reference of the attribute</td><td>No</td></tr><tr><td>`image`</td><td>object</td><td>The [Image](https://support.aerocommerce.com/books/api/page/create-attribute-endpoint#bkmrk-image) of the attribute</td><td>No</td></tr><tr><td>`tags`</td><td>array</td><td>An array of [Tag](https://support.aerocommerce.com/books/api/page/create-attribute-endpoint#bkmrk-tag) objects</td><td>No</td></tr></tbody></table>

### Image

<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>`src`</td><td>string</td><td>The source url of the image</td><td>Yes</td></tr></tbody></table>

### Tag

<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>`name`</td><td>string</td><td>The name of the tag (e.g., Small or Red)</td><td>Yes</td></tr><tr><td>`group`</td><td>object</td><td>The tag group, see [Tag Group](https://support.aerocommerce.com/books/api/page/create-attribute-endpoint#bkmrk-tag-group)</td><td>Yes</td></tr></tbody></table>

### Tag Group

<table border="1" id="bkmrk-name-type-descriptio-3" 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>`name`</td><td>string</td><td>The name of the tag group (e.g., Size or Colour)</td><td>Yes</td></tr></tbody></table>

## Example Request

```
POST /api/attribute-groups/{id|name}/attributes
```

```json
{
    "name": "Medium",
    "display_name": "Medium"
}
```

## Example Response

```json
{
    "attribute": {
        "id": 1
    }
}
```

# Update Attribute Endpoint

## Structure

### Attribute

<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>`name`</td><td>string</td><td>The name of the attribute (e.g., Small or Red)</td><td>No</td></tr><tr><td>`display_name`</td><td>string</td><td>The display name of the attribute</td><td>No</td></tr><tr><td>`reference`</td><td>string</td><td>The reference of the attribute</td><td>No</td></tr><tr><td>`image`</td><td>object</td><td>The [Image](https://support.aerocommerce.com/books/api/page/update-attribute-endpoint#bkmrk-image) of the attribute</td><td>No</td></tr><tr><td>`tags`</td><td>array</td><td>An array of [Tag](https://support.aerocommerce.com/books/api/page/update-attribute-endpoint#bkmrk-tag) objects</td><td>No</td></tr></tbody></table>

### Image

<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>`src`</td><td>string</td><td>The source url of the image</td><td>Yes</td></tr></tbody></table>

### Tag

<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>`name`</td><td>string</td><td>The name of the tag (e.g., Small or Red)</td><td>Yes</td></tr><tr><td>`group`</td><td>object</td><td>The tag group, see [Tag Group](https://support.aerocommerce.com/books/api/page/update-attribute-endpoint#bkmrk-tag-group)</td><td>Yes</td></tr></tbody></table>

### Tag Group

<table border="1" id="bkmrk-name-type-descriptio-3" 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>`name`</td><td>string</td><td>The name of the tag group (e.g., Size or Colour)</td><td>Yes</td></tr></tbody></table>

## Example Request

```
PUT /api/attribute-groups/{id|name}/attributes/{id|name}
```

```json
{
    "name": "Updated Small",
    "display_name": "Updated Small"
}
```

## Example Response

```json
{
    "attribute": {
        "id": 1
    }
}
```

# Delete Attribute Endpoint

## Example Request

```
DELETE /api/attribute-groups/{id|name}/attributes/{id|name}
```

## Example Response

```
204 No Content
```