Collections
All collections within the store can be obtained using the Collections API. This API is paginated, allowing access to subsequent pages by utilizing the page parameter.
API returns only collection details and does not return products.
http://api.shopper.com/v1/collections?page={page}&limit={limit}&order_by={order_by}
Parameters
Parameter | Type | Description |
---|---|---|
page | integer | Page number, please note that the starting page number is 0 |
limit | integer | The maximum number of results to fetch. The default limit is 100 |
order_by | string | For sorting. Possible values: create_date, name, order, products, views. For inverse sort order, sign '-' before the value. Eg: order_by=-create_date. |
Sample output
{
"current": 1,
"end": 3,
"start": 1,
"limit": 100,
"total": 314,
"next_page": "{domain_url}/collections?page={page}&limit={limit}",
"collections": [
{
"id": "5fda07d1c9684200139824ca",
"url": "https://www.shopper.com/c/My-Book-Collection/9uxf",
"order": 0,
"name": "My Book Collection ",
"private": true,
"description": "Check out my Favorite Books",
"views": 125,
"create_date": "2021-11-15T04:45:57.259Z",
"tag_details":[
{
"tag":"trending",
"slug":"trending",
"count":"1"
"url": "https://www.shopper.com/s/trending?tag=trending"
},
{
"tag":"new",
"slug":"new",
"count":"1",
"url": "https://www.shopper.com/s/new?tag=new"
},
{
"tag":"fashion",
"slug":"fashion",
"count":"4",
"url": "https://www.shopper.com/s/trending?tag=trending"
}
],
"products": 3,
"cover_image": "https://cdn.shopper.com/shopper-v2/demo/assets/user_collection/a3283e5f-4f14-4971-9312-a0bbee656bff.png",
}
]
}
Response body
id: Unique collection ID
url: Store collection URL
order: Display sequence/ sorting order of the collection
name: Name of the collection
is_secret: This flag represents the status (public/ private) of the collection
description: Description of the collection
views: Number of views for the given collection
create_date: Date of creation of the collection in ISO 8601 format
tag_details: Array of details of the tags associated with the collection including tag name. slug and unique tag url
products: Number of product inside the collection
cover_image: The URL to the cover image of the collection.
Response status
Status | Reason |
---|---|
500 | Internal server error |
200 | Success |
400 | Invalid request parameters |
405 | API method is not allowed, contact admin to get access |
401 | Invalid authentication parameters |