Assign a variation for a product master. If the variation product does not initially exist, one is created using the body that is passed.
If you would like to get a raw Response object use the other assignVariationForMasterProduct function.
An object containing the options for this method.
A promise of type Variant.
Assign a variation for a product master. If the variation product does not initially exist, one is created using the body that is passed.
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 Variant otherwise.
Assign a variation group for a product. If the variation group product does not initially exist, one is created using the body passed in.
If you would like to get a raw Response object use the other assignVariationGroupToMasterProduct function.
An object containing the options for this method.
A promise of type VariationGroup.
Assign a variation group for a product. If the variation group product does not initially exist, one is created using the body passed in.
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 VariationGroup otherwise.
Create a product using the information provided. If a product with the same unique identifier exists, it is overwritten.
If you would like to get a raw Response object use the other createProduct function.
An object containing the options for this method.
A promise of type Product.
Create a product using the information provided. If a product with the same unique identifier exists, it is overwritten.
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 Product otherwise.
Creates a local product option using the information provided or binds a shared product option to the product.
If you would like to get a raw Response object use the other createProductOption function.
An object containing the options for this method.
A promise of type ProductOption.
Creates a local product option using the information provided or binds a shared product option to the product.
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 ProductOption otherwise.
Create a local product option value using the information provided.
If you would like to get a raw Response object use the other createProductOptionValue function.
An object containing the options for this method.
A promise of type ProductOptionValue.
Create a local product option value 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 ProductOptionValue otherwise.
Create a variation attribute using the information provided.
If you would like to get a raw Response object use the other createVariationAttribute function.
An object containing the options for this method.
A promise of type VariationAttribute.
Create a variation attribute 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 VariationAttribute otherwise.
Create a product variation attribute value.
If you would like to get a raw Response object use the other createVariationAttributeValue function.
An object containing the options for this method.
A promise of type VariationAttributeValue.
Create a product variation attribute value.
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 VariationAttributeValue otherwise.
Permanently remove a product by ID.
If you would like to get a raw Response object use the other deleteProduct function.
An object containing the options for this method.
A promise of type void.
Permanently remove a product 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 void otherwise.
Delete a local product option or unbind a shared product option from the product.
If you would like to get a raw Response object use the other deleteProductOption function.
An object containing the options for this method.
A promise of type void.
Delete a local product option or unbind a shared product option from the product.
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 local product option value by ID.
If you would like to get a raw Response object use the other deleteProductOptionValue function.
An object containing the options for this method.
A promise of type void.
Delete a local product option value 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 void otherwise.
Delete the variation attribute by ID.
If you would like to get a raw Response object use the other deleteVariationAttribute function.
An object containing the options for this method.
A promise of type void.
Delete the variation attribute 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 void otherwise.
Delete the variation attribute value of a variation attribute bound to a product.
If you would like to get a raw Response object use the other deleteVariationAttributeValue function.
An object containing the options for this method.
A promise of type void.
Delete the variation attribute value of a variation attribute bound to a product.
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.
Get the list of allowed attributes, values, and operators for creating rule-based categorization conditions.
If you would like to get a raw Response object use the other getCategorizationAttributeDefinitions function.
An object containing the options for this method.
A promise of type CategorizationAttributeDefinitionsResult.
Get the list of allowed attributes, values, and operators for creating rule-based categorization conditions.
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 CategorizationAttributeDefinitionsResult otherwise.
Retrieve detailed information about a specific product.
If you would like to get a raw Response object use the other getProduct function.
An object containing the options for this method.
A promise of type Product.
Retrieve detailed information about a specific product.
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 Product otherwise.
Read a local or shared product option for a specified product.
If you would like to get a raw Response object use the other getProductOption function.
An object containing the options for this method.
A promise of type ProductOption.
Read a local or shared product option for a specified product.
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 ProductOption otherwise.
Read a local product option value for a specified product.
If you would like to get a raw Response object use the other getProductOptionValue function.
An object containing the options for this method.
A promise of type ProductOptionValue.
Read a local product option value for a specified product.
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 ProductOptionValue otherwise.
Read local and shared product options for a specified product.
If you would like to get a raw Response object use the other getProductOptions function.
An object containing the options for this method.
A promise of type ProductOptions.
Read local and shared product options for a specified product.
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 ProductOptions otherwise.
Get variation attribute information only for master product.
If you would like to get a raw Response object use the other getVariationAttribute function.
An object containing the options for this method.
A promise of type VariationAttribute.
Get variation attribute information only for master product.
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 VariationAttribute otherwise.
Get product variation attribute information.
If you would like to get a raw Response object use the other getVariationAttributeValue function.
An object containing the options for this method.
A promise of type VariationAttributeValue.
Get product variation attribute 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 VariationAttributeValue otherwise.
Read variation attributes of a product of type variant, variation master, or variation group.
If you would like to get a raw Response object use the other getVariationAttributes function.
An object containing the options for this method.
A promise of type VariationAttributes.
Read variation attributes of a product of type variant, variation master, or variation group.
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 VariationAttributes otherwise.
Get details of a specific variation.
If you would like to get a raw Response object use the other getVariationForMasterProduct function.
An object containing the options for this method.
A promise of type Variant.
Get details of a specific variation.
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 Variant otherwise.
Read a variation group for a product.
If you would like to get a raw Response object use the other getVariationGroupForMasterProduct function.
An object containing the options for this method.
A promise of type VariationGroup.
Read a variation group for a product.
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 VariationGroup otherwise.
List all variation groups of a product.
If you would like to get a raw Response object use the other getVariationGroupsForMasterProduct function.
An object containing the options for this method.
A promise of type VariationGroups.
List all variation groups of a product.
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 VariationGroups otherwise.
List all variations of a master product.
If you would like to get a raw Response object use the other getVariationsForMasterProduct function.
An object containing the options for this method.
A promise of type Variants.
List all variations of a master product.
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 Variants otherwise.
Search product variations for master product or variation group product. The query attribute specifies a complex query that can be used to narrow down the search.
This is the list of searchable attributes:
Attribute | Type |
---|---|
id | String |
productId | String |
name | String |
online | SiteSpecific Boolean |
inStock | Boolean |
searchable | SiteSpecific Boolean |
ats - Available quantity to sell | Double |
variationAttribute.ATTRIBUTE_ID (Ex:variation_attribute.color) | String |
Sortable Fields:
Attribute | Type |
---|---|
id | String |
productId | String |
name | String |
online | SiteSpecific Boolean |
inStock | Boolean |
searchable | SiteSpecific Boolean |
ats - Available quantity to sell | Double |
Note: The calculated value of "online" and "searchable" is used in the search/sort. A search/sort by the site-specific attributes require the Site ID query parameter to be set. They are "online", "inStock", "searchable" and "ats". We assume that every field that starts with variationAttribute. is searchable and dot is followed by "ATTRIBUTE_ID".
The list of expansions to retrieve product information. The expand values available are:
_base - Basic product information is retrieved. This expand is included by default.
all - All product information, including the following properties are retrieved:
image
price - siteId must be provided to see this property
priceCurrency - siteId must be provided to see this property
availability - Information related to the availability of the product variation. This expand is not included by default.
ats - siteId must be provided to see this property
inStock - siteId must be provided to see this property
online - siteId must be provided to see this property
searchable
variations - Information related to product variations is retrieved. This expand is included by default.
attributes - Information related to product variation attributes is retrieved. This expand is not included by default.
If you would like to get a raw Response object use the other searchProductVariations function.
An object containing the options for this method.
A promise of type VariantSearchResult.
Search product variations for master product or variation group product. The query attribute specifies a complex query that can be used to narrow down the search.
This is the list of searchable attributes:
Attribute | Type |
---|---|
id | String |
productId | String |
name | String |
online | SiteSpecific Boolean |
inStock | Boolean |
searchable | SiteSpecific Boolean |
ats - Available quantity to sell | Double |
variationAttribute.ATTRIBUTE_ID (Ex:variation_attribute.color) | String |
Sortable Fields:
Attribute | Type |
---|---|
id | String |
productId | String |
name | String |
online | SiteSpecific Boolean |
inStock | Boolean |
searchable | SiteSpecific Boolean |
ats - Available quantity to sell | Double |
Note: The calculated value of "online" and "searchable" is used in the search/sort. A search/sort by the site-specific attributes require the Site ID query parameter to be set. They are "online", "inStock", "searchable" and "ats". We assume that every field that starts with variationAttribute. is searchable and dot is followed by "ATTRIBUTE_ID".
The list of expansions to retrieve product information. The expand values available are:
_base - Basic product information is retrieved. This expand is included by default.
all - All product information, including the following properties are retrieved:
image
price - siteId must be provided to see this property
priceCurrency - siteId must be provided to see this property
availability - Information related to the availability of the product variation. This expand is not included by default.
ats - siteId must be provided to see this property
inStock - siteId must be provided to see this property
online - siteId must be provided to see this property
searchable
variations - Information related to product variations is retrieved. This expand is included by default.
attributes - Information related to product variation attributes is retrieved. This expand is not included by default.
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 VariantSearchResult otherwise.
Search for products. The query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets.
The following is a list of searchable attributes with their corresponding buckets:
Main:
Attribute | Type |
---|---|
id | String |
name | String |
online | SiteSpecific Boolean |
searchable | SiteSpecific Boolean |
validFrom | SiteSpecfic DateTime |
validTo | SiteSpecfic DateTime |
type | ProductType |
creationDate | DateTime |
lastModified | DateTime |
Catalog:
Attribute | Type |
---|---|
catalogId | String |
Category:
Attribute | Type |
---|---|
categoryId | String |
Special:
type - {"item", "set, "bundle", "master", "partOfProductSet", "bundled", "variant", "variationGroup", "option", "retailSet", "partOfRetailSet"}
The sortable properties are:
Attribute | Type |
---|---|
id | String |
name | String |
creationDate | DateTime |
Note that catalogId is the ID of the catalog to which products are assigned
Only attributes in the same bucket can be joined using a disjunction (OR). For instance, when joining id and catalogId, only a conjunction is allowed (AND), whereas id and searchable can be joined using a disjunction because they are in the same bucket. If an attribute is used in a disjunction (OR) that violates this rule, an exception is thrown. The product search retrieves additional properties of the product when expansions are used.
The available expand attribute values are:
‘all' retrieves all product properties. This is the default when no expand value is included in the request.
'none' retrieves no expansion properties.
‘availability' retrieves the following properties:
ats
inStock
online
‘categories' retrieves the assignedCategories property.
‘images' retrieves the image property.
‘allImages' when used with images retrieves the following properties:
image
imageGroups
'prices' retrieves the following properties:
price
priceCurrency
‘sets' retrieves the following properties:
setProducts
productSets
‘bundles' retrieves the following properties:
productBundles
bundledProduct
If you would like to get a raw Response object use the other searchProducts function.
An object containing the options for this method.
A promise of type ProductSearchResult.
Search for products. The query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets.
The following is a list of searchable attributes with their corresponding buckets:
Main:
Attribute | Type |
---|---|
id | String |
name | String |
online | SiteSpecific Boolean |
searchable | SiteSpecific Boolean |
validFrom | SiteSpecfic DateTime |
validTo | SiteSpecfic DateTime |
type | ProductType |
creationDate | DateTime |
lastModified | DateTime |
Catalog:
Attribute | Type |
---|---|
catalogId | String |
Category:
Attribute | Type |
---|---|
categoryId | String |
Special:
type - {"item", "set, "bundle", "master", "partOfProductSet", "bundled", "variant", "variationGroup", "option", "retailSet", "partOfRetailSet"}
The sortable properties are:
Attribute | Type |
---|---|
id | String |
name | String |
creationDate | DateTime |
Note that catalogId is the ID of the catalog to which products are assigned
Only attributes in the same bucket can be joined using a disjunction (OR). For instance, when joining id and catalogId, only a conjunction is allowed (AND), whereas id and searchable can be joined using a disjunction because they are in the same bucket. If an attribute is used in a disjunction (OR) that violates this rule, an exception is thrown. The product search retrieves additional properties of the product when expansions are used.
The available expand attribute values are:
‘all' retrieves all product properties. This is the default when no expand value is included in the request.
'none' retrieves no expansion properties.
‘availability' retrieves the following properties:
ats
inStock
online
‘categories' retrieves the assignedCategories property.
‘images' retrieves the image property.
‘allImages' when used with images retrieves the following properties:
image
imageGroups
'prices' retrieves the following properties:
price
priceCurrency
‘sets' retrieves the following properties:
setProducts
productSets
‘bundles' retrieves the following properties:
productBundles
bundledProduct
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 ProductSearchResult otherwise.
Unassign a variation product from a product. The variation product is not deleted: it remains as a typical product after unassign.
If you would like to get a raw Response object use the other unassignVariationFromMasterProduct function.
An object containing the options for this method.
A promise of type void.
Unassign a variation product from a product. The variation product is not deleted: it remains as a typical product after unassign.
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.
Unassign a variation group product from a product. The variation group product is not deleted: it remains as a typical product after unassign.
If you would like to get a raw Response object use the other unassignVariationGroupFromMasterProduct function.
An object containing the options for this method.
A promise of type void.
Unassign a variation group product from a product. The variation group product is not deleted: it remains as a typical product after unassign.
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 a product using the information provided. Fields that can be updated: name, pageDescription, longDescription, pageTitle, pageKeywords, brand, ean, upc, manufactureSku, manufactureName, searchable, unit, searchable, onlineFlag, defaultVariantId. Custom attributes are used to extend a standard Product system object. This endpoint can be used to update custom attribute values for a particular product SKU. If you try to update a non-existent custom attribute, the request won't fail, but no changes are made and the attribute is not created.
If you would like to get a raw Response object use the other updateProduct function.
An object containing the options for this method.
A promise of type Product.
Update a product using the information provided. Fields that can be updated: name, pageDescription, longDescription, pageTitle, pageKeywords, brand, ean, upc, manufactureSku, manufactureName, searchable, unit, searchable, onlineFlag, defaultVariantId. Custom attributes are used to extend a standard Product system object. This endpoint can be used to update custom attribute values for a particular product SKU. If you try to update a non-existent custom attribute, the request won't fail, but no changes are made and the attribute is not created.
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 Product otherwise.
Update a local product option with the information provided.
If you would like to get a raw Response object use the other updateProductOption function.
An object containing the options for this method.
A promise of type ProductOption.
Update a local product option with 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 ProductOption otherwise.
Update a local product option value using the information provided.
If you would like to get a raw Response object use the other updateProductOptionValue function.
An object containing the options for this method.
A promise of type ProductOptionValue.
Update a local product option value 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 ProductOptionValue otherwise.
Update the variation attribute with the specified information. name slicing
If you would like to get a raw Response object use the other updateVariationAttribute function.
An object containing the options for this method.
A promise of type VariationAttribute.
Update the variation attribute with the specified information. name slicing
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 VariationAttribute otherwise.
Update the variation attribute value of a variation attribute of a product.
If you would like to get a raw Response object use the other updateVariationAttributeValue function.
An object containing the options for this method.
A promise of type VariationAttributeValue.
Update the variation attribute value of a variation attribute of a product.
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 VariationAttributeValue otherwise.
Update a variation for a product.
If you would like to get a raw Response object use the other updateVariationForMasterProduct function.
An object containing the options for this method.
A promise of type Variant.
Update a variation for a product.
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 Variant otherwise.
Update a variation group for a product master.
If you would like to get a raw Response object use the other updateVariationGroupForMasterProduct function.
An object containing the options for this method.
A promise of type VariationGroup.
Update a variation group for a product master.
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 VariationGroup otherwise.
Generated using TypeDoc
Products
*# API Overview
The Products API enables you to build merchandising apps that merchandisers use to add products to catalogs, configure products for your storefront, and manage products in their ecommerce channels.
For more information, see Products in the Salesforce B2C Commerce Infocenter.
Authentication & Authorization
The client managing product information must have access to the Products resource. 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
Add Products
Use the Products API to add new products to a catalog. You can add or update product details like attributes, variations, variation attributes, and images. You can also use the API to change a product’s catalog assignment.
If you are adding products from an external product information management (PIM) system, use the Mulesoft Accelerator component created for Commerce Cloud.
For more detail, see Variation Groups in the Salesforce B2C Commerce Infocenter.
Create & Validate Variation Groups
Use the API to enable a shopper to switch between different variants on a product page. You can group variation products into variation groups or group master products by one or more attributes. The variants within a variation group are linked. Linked variants allow a shopper to switch between different variants.
For more detail, see Variation Groups in the Salesforce B2C Commerce Infocenter.
Search for Variants
Use the Product API to enable merchants to use a set of filtering and sorting criteria to search for variants assigned to a master product, or variation group.
For more detail, see Product Variations in the Salesforce B2C Commerce Infocenter.
Manage Product Options
Use the API to view and manage product options for a given product so that optional accessories, upgrades, or services can be sold with the product. For example, a product warranty or monogramming.
For more detail, see Product Options in the Salesforce B2C Commerce Infocenter.
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 { Products, ClientConfig } from "commerce-sdk"; // or const { Products, 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 productsClient = new Products(clientConfig);
Last Updated: