Get a collection by slug
const url = 'https://apibase.ecomweb.app/api/v1/public/stores/example/collections/slug/example?ids=1%2C2%2C3&type=manual&status=draft&search=summer&name=Summer%20Collection&sort_by=name&sort_order=asc&limit=10&offset=0&include_product_count=false&include_seo_metadata=false';const options = {method: 'GET', headers: {'x-storefront-api-key': '<x-storefront-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/public/stores/example/collections/slug/example?ids=1%2C2%2C3&type=manual&status=draft&search=summer&name=Summer%20Collection&sort_by=name&sort_order=asc&limit=10&offset=0&include_product_count=false&include_seo_metadata=false' \ --header 'x-storefront-api-key: <x-storefront-api-key>'Returns one collection by its URL slug, with its metafields. Active and unlisted collections are found; draft and archived ones answer 404. List the collection’s products with the collection products route.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The collection’s URL slug.
The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Example
1,2,3Filter by specific collection IDs (comma-separated)
Filter by collection type
Filter by collection status
Example
summerSearch collections by name or description
Example
Summer CollectionFilter by collection name
Example
nameSort field
Sort order
Example
10Number of items per page
Example
0Number of items to skip
Example
trueInclude product count in the response for each collection
Example
trueInclude SEO metadata in the response
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.
The collection’s metafields that are visible to the storefront, keyed by namespace.key.
object
object
The metafield’s type, such as single_line_text_field or list.number_integer.
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 request is malformed or failed validation.
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 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"}