Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Brand API handler

Manage brand information, categories, product lines, and brand alphabet for browsing.

GET Brand Alphabet

HTTP Verb – GET

URL – /api/v1/brandalphabet

Description – Get the brand alphabet with counts for each letter

BaseHandlerBase\<GetBrandAlphabetParameter, GetBrandAlphabetResult\>

Handlers

OrderHandlerDescription
500GetBrandAlphabetQueries the product search provider for brand first-character facets sorted ascending. Sets the raw facet results on the result.
600ProcessBrandAlphabetFacetsTransforms the raw facets into a list of GetBrandAlphabetLetterResult objects, each containing the Letter and Count.

GET Brand By Path

HTTP Verb – GET

URL – /api/v1/brands/getByPath

Description – Get a brand by its URL path

BaseHandlerBase\<GetBrandByPathParameter, GetBrandByPathResult\>

Handlers

OrderHandlerDescription
500GetBrandByPathDecodes the URL path and extracts the brand URL segment using the catalog path builder. Looks up the brand by URL segment in the BrandRepository. If found, calls the BrandService.GetBrand to get the full brand result. Returns error if the brand service call fails.

GET Brand

HTTP Verb – GET

URL – /api/v1/brands/{BrandId}

Description – Get a single brand by Id

BaseHandlerBase\<GetBrandParameter, GetBrandResult\>

Handlers

OrderHandlerDescription
500GetBrandCalls GetBrandCollection with the specified BrandId and optional parameters (GetTopSellers, GetHtmlContent, GetCustomProperties). Returns error if the collection call fails or if exactly one brand is not found (returns NotFound).

GET Brand Category Collection

HTTP Verb – GET

URL – /api/v1/brands/{BrandId}/categories

Description – Get a collection of categories for a brand

BaseHandlerBase\<GetBrandCategoryCollectionParameter, GetBrandCategoryCollectionResult\>

Handlers

OrderHandlerDescription
500GetBrandRetrieves the Brand entity by Id. Returns NotFound error with Brand_NotFound message if not found.
600FindBrandCategoriesWithSearchValidates the Sort parameter (only name, name asc, name desc allowed). Uses the product search provider to get all allowed brand category Ids. If CategoryId is specified, filters to that single category. Applies sorting and pagination to the category Ids.
700GetBrandCategoryQueryCreates a query for Category entities filtered by the resolved category Ids from the previous step.
800GetBrandCategoryImagesQueryCreates a query for BrandCategoryImage entities filtered by the brand Id and resolved category Ids.
900ExecuteBrandCategoryQueryExecutes the category query and orders the results to match the order from the search provider.
1000ExecuteBrandCategoryImagesQueryExecutes the brand category images query to materialize the image results.
1100CreateGetBrandCategoryResultsFor each category, creates a GetBrandCategoryResult using the brand pipeline, passing the brand, category, optional brand category image, and parameters for HTML content, custom properties, and language.
1200GetSubCategoriesBuilds sub-category trees for each brand category result using the parent-to-subcategory dictionary. Recursively builds sub-categories up to the specified MaximumDepth parameter.
1300GetTopSellersFor brand categories that have sub-categories but no featured image, retrieves the top-selling product to use its image as the featured image. Falls back to the configured NotFoundMediumImagePath if no top seller is found.

GET Brand Category

HTTP Verb – GET

URL – /api/v1/brands/{BrandId}/categories/{CategoryId}

Description – Get a single brand category

BaseHandlerBase\<GetBrandCategoryParameter, GetBrandCategoryResult\>

Handlers

OrderHandlerDescription
500GetBrandCategoryCalls GetBrandCategoryCollection with the specified BrandId and CategoryId. Returns error if the collection call fails or if exactly one category is not found (returns NotFound).
600PopulateSubCategoriesIf GetSubCategories parameter is true, retrieves sub-categories for the brand category that have products. For each sub-category, creates a GetBrandCategoryResult using the brand pipeline.

GET Brand Product Line Collection

HTTP Verb – GET

URL – /api/v1/brands/{BrandId}/productlines

Description – Get a collection of product lines for a brand

BaseHandlerBase\<GetBrandProductLineCollectionParameter, GetBrandProductLineCollectionResult\>

Handlers

OrderHandlerDescription
100GetBrandRetrieves the Brand entity by Id. Returns NotFound error with Brand_NotFound message if not found.
500FindBrandProductLinesWithSearchValidates the Sort parameter (only name, name asc, name desc allowed). Uses the product search provider to get product line facets for the brand. If ProductLineId is specified and not found, returns NotFound. Applies pagination unless a specific ProductLineId is requested.
600GetBrandProductLineQueryCreates a query for ProductLine entities filtered by the resolved product line Ids.
800ExecuteQueryExecutes the product line query and orders results to match the order from the search provider.
1100CreateGetBrandProductLineResultsFor each product line, creates a GetBrandProductLineResult using the brand pipeline, passing the brand, product line, and parameters for custom properties and language.

GET Brand Product Line

HTTP Verb – GET

URL – /api/v1/brands/{BrandId}/productlines/{ProductLineId}

Description – Get a single brand product line

BaseHandlerBase\<GetBrandProductLineParameter, GetBrandProductLineResult\>

Handlers

OrderHandlerDescription
500GetBrandProductLineCalls GetBrandProductLineCollection with the specified BrandId and ProductLineId. Returns error if the collection call fails or if exactly one product line is not found (returns NotFound).