The Catalog module is the cornerstone of your Commerce Engine storefront. It defines everything you sell – products, their variations, how they’re organized, priced, and described. Mastering these APIs allows you to build compelling product listings, detailed descriptions, category navigation, powerful search, customer reviews, and insightful recommendations.
The Product-Variant-Item Hierarchy
Product (Product schema):
name
)product_type
: physical, digital, bundle)hsn_code
)category_ids
)tags
)attributes
): Characteristics shared by all variations (e.g., ‘Brand’, ‘Material’).seo
)has_variant
flag (boolean) indicates if this product branches into different selectable options (like size or color).Variant (Variant schema):
has_variant
flag is true
. It represents a unique combination of selected Variant Options (e.g., “Men’s Cotton T-Shirt - Blue / Large”).sku
) - The warehouse identifier for this specific variation.name
) - Often includes option values (e.g., “T-Shirt - Red, Large”).slug
)short_description
, description
)images
) - Can override or supplement Product images.videos
)pricing
)subscription
)promotion
)shipping
)variant_attributes
) - Attributes specific only to this variant.associated_options
) - Links back to the specific option values (e.g., { "color": "Blue", "size": "Large" }
).GET /products/{product_id}/variants
or retrieved individually via GET /products/{product_id}/variants/{variant_id}
.Item (Item/SKU schema - Note: To be renamed from SKU in future spec):
product_id
, variant_id
(which is null
if the product has no variants), and potentially a sku
(which might be null
for digital products or bundles). It aggregates relevant details needed for display and purchase (name, pricing, image, stock status, attributes, etc.) from either the Product (if no variants) or the specific Variant.GET /catalog/skus
, POST /catalog/products/search
, and the related products endpoints (similar
, upsell
, cross-sell
) return lists of these flattened Item Objects. This simplifies building listings (PLPs, search results) where you need a direct list of things to buy.Attributes vs. Variant Options
Attributes (ProductAttribute schema & its types):
is_filterable
, is_visible
.Variant Options (VariantOption schema, associated_options in Variant):
single-select
or color
attributes can be designated for variant creation (by enabling the can_be_used_to_create_variants
flag during attribute setup).Variant
record. This allows for unique SKUs, inventory tracking, pricing, images, etc., per combination.If YES to any of these, use a single-select or color attribute and enable can_be_used_to_create_variants to make it a Variant Option.
If NO, use a standard Attribute for enrichment, filtering, or display purposes (e.g., ‘Material’, ‘Brand’, ‘Country of Origin’, ‘Features’).Product Types Explained
sku
is optional (can be null
). No inventory tracking (stock_available
might always be true or managed differently). No shipping/packaging details. Often use subscription pricing.product_id
and variant_id
/sku
) sold as one unit (bundle_items
array in Product schema).
Other Key Concepts
Categories (ProductCategory, Category):
Hierarchical (parent_category_id
) organization. Fetched via GET /catalog/categories
.Pricing (ProductPricing):
Defines listing_price
, selling_price
, currency, taxes, quantity limits. Variant-specific. Supports B2B customer_group_id
overrides.Promotions/Offers (on_promotion, on_offer, promotion object):
Indicate automatic discounts or available coupons. Variant-specific.Reviews (ProductReview, CreateReview):
Managed per product_id
. Includes ratings, text, images, videos. List via GET /products/{id}/reviews
, submit via POST /products/{id}/reviews
.Related Products (similar, upsell, cross-sell):
Endpoints return lists of relevant Item Objects.GET /catalog/products
: List core products. Use has_variant
to know if options exist. Good starting point for PLPs if you handle variant selection/flattening client-side. Contains base info and potentially variant summaries in variants
array.GET /catalog/skus
: List flattened, sellable Items. Ideal for PLPs or inventory checks where you need a direct list of purchasable units, bypassing product hierarchy.GET /catalog/products/{product_id}
: Get full details for a single Product, including shared data, attributes, and variant options/summaries. Core for PDPs.GET /catalog/products/{product_id}/variants
: List all specific Variants for a product (if has_variant: true
). Provides variant-specific details (pricing, SKU, images).GET /catalog/products/{product_id}/variants/{variant_id}
: Get full details for one specific Variant.GET /catalog/categories
: Fetch category tree for navigation.GET /catalog/products/{product_id}/reviews
: List reviews for a product.POST /catalog/products/{product_id}/reviews
: Submit a review (requires logged-in user, order number).GET /catalog/products/similar
: Get similar Items.GET /catalog/products/up-sell
: Get upsell Items.GET /catalog/products/cross-sell
: Get cross-sell Items.POST /catalog/products/search
: Search returns a list of matching Items, plus facet data for filtering.Displaying a Product Listing Page (PLP)
Option A: Using GET /catalog/products (Client-side Variant Handling)
GET /catalog/products
with filters (category_id
, customer_group_id
).products
array.name
, primary image (images[0]
).has_variant
:
If false:
Display price from product.pricing
. The “Add to Cart” button uses product_id
and variant_id: null
.If true:
product.variants
array, find where is_default: true
).product.variants
and add the selected variant_id
to the cart.product.slug
or product_id
.Option B: Using GET /catalog/skus (Pre-flattened Items)
GET /catalog/skus
with filters (category_id
, customer_group_id
). This directly returns sellable Items.items
(renamed from skus
) array.item.product_name
and potentially item.variant_name
.item.images[0]
).item.pricing.selling_price
).item.product_id
and item.variant_id
.item.product_id
(and potentially pre-select the variant based on item.variant_id
).Displaying a Product Detail Page (PDP)
GET /catalog/products/{product_id_or_slug}
. Pass customer_group_id
if applicable.name
, description
, attributes (attributes
), base images/videos, SEO.If product.has_variant is true:
product.variant_options
.GET /catalog/products/{product_id}/variants
to fetch all variant data upfront or implement logic to fetch/update details (price, image, SKU, stock status, variant-specific description/attributes) dynamically as the user selects options. Map selected options to the corresponding Variant
using its associated_options
.variant_id
.If product.has_variant is false:
Product
object.product_id
and variant_id: null
.GET /products/{id}/reviews
).similar
, upsell
, cross-sell
), passing the current product_id
.Implementing Search with Facets