Adds the product to the excluded product list for a given catalog and category. Once a product is added as an excluded product for the category, then the the categorization process does not categorize 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 Catalogs.ExcludedProductsResult.
Adds the product to the excluded product list for a given catalog and category. Once a product is added as an excluded product for the category, then the the categorization process does not categorize 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 Catalogs.ExcludedProductsResult otherwise.
Creates a category product assignment using the information provided.
As the assigned position n is a normalized target position, we'll make sure that the product is assigned to a position so that the order of positions are maintained.
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 A, D, B, C with order of positions 1, 2, 3, 4.
If there are n existing positioned assignment, assigning a new product to position >= n+1 will end with the 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 Catalogs.CategoryProductAssignment | Catalogs.CategoryProductAssignment.
Creates a category product assignment using the information provided.
As the assigned position n is a normalized target position, we'll make sure that the product is assigned to a position so that the order of positions are maintained.
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 A, D, B, C with order of positions 1, 2, 3, 4.
If there are n existing positioned assignment, assigning a new product to position >= n+1 will end with the 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 Catalogs.CategoryProductAssignment | Catalogs.CategoryProductAssignment otherwise.
Creates 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 Catalogs.Category | Catalogs.Category.
Creates 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 Catalogs.Category | Catalogs.Category otherwise.
Creates all rules and conditions within the catalog and category. This deletes any existing rules and conditions for that catalog-category 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 entire ruleset. For simplicity, those values can just 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 have 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 Catalogs.RulesResult.
Creates all rules and conditions within the catalog and category. This deletes any existing rules and conditions for that catalog-category 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 entire ruleset. For simplicity, those values can just 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 have 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 Catalogs.RulesResult otherwise.
Creates or updates 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 Catalogs.Condition | Catalogs.Condition.
Creates or updates 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 Catalogs.Condition | Catalogs.Condition otherwise.
Creates or updates 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 Catalogs.Rule | Catalogs.Rule.
Creates or updates 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 Catalogs.Rule | Catalogs.Rule otherwise.
Deletes the 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.
Deletes the 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.
Deletes 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.
Deletes 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 the 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 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 void otherwise.
Deletes all the rules along with conditions for 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.
Deletes all the rules along with conditions for 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.
Deletes 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.
Deletes 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.
Retrieves a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and delete assignment for product B, the products end up 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 Catalogs.CategoryProductAssignment.
Retrieves a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5, and delete assignment for product B, the products end up 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 Catalogs.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 Catalogs.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 Catalogs.Catalog otherwise.
Action to 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.Catalogs.
Action to 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.Catalogs otherwise.
Action to get all the 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 Catalogs.Categories.
Action to get all the 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 Catalogs.Categories otherwise.
Gets 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 which 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 Catalogs.ExecutionJobStatusResult.
Gets 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 which 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 Catalogs.ExecutionJobStatusResult otherwise.
Action to read an existing category within a catalog. By default, the server also returns the first level of sub-categories, but you can specify another level by setting the levels parameter. Using a large value for levels may cause performance issues in case of a large and deep category tree.
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 Catalogs.Category.
Action to read an existing category within a catalog. By default, the server also returns the first level of sub-categories, but you can specify another level by setting the levels parameter. Using a large value for levels may cause performance issues in case of a large and deep category tree.
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.Category otherwise.
Gets 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 Catalogs.Condition.
Gets 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 Catalogs.Condition otherwise.
Gets 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 Catalogs.ConditionsResult.
Gets 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 Catalogs.ConditionsResult otherwise.
Gets all the rules for 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 Catalogs.RulesResult.
Gets all the rules for 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 Catalogs.RulesResult otherwise.
Gets 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 Catalogs.ExcludedProductsResult.
Gets 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 Catalogs.ExcludedProductsResult otherwise.
Gets 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 Catalogs.Rule.
Gets 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 Catalogs.Rule otherwise.
Deletes 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.
Deletes 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.
Submits 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.
Submits 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.
Searches 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 CatalogWO object, but 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 |
On using isMasterCatalog in the search query, catalogs without any site assignments are returned. On using 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 Catalogs.CatalogSearchResult.
Searches 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 CatalogWO object, but 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 |
On using isMasterCatalog in the search query, catalogs without any site assignments are returned. On using 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 Catalogs.CatalogSearchResult otherwise.
Searches for catalog categories anywhere they appear. By default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. Please note, using a large value for levels may cause performance issues with a large and deep category tree.
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 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 Catalogs.CategorySearchResult.
Searches for catalog categories anywhere they appear. By default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. Please note, using a large value for levels may cause performance issues with a large and deep category tree.
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 |
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.CategorySearchResult otherwise.
Searches for catalog categories in the scope of catalog. By default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. Using a large value for levels may cause performance issues with a large and deep category tree.
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 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 Catalogs.CategorySearchResult.
Searches for catalog categories in the scope of catalog. By default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. Using a large value for levels may cause performance issues with a large and deep category tree.
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 |
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.CategorySearchResult otherwise.
Searches for category product assignments. The query attribute specifies a complex query that can be used to narrow down the search.
The following are 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 will enable retrieval of the following basic product information:
Attribute | Type | Function |
---|---|---|
none | String | Will 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 Catalogs.CategoryProductAssignmentSearchResult.
Searches for category product assignments. The query attribute specifies a complex query that can be used to narrow down the search.
The following are 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 will enable retrieval of the following basic product information:
Attribute | Type | Function |
---|---|---|
none | String | Will 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 Catalogs.CategoryProductAssignmentSearchResult otherwise.
Removes a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5 and delete assignment for product B, the products end up 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.
Removes a category product assignment.
For example, if we have products A, B, C at positions 1, 2, 7.5 and delete assignment for product B, the products end up 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.
Updates 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 Catalogs.Catalog.
Updates 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 Catalogs.Catalog otherwise.
Updates 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 Catalogs.Category.
Updates 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 Catalogs.Category otherwise.
Updates the category product assignment with the specified information, such as position. As the assigned position n is a normalized target position, we'll make sure that the product is assigned to a position so that the order of positions are maintained.
For example, if we have products A, B, C, D at positions 1, 2, 3, 4 and update product A with a new position of 3, the end result is B, C, A, D with order of positions 1, 2, 3, 4. If we then update product C to no position, the end result is B, A, D, C with order of positions 1, 2, 3, null.
If there are n existing positioned assignments, updating product to position >= n will end with a new assignment with a position such that the order of positions is maintained.
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 Catalogs.CategoryProductAssignment.
Updates the category product assignment with the specified information, such as position. As the assigned position n is a normalized target position, we'll make sure that the product is assigned to a position so that the order of positions are maintained.
For example, if we have products A, B, C, D at positions 1, 2, 3, 4 and update product A with a new position of 3, the end result is B, C, A, D with order of positions 1, 2, 3, 4. If we then update product C to no position, the end result is B, A, D, C with order of positions 1, 2, 3, null.
If there are n existing positioned assignments, updating product to position >= n will end with a new assignment with a position such that the order of positions is maintained.
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.CategoryProductAssignment otherwise.
Generated using TypeDoc
Catalogs
Build searchable product categories and catalogs.
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: 0.0.35import { Product, ClientConfig } from "commerce-sdk"; // or const { Product, 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 Product.Catalogs(clientConfig);
Last Updated: