Search Documentation

Search for a documentation page...

Collections

Create and manage product collections with the Commerce SDK.

Browse Collections

Fetch all collections:

const collections = await commerce.collectionBrowse();

Get a Collection

Fetch a single collection by ID or slug:

const collection = await commerce.collectionGet({
idOrSlug: "summer-sale",
});

Response

{
id: "col_abc123",
name: "Summer Sale",
slug: "summer-sale",
description: "Hot deals for the summer season",
products: [...],
}

Create a Collection

const collection = await commerce.collectionCreate({
name: "New Arrivals",
slug: "new-arrivals",
description: "Fresh products just added to the store",
});

Products in Collections

Use the collectionSlug parameter when browsing products to filter by collection:

const products = await commerce.productBrowse({
collectionSlug: "summer-sale",
limit: 20,
});

Collections vs Categories

CollectionsCategories
PurposeCurated product groupsHierarchical taxonomy
StructureFlat listCan be nested
Use case"Staff Picks", "Sale""Clothing > T-Shirts"
ManagementManual product assignmentProduct categorization

Both can be used together — a product can belong to multiple collections and one or more categories.