Listing Collection Groups
- Listing Collection Group Index
- View Listing Collection Group Endpoint
- Create Listing Collection Group Endpoint
- Update Listing Collection Group Endpoint
Listing Collection Group Index
This endpoint is only available if aerocargo/listing-collections is installed.
Structure
See 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
{
"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
This endpoint is only available if aerocargo/listing-collections is installed.
Structure
Listing Collection Group
| Name |
Type |
Description |
key |
string | The key of the listing collection group |
name |
string | The name for the listing collection group |
listings |
array | An array of Listing objects |
Listing
| Name |
Type |
Description |
id |
int | The id of the listing |
product_id |
int | The id of the product linked to the listing |
sort |
int | The sort of the listing within the group |
Example Request
GET /api/listing-collection-groups/{key}
Example Response
{
"key": "api",
"name": "API Test",
"listings": [
{
"id": 1,
"product_id": 1
}
]
}
Create Listing Collection Group Endpoint
This endpoint is only available if aerocargo/listing-collections is installed.
Structure
Listing Collection Group
| Name |
Type |
Description |
Required |
key |
string | The key of the listing collection group | Yes |
name |
string | The name for the listing collection group | Yes |
listings |
array | An array of Listing objects | No |
Listing
| Name |
Type |
Description |
Required |
id |
int | The id of the listing | Conditional * |
variant_id |
int | The id of the variant (of the listing) | Conditional * |
sku |
string | The SKU of the variant (of the listing) | Conditional * |
product_id |
int | The id of the product (of the listing) | Conditional * |
model |
string | The model of the product (of the listing) | Conditional * |
* At least one must be present, resolved in the order they are listed top-down.
Example Request
POST /api/listing-collection-groups/
{
"key": "api",
"name": "API Test",
"listings": [
{
"id": 1
}
]
}
Example Response
{
"listingCollectionGroup": {
"key": "api"
}
}
Update Listing Collection Group Endpoint
This endpoint is only available if aerocargo/listing-collections is installed.
Structure
Listing Collection Group
| Name |
Type |
Description |
Required |
key |
string | The key of the listing collection group | No |
name |
string | The name for the listing collection group | No |
listings |
array | An array of Listing objects | No |
Listing
| Name |
Type |
Description |
Required |
id |
int | The id of the listing | Conditional * |
variant_id |
int | The id of the variant (of the listing) | Conditional * |
sku |
string | The SKU of the variant (of the listing) | Conditional * |
product_id |
int | The id of the product (of the listing) | Conditional * |
model |
string | The model of the product (of the listing) | Conditional * |
* At least one must be present, resolved in the order they are listed top-down.
Example Request
PUT /api/listing-collection-groups/{key}
{
"name": "API Test Updated",
"listings": [
{
"id": 2
}
]
}
Example Response
{
"listingCollectionGroup": {
"key": "api"
}
}