Overview of the APIs and related concepts for managing the Product catalog of your Composable Commerce Project.
Product catalog is the central location where you can manage all your Product data definitions and sellable items. It acts as the foundation for your retail offerings in Composable Commerce.
This central repository lets you support structured data across all Products (Product Types), define navigational pathways (Categories), control Store-specific visibility (Product Selections), and manage how Products are shown to Customers on a storefront (Product Projections).
Definitions
Product
100 Product Variants.To support editorial workflows, each Product resource contains the following two representations of its Product data:
- Current: the published version that you need to present to your Customers on the storefront.
- Staged: the draft version to which your content editors can make updates, but it remains invisible to your Customers until explicitly published.
It isn't possible to stage certain Product data that's not intended to be exposed in the storefront, such as Tax Category or Price mode. These are immediately made available in the current representation after making any updates.
The Product lifecycle typically follows these steps:
- Creation: when a Product is created, both the current and staged representations are identical.
- Editing: when a content editor makes changes to the Product, they are applied to only the staged representation. The current representation remains unchanged and is visible to Customers.
- Publishing: when the editor is satisfied with the changes, they can publish the Product. This action copies the staged representation to the current representation and sets the
publishedflag astrue. - Further edits: after publishing, the editor can continue making changes to the staged representation, repeating the cycle.
- Unpublishing: if you don't want the Product to appear in the storefront, you can unpublish it. This action keeps the staged and current representations as they are, but it sets the
publishedflag asfalse. - Deletion: when a Product is no longer needed, you can delete it. This action removes both the current and staged representations from the Project. Only unpublished Products can be deleted.
Product Variant
- Master Variant: every Product has one Master Variant, typically presented as the default on Product detail pages.
- Other variants: an array of additional variants.
- Variant data: contains the following information that changes for every variant:
-
Prices: specific Prices, including tiers, Customer Groups, and Channels.
-
Images: images that are specific to a color and size combination.
-
Attributes: values for Variant Attributes such as
color: Redorsize: L. -
SKU: unique identifier of each variant. The primary role of SKUs is to act as the permanent, machine-readable key for Inventory tracking, ordering, and fulfillment.
We recommend that you don't frequently change any SKU because this can trigger unwanted performance-impacting changes in related resources like Product Selections where the SKU is used as an identifier.
-
Attribute
Product Projection
The two most important aspects of a Product Projection are as follows:
-
Publishing state: choose between current data and staged data by using the
stagedquery parameter on the Product Projections endpoints. These endpoints request the current projection by default because it's the typical use case for Customer-facing storefronts. -
Contextual data: you can "project" the data to fit a specific context. For example, you can query a Product Projection to show the following contextual data:
- Offered Price for a Product Variant by using the Product price selection process. The Product Projection API uses this process to filter Prices based on the provided Store context (currencies, countries, and distribution Channels) to find the most relevant and targeted Price.
- Localized Attributes (like
nameanddescription) in a specific language, such as German. - Inventory availability for a specific warehouse or sales Channel.
Attribute Group
An Attribute Group lets you group related Attributes for easier data entry (such as to bundle color, material, and fit into a Core Specifications group) and define granular editing permissions based on these groups.
meta_title and meta_description into an SEO Metadata group) so that you can restrict editing permissions to specific teams (such as only for the Marketing team).Product Type
Product Types help define the Attributes of a Product. You can define the meta-information associated with an Attribute as part of a Product Type. For example, you can configure whether the Attribute is searchable and define its constraints.
The primary purpose of Product Types is as follows:
-
Define custom Attributes: configure the set of custom fields (Attributes) that a Product or its variants can have.
-
Configure Attribute structure: define where the values of Attribute are stored:
- Variant Attribute: Attributes that vary per SKU (like color or size).
- Product Attribute: Attributes that are identical across all variants (like
brandorwashing_instructions).
-
Control Attribute behavior: specify the constraints and search behavior for each Attribute:
- Constraints: enforce rules such as requiring an Attribute or making its value unique across variants.
- Searchability: specify which Attributes should be searchable, filterable, or used for facets in search queries, which is important for the storefront experience.
Product Selection
A Product Selection is essentially a separate resource that establishes a relationship between one Store and many Products that determines which Products are available within the scope of a given Store.
You can create a Product Selection, and then assign specific Products to it. Your frontend application makes a Product Projections API call to retrieve the Products that are part of the Product Selection.
You can use a Product Selection in the following key scenarios:
- Assortment control: allow different geographic regions or distinct brands operating within the same commercetools Project to display only their relevant Products.
- Product visibility: temporarily limit or expand the catalog for specific sales Channels without modifying Product content.
Product Tailoring
We recommend that you use localized fields when the content differences among your Stores are related to language translation. And use Product Tailoring when the differences pertain to marketing, legal, or region-specific content.
You can use Product Tailoring in the following key scenarios:
- Store-specific naming: change the Product name, description, or slug (URL) to use locally appropriate terms.
- Asset customization: override the set of images or Product assets to feature models or settings that are relevant for a specific local market.
In addition to managing resource access, a Store is a tool for tailoring Product information. By combining Stores and Product Tailoring, you can customize Product details such as names, descriptions, slugs, images, and selected Attributes on a per-Store basis. This lets you present targeted and relevant catalog content for different Customer segments, regions, or brands.
Searching for Products by using Store-specific tailored names isn't possible in the Merchant Center. Also, you can't import or export Product Tailoring data from the Merchant Center.
Product Search
current representation of a Product resource, not the staged representation.You can use the Product Search API to implement the following features on your Product listing page:
- Full-text search: let Customers find Products by entering specific search terms.
- Filtering and facets: enable the feature to refine results by using dynamic filters (facets) based on Product Attributes, such as filtering Products by size, color, or brand.
- Sorting: order search results by various criteria such as Price, popularity, or newest arrivals.
Category
Categories have the following key characteristics:
- Hierarchical structure: Categories are designed to form a tree structure. You can have multiple root-level Categories; such Categories don't have a parent Category. And each Category can have zero to several child Categories.
- Product assignment: Products are explicitly linked to one or more Categories. This ensures that a single Product can appear in multiple locations in the storefront navigation simultaneously.
Categories are essential for the following Customer-facing features and content organization:
- Storefront navigation: Categories form the primary menu structure that Customers use to browse Products on your storefront.
- SEO optimization: Categories include fields such as slug (the URL part) and metaDescription that are crucial for search engine optimization (SEO).
Review
Reviews have the following key characteristics:
- Customer feedback collection: Reviews store the rating score, text of the Customer's comment, author's details, and metadata such as the date and title of the Review.
- Product enrichment: the Reviews API provides aggregated statistics, such as average rating and total count, that are calculated from all linked reviews, which are then used to display ratings badges on Product pages.
- Moderation and visibility: Reviews include a State field such as
approved,pending, orrejected. This lets you moderate content before it becomes visible on the storefront. Review States are user-defined and configured in a State machine, letting you control the names and allowed transitions.
Product data management
This section describes how to manage your product data in Composable Commerce to make them available for purchase.
Collect data
Standardize and cleanse the data
Before importing Product data into Composable Commerce, it's essential that you standardize and cleanse the data to ensure consistency and accuracy across your Product catalog. This process can include the following steps:
- Removing duplicate entries
- Correcting errors
- Supplementing missing information
- Formatting the data into a consistent, standardized structure
Ingest the data
Composable Commerce offers several flexible options for data ingestion to suit the following business needs, from manual updates to large-scale automated synchronization:
Merchant Center manual entry
Users can create and edit individual Products and variants directly within the Merchant Center UI. This method is ideal for making small, ad-hoc updates and managing unique Product details one by one.
Merchant Center file upload
For bulk operations, the Merchant Center allows non-technical users to import data by using either CSV or JSON files. This is suitable for initial data migration or periodic mass updates of Products, Prices, and Inventory without needing API development.
Synchronous Products API
Asynchronous Import API
Libraries and CLI tools
Enrich the Product data
Add detailed and engaging content to raw Product data, including marketing descriptions, high-quality images, videos, feature highlights, Customer reviews, and SEO optimization to improve Product appeal and search visibility.
Categorize and structure your Products
Organize your Products into logical hierarchies, Categories, and taxonomies to facilitate easy navigation and provide an intuitive Customer experience.
Manage Attributes and variants
Define and manage specific Product attributes (size, color, weight, material) and handle Product variations or configurable "bundles" and "kits".
Manage pricing and Inventory
Maintain accurate base pricing, promotional offers, real-time Inventory levels, and availability statuses, often by integrating with ERP or inventory management systems.
Manage workflow and governance
Establish clear workflows, role-based access controls, and approval processes to maintain data quality, track changes, and ensure compliance before information is published.
Implement localization and personalization
Customize Product information, including translations, regional pricing, and specific content, for different markets and Customer segments.
Performance monitoring and analysis
Track catalog performance metrics, such as data completeness, conversion rates, and return rates, and use Customer feedback and analytics to inform future optimizations.
Storefront consumption
Projection dimensions
Current / staged
current projected representation. Newly created Products only have a staged projected representation. Typically, a storefront application retrieves the Product data by either querying or searching the current Product Projections.Locales
- Locales defined directly with the
localeProjectionquery parameter. - Locales configured in the Store that's specified with the
storeProjectionquery parameter.
If no translation is found on a given field for the specified locales, another locale is used as a fallback. This ensures that required fields can't remain empty in the Product Projection.
Prices
Price projection is a mechanism for filtering Prices that are included in a Product Projection. It ensures that the API response for a Product contains only the Prices that are relevant to a specific context, such as a particular country, Customer Group, or distribution Channel. This practice simplifies client-side logic by preventing API responses from being cluttered with a Product's entire, often extensive, Price list.
Projection by Store
storeProjection query parameter.distributionChannels set, then the Product Projection includes only the Prices that meet any one of the following criteria:- The Price has a distribution Channel that's included in the Store's
distributionChannels. - The Price doesn't have an assigned distribution Channel.
countries set, then the projection includes only the Prices that meet any one of the following criteria:- The Price has a country that's included in the Store's
countries. - The Price doesn't have any assigned country.
prices array within the Product Projection.Projection by price selection
priceCurrency, priceCountry, priceCustomerGroup, and priceChannel.When Price selection is applied, the Product Variants that are returned contain the following two fields with Prices:
- The
pricesarray contains Embedded Prices (optionally projected by Store); Standalone Prices are never included. - The optional
pricefield contains the best matching Price based on the provided Price selection parameters. This can be either an Embedded Price or a Standalone Price.
Inventory entries
storeProjection query parameter.supplyChannels set, then only the following Inventory entries are included in the projected Product Variants availability:- Inventory entries with a supply Channel that's included in the Store's
supplyChannels - Inventory entries without a supply Channel
Product Selection assignments
Attributes
filter[attributes] query parameter to specify Product Attributes that you want to include or exclude in the Product Projections response.- Include Attributes: specify the Attribute names to include them in the response.
- Exclude Attributes: add a dash (
-) before the Attribute names to exclude them from the response.
You can include or exclude Product Attributes, Attributes in the Master Variant, and all other variants of the Product.
Here are a few example queries:
curl --get https://api.{region}.commercetools.com/{projectKey}/product-projections/{id}?filter[attributes]=color&filter[attributes]=size -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
color and size Attributes in the Product Projections response.curl --get https://api.{region}.commercetools.com/{projectKey}/product-projections/{id}?filter[attributes]=-description&filter[attributes]=-specifications -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
description and specifications in the Product Projections response.Product Projections API vs. Product Search API
Composable Commerce offers two primary APIs for Product discovery and retrieving Product information: the Product Projection API and the Product Search API. Both read-only APIs are optimized for Customer-facing storefront needs, but they serve different use cases and have distinct characteristics.
The following table compares use cases and features of each API, and it provides performance tips for optimal usage:
| Feature | Product Projections API | Product Search API |
|---|---|---|
| Purpose |
|
|
| Use case |
|
|
| Data consistency |
|
|
| Query language |
|
|
| Data returned |
|
|
| Publishing state |
|
|
| Product Selections |
|
|
| Performance tips |
|
|