Add the product to the excluded product list for a given catalog and category. After a product is added as an excluded product for the category, the categorization process no longer categorizes that product for that category.
If you would like to get a raw Response object use the other addProductsToExclusionList function.
An object containing the options for this method.
A promise of type ExcludedProductsResult.
Add the product to the excluded product list for a given catalog and category. After a product is added as an excluded product for the category, the categorization process no longer categorizes that product for that category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ExcludedProductsResult otherwise.
Create a category product assignment using the information provided.
Because the assigned position n is a normalized target position, we verify that the product is assigned to a position that maintains the position order.
For example, if we have products A, B, C at positions 1, 2, 3, and product D is assigned to position 2, the end result is products A, D, B, C with position order 1, 2, 3, 4.
If there are n existing position assignments, assigning a new product to position >= n+1 results in a new assignment with position n+1.
If you would like to get a raw Response object use the other assignProductToCategory function.
An object containing the options for this method.
A promise of type CategoryProductAssignment.
Create a category product assignment using the information provided.
Because the assigned position n is a normalized target position, we verify that the product is assigned to a position that maintains the position order.
For example, if we have products A, B, C at positions 1, 2, 3, and product D is assigned to position 2, the end result is products A, D, B, C with position order 1, 2, 3, 4.
If there are n existing position assignments, assigning a new product to position >= n+1 results in a new assignment with position n+1.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategoryProductAssignment otherwise.
Create a catalog category using the information provided.
If you would like to get a raw Response object use the other createCategoryInCatalog function.
An object containing the options for this method.
A promise of type Category.
Create a catalog category using the information provided.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Category otherwise.
Create all rules and conditions within the catalog and category. This deletes any existing rules and conditions for that catalog and category combination, and recreates them based on the new request. The LocaleID, PrimaryFlag, and ClassificationFlag can be set on any of the individual rules, but they apply to the entire ruleset. For simplicity, those values can be provided with one of the rules. If they are provided with multiple rules, then they must all have the same value for all rules or it could produce undesired effects.
If you would like to get a raw Response object use the other createCategoryRules function.
An object containing the options for this method.
A promise of type RulesResult.
Create all rules and conditions within the catalog and category. This deletes any existing rules and conditions for that catalog and category combination, and recreates them based on the new request. The LocaleID, PrimaryFlag, and ClassificationFlag can be set on any of the individual rules, but they apply to the entire ruleset. For simplicity, those values can be provided with one of the rules. If they are provided with multiple rules, then they must all have the same value for all rules or it could produce undesired effects.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type RulesResult otherwise.
Create or update a condition.
If you would like to get a raw Response object use the other createOrUpdateCategoryRuleCondition function.
An object containing the options for this method.
A promise of type Condition.
Create or update a condition.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Condition otherwise.
Create or update a rule.
If you would like to get a raw Response object use the other createUpdateRule function.
An object containing the options for this method.
A promise of type Rule.
Create or update a rule.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Rule otherwise.
Delete a category by catalog ID and category ID.
If you would like to get a raw Response object use the other deleteCategoryFromCatalog function.
An object containing the options for this method.
A promise of type void.
Delete a category by catalog ID and category ID.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Delete a condition.
If you would like to get a raw Response object use the other deleteCategoryRuleCondition function.
An object containing the options for this method.
A promise of type void.
Delete a condition.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Deletes all conditions for a given rule, catalog, and category.
If you would like to get a raw Response object use the other deleteCategoryRuleConditions function.
An object containing the options for this method.
A promise of type void.
Deletes all conditions for a given rule, catalog, and category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Delete all rules and conditions for the given catalog and category.
If you would like to get a raw Response object use the other deleteCategoryRules function.
An object containing the options for this method.
A promise of type void.
Delete all rules and conditions for the given catalog and category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Delete a rule.
If you would like to get a raw Response object use the other deleteRule function.
An object containing the options for this method.
A promise of type void.
Delete a rule.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Retrieve a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and we delete the assignment for product B, the result is products A, B, C at positions 1, null, 7.5.
If you would like to get a raw Response object use the other getAssignedProductFromCategory function.
An object containing the options for this method.
A promise of type CategoryProductAssignment.
Retrieve a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and we delete the assignment for product B, the result is products A, B, C at positions 1, null, 7.5.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategoryProductAssignment otherwise.
Gets the catalog with the specified information.
If you would like to get a raw Response object use the other getCatalog function.
An object containing the options for this method.
A promise of type Catalog.
Gets the catalog with the specified information.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Catalog otherwise.
Get the list of catalog IDs with no filtering.
If you would like to get a raw Response object use the other getCatalogs function.
An object containing the options for this method.
A promise of type Catalogs.
Get the list of catalog IDs with no filtering.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Catalogs otherwise.
Get all categories with no filtering.
If you would like to get a raw Response object use the other getCategoriesFromCatalog function.
An object containing the options for this method.
A promise of type Categories.
Get all categories with no filtering.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Categories otherwise.
Get the status of the latest categorization job, which could be evaluation or execution. For evaluation, the matched count and a paginated list of product IDs are returned. For execution, the counts of the products that are assigned or unassigned are returned.
If you would like to get a raw Response object use the other getCategorizationStatus function.
An object containing the options for this method.
A promise of type ExecutionJobStatusResult.
Get the status of the latest categorization job, which could be evaluation or execution. For evaluation, the matched count and a paginated list of product IDs are returned. For execution, the counts of the products that are assigned or unassigned are returned.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ExecutionJobStatusResult otherwise.
By default, the server returns the first level of sub-categories, but you can specify another level by setting the levels parameter. Using a large value for levels can cause performance issues with large and deep category trees.
If you would like to get a raw Response object use the other getCategoryFromCatalog function.
An object containing the options for this method.
A promise of type Category.
By default, the server returns the first level of sub-categories, but you can specify another level by setting the levels parameter. Using a large value for levels can cause performance issues with large and deep category trees.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Category otherwise.
Get a condition by ID.
If you would like to get a raw Response object use the other getCategoryRuleCondition function.
An object containing the options for this method.
A promise of type Condition.
Get a condition by ID.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Condition otherwise.
Get the conditions for a given rule, catalog and category.
If you would like to get a raw Response object use the other getCategoryRuleConditions function.
An object containing the options for this method.
A promise of type ConditionsResult.
Get the conditions for a given rule, catalog and category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ConditionsResult otherwise.
Get all rules for the given catalog and category.
If you would like to get a raw Response object use the other getCategoryRules function.
An object containing the options for this method.
A promise of type RulesResult.
Get all rules for the given catalog and category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type RulesResult otherwise.
Get the list of excluded products for a given catalog and category.
If you would like to get a raw Response object use the other getExclusionList function.
An object containing the options for this method.
A promise of type ExcludedProductsResult.
Get the list of excluded products for a given catalog and category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type ExcludedProductsResult otherwise.
Get a rule by ID.
If you would like to get a raw Response object use the other getRuleById function.
An object containing the options for this method.
A promise of type Rule.
Get a rule by ID.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Rule otherwise.
Delete products from the excluded products list for a catalog category.
If you would like to get a raw Response object use the other removeProductsFromExclusionList function.
An object containing the options for this method.
A promise of type void.
Delete products from the excluded products list for a catalog category.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Submit a job to evaluate or execute the rules. The evaluation returns a set of matching products based on the rules and conditions. The execution categorizes the products based on the evaluated results.
If you would like to get a raw Response object use the other runCategoryRules function.
An object containing the options for this method.
A promise of type void.
Submit a job to evaluate or execute the rules. The evaluation returns a set of matching products based on the rules and conditions. The execution categorizes the products based on the evaluated results.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Search for catalogs.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
There are two additional fields that can be used as search filters. They are not attributes in the CatalogWO object, but they can be used as filters to query catalogs based on site assignments.
Attribute | Type |
---|---|
isMasterCatalog | Boolean |
isStorefrontCatalog | Boolean |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
When you use isMasterCatalog in the search query, catalogs without any site assignments are returned. When you use isStorefrontCatalog in the search query, catalogs with one or more site assignments are returned.
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
If you would like to get a raw Response object use the other searchCatalogs function.
An object containing the options for this method.
A promise of type CatalogSearchResult.
Search for catalogs.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
There are two additional fields that can be used as search filters. They are not attributes in the CatalogWO object, but they can be used as filters to query catalogs based on site assignments.
Attribute | Type |
---|---|
isMasterCatalog | Boolean |
isStorefrontCatalog | Boolean |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
When you use isMasterCatalog in the search query, catalogs without any site assignments are returned. When you use isStorefrontCatalog in the search query, catalogs with one or more site assignments are returned.
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CatalogSearchResult otherwise.
Search for catalog categories. By default, the server returns the first level of subcategories, but you can specify another level by setting the levels parameter. Subcategories are sorted by category position, then by categoryId. Using a large value for levels can cause performance issues with large and deep category trees.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
catalogId | String |
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
If no sorting clause is provided, categories are sorted by categoryId. If sorting clause(s) are provided, categoryId is used as a tiebreaker.
If you would like to get a raw Response object use the other searchCategories function.
An object containing the options for this method.
A promise of type CategorySearchResult.
Search for catalog categories. By default, the server returns the first level of subcategories, but you can specify another level by setting the levels parameter. Subcategories are sorted by category position, then by categoryId. Using a large value for levels can cause performance issues with large and deep category trees.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
catalogId | String |
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
If no sorting clause is provided, categories are sorted by categoryId. If sorting clause(s) are provided, categoryId is used as a tiebreaker.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategorySearchResult otherwise.
Search for catalog categories in the scope of a catalog. By default, the server returns the first level of subcategories, but you can specify another level by setting the levels parameter. Subcategories are sorted by category position, then by categoryId. Using a large value for levels can cause performance issues with large and deep category trees.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
parentCategoryId | String |
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
If no sorting clause is provided, categories are sorted by categoryId. If sorting clause(s) are provided, categoryId is used as a tiebreaker.
If you would like to get a raw Response object use the other searchCategoriesInCatalog function.
An object containing the options for this method.
A promise of type CategorySearchResult.
Search for catalog categories in the scope of a catalog. By default, the server returns the first level of subcategories, but you can specify another level by setting the levels parameter. Subcategories are sorted by category position, then by categoryId. Using a large value for levels can cause performance issues with large and deep category trees.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
parentCategoryId | String |
The output of the query can also be sorted with the following sortable attributes:
Attribute | Type |
---|---|
id | String |
name | String |
description | String |
creationDate | DateTime |
online | Boolean |
position | Double |
If no sorting clause is provided, categories are sorted by categoryId. If sorting clause(s) are provided, categoryId is used as a tiebreaker.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategorySearchResult otherwise.
The query attribute specifies a complex query that can be used to narrow down the search.
Searchable attributes:
Attribute | Type |
---|---|
productId | String |
productName | String |
onlineFlag | Boolean |
searchable | Boolean |
validFrom | DateTime |
validTo | DateTime |
creationDate | DateTime |
Sortable Fields:
Attribute | Type |
---|---|
productId | String |
productName | String |
position | Double |
creationDate | DateTime |
Expansions that can be applied for the search request:
The product_base expand enables retrieval of the following basic product information:
Attribute | Type | Function |
---|---|---|
none | String | Does not fetch any expanded information. |
product_images | String | Fetch preview image and image groups specified for the given product. |
product_all_images | String | Fetch preview image, image groups specified for the product, and variant and variation group images. |
product_variations | String | Fetch variations-related information. |
product_availability | String | Fetch availability-related information. |
product_categories | String | Fetch category-related information. |
product_prices | String | Fetch price-related information. |
product_options | String | Fetch options-related information. |
product_all | String | Fetch all expanded information. This is the default used when no expand value is included in the request. |
Note: productAll includes the following:
If you would like to get a raw Response object use the other searchProductsAssignedToCategory function.
An object containing the options for this method.
A promise of type CategoryProductAssignmentSearchResult.
The query attribute specifies a complex query that can be used to narrow down the search.
Searchable attributes:
Attribute | Type |
---|---|
productId | String |
productName | String |
onlineFlag | Boolean |
searchable | Boolean |
validFrom | DateTime |
validTo | DateTime |
creationDate | DateTime |
Sortable Fields:
Attribute | Type |
---|---|
productId | String |
productName | String |
position | Double |
creationDate | DateTime |
Expansions that can be applied for the search request:
The product_base expand enables retrieval of the following basic product information:
Attribute | Type | Function |
---|---|---|
none | String | Does not fetch any expanded information. |
product_images | String | Fetch preview image and image groups specified for the given product. |
product_all_images | String | Fetch preview image, image groups specified for the product, and variant and variation group images. |
product_variations | String | Fetch variations-related information. |
product_availability | String | Fetch availability-related information. |
product_categories | String | Fetch category-related information. |
product_prices | String | Fetch price-related information. |
product_options | String | Fetch options-related information. |
product_all | String | Fetch all expanded information. This is the default used when no expand value is included in the request. |
Note: productAll includes the following:
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategoryProductAssignmentSearchResult otherwise.
Remove a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and we delete the assignment for product B, the result is products A, B, C at positions 1, null, 7.5.
If you would like to get a raw Response object use the other unassignProductFromCategory function.
An object containing the options for this method.
A promise of type void.
Remove a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and we delete the assignment for product B, the result is products A, B, C at positions 1, null, 7.5.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type void otherwise.
Update the catalog with the specified information.
If you would like to get a raw Response object use the other updateCatalog function.
An object containing the options for this method.
A promise of type Catalog.
Update the catalog with the specified information.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Catalog otherwise.
Update a catalog category using the information provided.
If you would like to get a raw Response object use the other updateCategoryInCatalog function.
An object containing the options for this method.
A promise of type Category.
Update a catalog category using the information provided.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type Category otherwise.
Update the category product assignment with the specified information, such as position. Because the assigned position n is a normalized target position, we verify that the product is assigned to a position that maintains position order.
For example, if we have products A, B, C, D at positions 1, 2, 3, 4 and we update product A with a new position of 3, the end result is products B, C, A, D with position order 1, 2, 3, 4. If we then update product C to no position, the end result is products B, A, D, C with position order 1, 2, 3, null.
If there are n existing positioned assignments, updating a product to position >= n results in a new assignment with a position that maintains the position order.
If you would like to get a raw Response object use the other updateProductCategoryAssignment function.
An object containing the options for this method.
A promise of type CategoryProductAssignment.
Update the category product assignment with the specified information, such as position. Because the assigned position n is a normalized target position, we verify that the product is assigned to a position that maintains position order.
For example, if we have products A, B, C, D at positions 1, 2, 3, 4 and we update product A with a new position of 3, the end result is products B, C, A, D with position order 1, 2, 3, 4. If we then update product C to no position, the end result is products B, A, D, C with position order 1, 2, 3, null.
If there are n existing positioned assignments, updating a product to position >= n results in a new assignment with a position that maintains the position order.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type CategoryProductAssignment otherwise.
Generated using TypeDoc
Catalogs
*# API Overview
With the Catalogs API, you can:
For more information, see the Catalogs and Categories sections of the Salesforce B2C Commerce Infocenter.
Authentication & Authorization
The client managing catalog and category information must have access to the Categories and Catalogs resources. This API requires a bearer token in the header of the request. The client accessing the API must first authenticate against Account Manager to get the bearer token.
You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see the Authorization Scopes Catalog.
Use Cases
Here are some common use cases for the API:
Categorize Products
Use the Catalogs API to assign products to categories so that shoppers can find all products that are merchandized in that category.
Validate Product Category Assignments
Use the Catalogs API to search for products assigned to a category within a site catalog to validate whether a product is merchandized and ready to be sold in one or more ecommerce channels. You can also update a product to make sure it meets the readiness criteria for each channel.
Edit Categories
Use the Catalogs API to edit categories assigned to a catalog to change the navigation path, make a category online or offline, change position of a category relative to other categories within a catalog.
Resources
A Salesforce B2C Commerce storefront implementation uses a Catalog, Category, and Product architecture to organize your storefront. Product data is stored in a catalog, and the stored product data is organized by categories. You can create any number of catalog, category, and product scenarios to address your business needs.
Catalogs
A catalog is a collection of categories, products, and images. It’s best practice to create two catalogs: the master catalog and the storefront catalog. The master catalog provides the same structure as an external system of record for your products. The storefront catalog is where you create categories that appear on your storefront.
Categories
You create and organize categories and subcategories to organize and group products in your catalog and on your storefront. Categories allow Products to be organized into hierarchical structures. Categories can have relationships to other parent categories. Each category also can provide a context that is inherited by subcategories, for example a category may have an attribute value assigned to it and any product assigned to the category or a subcategory would inherit the attribute value as long as the product is assigned. Once the product is removed from the category those attribute values would no longer be in the context of the product.
Products
Products are the items and services for sale on the storefront. All of your product data is stored in your master catalog. For a product or service to show on your storefront, it must be assigned to a category.*
For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html
Example with admin auth
API Version: 1.4.4import { CatalogsV1, ClientConfig } from "commerce-sdk"; // or const { CatalogsV1, ClientConfig } = require("commerce-sdk"); const clientConfig: ClientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; const catalogsClient = new CatalogsV1(clientConfig);
Last Updated: