---
title: V2 Products API handler
slug: configured-commerce/docs/v2-products-api-handler
createdAt: 2026-08-13T10:46:30.000Z
---

## GetProduct

| Order | Handler             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | GetProduct          | Retrieves product information using the \`GetProductCollection\` service.<br />- **Key functionality**<br />- Creates a `GetProductCollectionParameter` from the input parameter.<br />- Calls `productService.GetProductCollection` to get product details.<br />- Ensures exactly one active product is found.<br />- **Skip conditions**<br />- Returns error if `GetProductCollection` fails.<br />- Returns error if no products or more than one product is found.<br />- Returns error if the product is not active.<br />- **Data modifications**<br />- Sets `result.ProductDto` with the retrieved product information. |
| 600   | AddToRecentlyViewed | Adds the viewed product to the user's recently viewed products list.<br />- **Key functionality** – Calls catalog pipeline to add product to recently viewed list.<br />- **Skip conditions**<br />- Skipped if `parameter.AddToRecentlyViewed` is `false`.<br />- Skipped if widget settings have disabled recently viewed functionality.<br />- **Data modifications** – Updates recently viewed products in the user's session.                                                                                                                                                                                                |

## GetProductCollection

| Order | Handler                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ----- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | DisableLazyLoading            | Disables lazy loading for the database context.<br />- **Key functionality**– Prevents inadvertent lazy loading of related entities during handler execution.<br />- **Skip conditions** – None; always executes.<br />- **Data modifications** – Sets `DisableLazyLoading` on the unit of work's data provider.                                                                                                                                                                                                                                                                                                                                               |
| 600   | ValidateContext               | Validates the request context and parameters.<br />- **Key functionality**<br />- Verifies user has permission to view products.<br />- Ensures API compatibility with pricing and inventory settings.<br />- Validates parameter combinations and dependencies.<br />- **Skip conditions** – Returns error if validation fails.<br />- **Data modifications** – Sets `result.GetProductSettingsResult` with product settings.                                                                                                                                                                                                                                 |
| 700   | ValidateApplyPersonalization  | Validates personalization application conditions.<br />- **Key functionality** – Determines if personalization should be applied based on user status and personas.<br />- **Skip conditions**<br />- Skips personalization if `ApplyPersonalization` parameter is `false`.<br />- Skips if user is in CMS shell or is a remembered/signed-in user.<br />- Skips if no personalization session ID exists.<br />- Skips if no auto-assign personas are available.<br />- **Data modifications**<br />- Sets `result.PersonalizationSessionId`.<br />- Sets `result.AutoAssignGuestUserPersonas`.<br />- May modify `parameter.ApplyPersonalization` to `false`. |
| 800   | GetProductIdsForExtendedNames | Resolves product IDs from various product identifiers.<br />- **Key functionality**<br />- Checks for product replacement.<br />- Converts extended names, names, or ERP numbers to product IDs.<br />- Enforces product visibility restrictions if needed.<br />- **Skip conditions** – Skips if no product identifiers are provided.<br />- **Data modifications** – Sets `parameter.ProductIds` with resolved product IDs.                                                                                                                                                                                                                                  |
| 900   | GetFrequentlyPurchased        | Retrieves frequently purchased products.<br />- **Key functionality** – Gets frequently purchased products through catalog pipeline.<br />- **Skip conditions** – Skips if `GetFrequentlyPurchased` parameter is `false`.<br />- **Data modifications**<br />- Stores `result.GetFrequentlyPurchasedProductsResult`.<br />- Updates `parameter.ProductErpNumbers`.                                                                                                                                                                                                                                                                                             |
| 1000  | GetRecentlyPurchased          | Retrieves recently purchased products.<br />- **Key Functionality** – Gets recently purchased products through catalog pipeline.<br />- **Skip Conditions** – Skips if `GetRecentlyPurchased` parameter is `false`.<br />- **Data Modifications**<br />- Stores `result.GetRecentlyPurchasedProductsResult`.<br />- Updates `parameter.ProductErpNumbers`.                                                                                                                                                                                                                                                                                                     |
| 1100  | GetAlsoPurchased              | Retrieves "also purchased" product recommendations.<br />- **Key functionality**<br />- Gets products commonly purchased alongside products in current cart.<br />- Applies pagination to the results.<br />- **Skip conditions**<br />- Skipped if `GetAlsoPurchased` parameter is `false`.<br />- Skipped if cart is empty.<br />- **Data modifications** – Updates `parameter.ProductIds` with also purchased product IDs.                                                                                                                                                                                                                                  |
| 1200  | GetRecentlyViewed             | Retrieves recently viewed products.<br />- **Key functionality** – Gets recently viewed products through catalog pipeline.<br />- **Skip conditions** – Skips if `GetRecentlyViewed` parameter is `false`.<br />- **Data modifications**<br />- Stores `result.GetRecentlyViewedProductsResult`.<br />- Updates `parameter.ProductErpNumbers`.                                                                                                                                                                                                                                                                                                                 |
| 1300  | GetTopSellers                 | Retrieves top-selling products.<br />- **Key functionality**<br />- Gets top-selling products based on weighted scores.<br />- Filters by category, brand, or product line if specified.<br />- Supports randomization of recommended products.<br />- **Skip conditions** – Skips if `GetTopSellers` parameter is `false`.<br />- **Data modifications** – Updates `parameter.ProductIds` with top-selling product IDs.                                                                                                                                                                                                                                       |
| 1400  | GetSiteCrossSells             | Retrieves site-level cross-sell products.<br />- **Key functionality**<br />- Gets active cross-sell products defined at the website level.<br />- Filters for visible products and parent products for styled variants.<br />- **Skip conditions** – Skips if `GetSiteCrossSells` parameter is `false`.<br />- **Data modifications** – Updates `parameter.ProductIds` with site cross-sell product IDs.                                                                                                                                                                                                                                                      |
| 1500  | FindProductsWithSearch        | Executes product search using search criteria.<br />- **Key functionality**<br />- Configures comprehensive search parameter from request parameters.<br />- Executes search through catalog pipeline.<br />- Handles facet visibility based on settings.<br />- **Skip conditions** – Skips if `ProductIds` or `ProductExtendedNames` are already populated.<br />- **Data modifications**<br />- Stores `result.ProductSearchResult`.<br />- Sets `result.HideFacetsUntilCategorySelected`.                                                                                                                                                                  |
| 1510  | GetMissingVariants            | Retrieves variant products potentially missing from search results.<br />- **Key functionality**<br />- Identifies missing variant products from frequently/recently purchased items.<br />- Validates visibility of variant products.<br />- **Skip conditions** – Skips if not `GetFrequentlyPurchased` and not `GetRecentlyPurchased`.<br />- **Data modifications** – Adds visible variant product IDs to `result.AdditionalProductIds`.                                                                                                                                                                                                                   |
| 1600  | ProcessSearchResults          | Processes search results into product DTOs.<br />- **Key functionality**<br />- Converts search results to `ProductDto` objects.<br />- Populates result metadata (pagination, sorting options, and so on).<br />- Handles "did you mean" suggestions and corrected queries.<br />- **Skip conditions** – Skips if `ProductIds` or `ProductExtendedNames` are populated.<br />- **Data modifications**<br />- Populates `result.ProductDtos`.<br />- Sets pagination, sorting, and search metadata.                                                                                                                                                            |
| 1700  | PopulateContextData           | Populates context-specific data in product DTOs.<br />- **Key functionality** – Enriches product DTOs with context-dependent information.<br />- **Skip conditions** – Skips if `ProductDtos` is empty.<br />- **Data modifications** – Updates `result.ProductDtos` with context data.                                                                                                                                                                                                                                                                                                                                                                        |
| 1800  | GetExpandedProductData        | Retrieves expanded product data from database.<br />- **Key functionality**<br />- Configures product data retrieval parameters.<br />- Gets expanded product details from repository.<br />- Creates product DTOs for products by ID or additional products.<br />- **Skip conditions** – Skips if no product IDs, no product DTOs, and no additional product IDs.<br />- **Data modifications**<br />- Stores `result.GetProductDataResult`.<br />- Populates or updates `result.ProductDtos`.<br />- Updates product visibility based on rule engine evaluation.                                                                                            |
| 1900  | PopulateExpandedProductData   | Populates expanded product data into DTOs.<br />- **Key functionality**<br />- Adds variant traits, content, images, documents, specifications, and so on.<br />- Gets kit product data and visibility.<br />- Handles product translation.<br />- **Skip conditions** – Skips if `ProductDtos` is empty.<br />- **Data modifications**<br />- Enriches `result.ProductDtos` with expanded details.<br />- Filters out products found in search but not in database.                                                                                                                                                                                           |
| 2000  | SortByErpNumbers              | Sorts products by ERP numbers.<br />- **Key functionality**<br />- Sorts product DTOs by the order of their ERP numbers.<br />- Updates sort options accordingly.<br />- **Skip conditions** – Skips if not `GetFrequentlyPurchased` or `GetRecentlyViewed`.<br />- **Data modifications**<br />- Re-orders `result.ProductDtos`.<br />- Updates `result.SortOrder` and `result.SortOptions`.                                                                                                                                                                                                                                                                  |
| 2100  | SortByProductIds              | Sorts products by product IDs.<br />- **Key functionality**<br />- Sorts product DTOs by the order of their IDs.<br />- Updates sort options accordingly.<br />- **Skip conditions** – Skips if not `GetAlsoPurchased`, `GetTopSellers`, or `GetSiteCrossSells`.<br />- **Data modifications**<br />- Re-orders `result.ProductDtos`.<br />- Updates `result.SortOrder` and `result.SortOptions`.                                                                                                                                                                                                                                                              |
| 2200  | SortByRecentlyPurchased       | Sorts and configures recently purchased products.<br />- **Key functionality**<br />- Joins product DTOs with recently purchased products data.<br />- Sets the correct unit of measure as default for each product.<br />- **Skip conditions** – Skips if not `GetRecentlyPurchased`.<br />- **Data modifications**<br />- Updates `result.ProductDtos` with correct unit of measure defaults,<br />- Updates `result.SortOrder` and `result.SortOptions`.                                                                                                                                                                                                    |
| 2300  | SortAndPageByPrice            | Sorts products by price and applies pagination.<br />- **Key functionality**<br />- Gets product pricing from pricing pipeline if needed.<br />- Sorts products by price (low to high or high to low).<br />- Applies pagination to the sorted results.<br />- **Skip conditions**<br />- Skipped if using list pricing.<br />- Skipped if sort order is not price-based.<br />- Skipped if sort option is not available.<br />- **Data modifications**<br />- Updates `result.ProductDtos` with pricing data and applies sorting/paging.<br />- Updates `result.SortOrder` and `result.SortOptions`.                                                          |
| 2400  | CreatePersonalization         | Creates personalization events.<br />- **Key functionality** – Creates dynamic personalization events for product-related personas.<br />- **Skip conditions**<br />- Skipped if `ApplyPersonalization` is `false`.<br />- Skipped if no personalization persona IDs are available.<br />- **Data modifications** – Inserts personalization events into event repository.                                                                                                                                                                                                                                                                                      |
| 2500  | UpdatePersonalization         | Updates user personas based on personalization events.<br />- **Key functionality**<br />- Counts personalization events.<br />- Assigns additional personas to users who meet threshold criteria.<br />- **Skip conditions:**<br />- Skipped if `ApplyPersonalization` is `false`.<br />- Skipped if there are no eligible personas.<br />- **Data modifications** – Updates user's assigned personas in site context.                                                                                                                                                                                                                                        |

## GetRelatedProductCollection

| Order | Handler                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | ValidateContext             | Validates the product relationship parameter.<br />- **Key functionality**<br />- Retrieves valid relationship types from the `SystemListValue` table.<br />- Validates that the specified relationship exists and is valid.<br />- **Skip conditions**<br />- Returns error if relationship parameter is blank.<br />- Returns error if relationship is not in the list of valid relationships.<br />- **Data modifications** – None beyond error handling.                                                                                                                                                                                                                                                                                                                          |
| 600   | GetRelatedProductIds        | Retrieves IDs for products related to the specified product.<br />- **Key functionality**<br />- Sets default page size based on storefront API and catalog settings.<br />- Retrieves related products in batches from the `ProductRelatedProduct` table.<br />- Filters for products with the specified relationship type.<br />- Gets visible products and includes styled product variants with visible parents.<br />- Applies paging to the result set.<br />- **Skip conditions** – Continues to next handler without further processing if no visible related product IDs are found.<br />- **Data modifications**<br />- Sets `result.AllRelatedProductIds` with all related product IDs.<br />- Sets `result.VisibleRelatedProductIds` with filtered and paged product IDs. |
| 700   | GetRelatedProductCollection | Retrieves product information for the related product IDs.<br />- **Key functionality**<br />- Creates `GetProductCollectionParameter` using visible related product IDs.<br />- Calls `productService.GetProductCollection` to get product details.<br />- Orders the products based on the order in `AllRelatedProductIds`.<br />- Sets sort order to Relevance and filters sort options accordingly.<br />- **Skip conditions** – Skips if no visible related product IDs are present.<br />- **Data modifications**<br />- Sets `result.ProductDtos` with ordered product details.<br />- Sets `result.SortOrder` to Relevance.<br />- Sets `result.SortOptions` to only include Relevance sort option.                                                                           |

## GetAlsoPurchasedCollection

| Order | Handler                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | GetAlsoPurchasedProductIds | Retrieves product IDs for products commonly purchased with a specified product.<br />- **Key functionality**<br />- Sets the default page size based on storefront API settings.<br />- Sets the page size based on catalog general settings or defaults to storefront API settings.<br />- Retrieves both all also-purchased product IDs and visible also-purchased product IDs.<br />- Applies paging to the visible also-purchased product IDs.<br />- **Skip conditions** – Continues to next handler without further processing if no visible also-purchased product IDs are found.<br />- **Data modifications**<br />- Sets `parameter.DefaultPageSize` and `parameter.PageSize`.<br />- Sets `result.AllAlsoPurchasedProductIds` with all related product IDs.<br />- Sets `result.VisibleAlsoPurchasedProductIds` with filtered and paged product IDs. |
| 600   | GetAlsoPurchasedCollection | Retrieves product information for the also-purchased product IDs.<br />- **Key functionality**<br />- Creates `GetProductCollectionParameter` using visible also-purchased product IDs.<br />- Calls `productService.GetProductCollection` to get product details.<br />- Orders the product DTOs based on the order in `AllAlsoPurchasedProductIds`.<br />- Sets sort order to Relevance and filters sort options accordingly.<br />- **Skip conditions** – Skips processing if no visible also-purchased product IDs are present.<br />- **Data modifications**<br />- Sets `result.ProductDtos` with ordered product details.<br />- Sets `result.SortOrder` to Relevance<br />- Sets `result.SortOptions` to only include Relevance sort option.                                                                                                            |

## GetVariantChild

| Order | Handler         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | GetVariantChild | Retrieves a single variant child product.<br />- **Key functionality**<br />- Creates a `GetVariantChildCollectionParameter` from the input parameter.<br />- Calls `productService.GetVariantChildCollection` to get variant child details.<br />- Ensures exactly one active variant child product is found.<br />- **Skip conditions**<br />- Returns error if `GetVariantChildCollection` fails.<br />- Returns error if no products or more than one product is found.<br />- Returns error if the product is not active.<br />- **Data modifications** – Sets `result.ProductDto` with the retrieved variant child product information. |

## GetVariantChildCollection

| Order | Handler                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ----- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 500   | DisableLazyLoading      | Disables lazy loading for the database context.<br />- **Key functionality** – Prevents inadvertent lazy loading of related entities during handler execution.<br />- **Skip conditions** – None; always executes.<br />- **Data modifications** – Sets `DisableLazyLoading` on the unit of work's data provider.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 600   | ValidateContext         | Validates the request context and parameter values.<br />- **Key functionality**<br />- Retrieves product settings to verify user permissions.<br />- Validates parameter combinations and dependencies.<br />- **Skip conditions**<br />- Returns error if user cannot see products.<br />- Returns error if attribute filter flags are set but attributes are not being retrieved.<br />- Returns error if both `ProductId` and `ProductIds` are specified.<br />- **Data modifications** – Sets `result.GetProductSettingsResult` with product settings.                                                                                                                                                                                                                                                                              |
| 700   | GetVariantChildIds      | Retrieves IDs for variant child products of the specified parent(s).<br />- **Key functionality**<br />- Queries database for products with `StyleParentId` matching the input product ID(s).<br />- Filters for a specific variant child if `VariantChildId` is specified.<br />- Applies sorting based on the `Sort` parameter.<br />- Gets visible variant child products by checking product restrictions.<br />- Applies paging to the result set.<br />- **Skip conditions** – Continues to next handler without further processing if no visible variant child IDs are found.<br />- **Data modifications**<br />- Sets `result.AllVariantChildIds` with all variant child IDs.<br />- Sets `result.VisibleVariantChildIds` with filtered and paged variant child IDs.<br />- Sets default `parameter.PageSize` if not specified. |
| 800   | GetVariantChildData     | Retrieves detailed data for the variant child products.<br />- **Key functionality**<br />- Configures `GetProductDataParameter` with necessary expand options.<br />- Retrieves comprehensive product data including brands, product lines, images, and so on.<br />- **Skip conditions** –None, if previous handlers have populated `VisibleVariantChildIds`.<br />- **Data modifications** – Sets `result.GetProductDataResult` with comprehensive product data.                                                                                                                                                                                                                                                                                                                                                                      |
| 900   | ProcessVariantChildData | Processes product data into DTOs with all necessary business logic.<br />- **Key functionality**<br />- Creates `ProductDto` objects for each variant child.<br />- Applies business rules for product visibility and purchasing restrictions.<br />- Populates variant-specific data including traits, content, specifications, and so on.<br />- Configures available sort options for variant children.<br />- **Skip conditions** – Skips if `GetProductDataResult` is null or contains no products.<br />- **Data modifications**<br />- Populates `result.ProductDtos` with fully processed variant child product DTOs.<br />- Sets `result.SortOptions` with applicable sort types for variant children.                                                                                                                          |
