Get a collection
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/collections/1';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/stores/example/collections/1 \ --header 'x-api-key: <x-api-key>'Returns one collection, including the product IDs of a manual collection in display order.
Required scopes: read:categories
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The collection ID.
The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”object
manual collections list products you choose; smart collections select products with search_criteria.
Publication status.
The rules a smart collection selects products with, or null for a manual collection.
object
The facets shoppers can filter the collection by, computed by the store, or null when not yet computed.
object
How products are ordered within the collection.
Product IDs of a manual collection, in display order. Not present on smart collections.
SEO fields. Present only when include_seo_metadata is true.
object
Page title for search engines, or null.
Page description for search engines, or null.
Collection ID.
Collection name.
Collection description, or null.
URL of the collection image, or null.
URL-friendly identifier, unique within the store.
ID of the category this collection was generated from, or null for a collection created by hand.
When the collection was created, as an ISO 8601 timestamp.
When the collection was last updated, as an ISO 8601 timestamp.
Always null; deleted collections are not returned.
Number of products in the collection. Present only when include_product_count is true.
Example
{ "type": "manual", "status": "draft", "collection_sort": "manual"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}