# Listing Collection Groups

# Listing Collection Group Index

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

#### Structure

See [<span class="s1">View Listing Collection Group Endpoint</span>](https://support.aerocommerce.com/books/api/page/view-listing-collection-group-endpoint) for the structure of the listing collection group payload inside the data array.

#### Example Request

```
GET /api/listing-collection-groups?per_page=2
```

#### Example Response

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

# View Listing Collection Group Endpoint

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

#### Structure

##### Listing Collection Group

<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>`key`</td><td>string</td><td>The key of the listing collection group</td></tr><tr><td>`name`</td><td>string</td><td>The name for the listing collection group</td></tr><tr><td>`listings`</td><td>array</td><td>An array of [Listing](https://support.aerocommerce.com/books/api/page/view-listing-collection-group-endpoint#bkmrk-listing) objects</td></tr></tbody></table>

##### Listing

<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 listing</td></tr><tr><td>`product_id`</td><td>int</td><td>The id of the product linked to the listing</td></tr><tr><td>`sort`</td><td>int</td><td>The sort of the listing within the group</td></tr></tbody></table>

#### Example Request

```
GET /api/listing-collection-groups/{key}
```

#### Example Response

```json
{
    "key": "api",
    "name": "API Test",
    "listings": [
        {
            "id": 1,
            "product_id": 1
        }
    ]
}
```

# Create Listing Collection Group Endpoint

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

#### Structure

##### Listing Collection Group

<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>`key`</td><td>string</td><td>The key of the listing collection group</td><td>Yes</td></tr><tr><td>`name`</td><td>string</td><td>The name for the listing collection group</td><td>Yes</td></tr><tr><td>`listings`</td><td>array</td><td>An array of [Listing](https://support.aerocommerce.com/books/api/page/create-listing-collection-group-endpoint#bkmrk-listing) objects</td><td> No</td></tr></tbody></table>

##### Listing

<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 listing</td><td>Conditional `*`</td></tr><tr><td>`variant_id`</td><td>int</td><td>The id of the variant (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`sku`</td><td>string</td><td>The SKU of the variant (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`product_id`</td><td>int</td><td>The id of the product (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`model`</td><td>string</td><td>The model of the product (of the listing)</td><td>Conditional `*`</td></tr></tbody></table>

`*` At least one must be present, resolved in the order they are listed top-down.

#### Example Request

```
POST /api/listing-collection-groups/
```

```json
{
    "key": "api",
    "name": "API Test",
    "listings": [
        {
          "id": 1
        }
    ]
}
```

#### Example Response

```json
{
    "listingCollectionGroup": {
        "key": "api"
    }
}
```

# Update Listing Collection Group Endpoint

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

#### Structure

##### Listing Collection Group

<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>`key`</td><td>string</td><td>The key of the listing collection group</td><td>No</td></tr><tr><td>`name`</td><td>string</td><td>The name for the listing collection group</td><td>No</td></tr><tr><td>`listings`</td><td>array</td><td>An array of [Listing](https://support.aerocommerce.com/books/api/page/update-listing-collection-group-endpoint/update-listing-collection-group-endpoint#bkmrk-listing) objects</td><td> No</td></tr></tbody></table>

##### Listing

<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 listing</td><td>Conditional `*`</td></tr><tr><td>`variant_id`</td><td>int</td><td>The id of the variant (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`sku`</td><td>string</td><td>The SKU of the variant (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`product_id`</td><td>int</td><td>The id of the product (of the listing)</td><td>Conditional `*`</td></tr><tr><td>`model`</td><td>string</td><td>The model of the product (of the listing)</td><td>Conditional `*`</td></tr></tbody></table>

`*` At least one must be present, resolved in the order they are listed top-down.

#### Example Request

```
PUT /api/listing-collection-groups/{key}
```

```json
{
    "name": "API Test Updated",
    "listings": [
        {
            "id": 2
        }
    ]
}
```

#### Example Response

```json
{
    "listingCollectionGroup": {
        "key": "api"
    }
}
```