Newer Version Available

This content describes an older version of this product. View Latest

CommerceCatalog Class

Get products, product categories, and product category paths.

Namespace

ConnectApi

CommerceCatalog Methods

These methods are for CommerceCatalog. All methods are static.

getProduct(webstoreId, productId, effectiveAccountId, fields, excludeFields, mediaGroups, excludeMedia, excludeEntitlementDetails, excludePrimaryProductCategory)

Get a product.

API Version

49.0

Available to Guest Users

51.0

Requires Chatter

No

Signature

public static ConnectApi.ProductDetail getProduct(String webstoreId, String productId, String effectiveAccountId, List<String> fields, Boolean excludeFields, List<String> mediaGroups, Boolean excludeMedia, Boolean excludeEntitlementDetails, Boolean excludePrimaryProductCategory)

Parameters

webstoreId
Type: String
ID of the webstore.
productId
Type: String
ID of the product.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If null, the default value is determined from context.
fields
Type: List<String>
Comma-separated list of field names.

If this list is empty or unspecified, all fields are returned. There is no limit to the number of fields you can specify. The number of fields and number of characters in the field name may affect the URL size limit. If excludeFields and fields are specified, the excludeFields parameter takes precedence.

excludeFields
Type: Boolean
Specifies whether the fields are returned (false) or not (true). If unspecified, defaults to false.
mediaGroups
Type: List<String>
Comma-separated list of developer names of media group records.

If this list is empty or unspecified, all media groups are returned. If excludeMedia and mediaGroups are specified, the excludeMedia parameter takes precedence.

excludeMedia
Type: Boolean
Specifies whether the media groups and default images of the product are returned (false) or not (true). If unspecified, defaults to false.
excludeEntitlementDetails
Type: Boolean
Specifies whether the entitlement details of the product are returned (false) or not (true). If unspecified, defaults to false.
excludePrimaryProductCategory
Type: Boolean
Specifies whether the primary category path of the product is returned (false) or not (true). If unspecified, defaults to false.

Return Value

Type: ConnectApi.ProductDetail

Usage

This method respects buyer View Product entitlements and only users entitled to view product data can access it.

getProduct(webstoreId, productId, effectiveAccountId, fields, excludeFields, mediaGroups, excludeMedia, excludeEntitlementDetails, excludePrimaryProductCategory, excludeVariationInfo, excludeAttributeSetInfo)

Get a product with variation and attribute information.

API Version

50.0

Available to Guest Users

51.0

Requires Chatter

No

Signature

public static ConnectApi.ProductDetail getProduct(String webstoreId, String productId, String effectiveAccountId, List<String> fields, Boolean excludeFields, List<String> mediaGroups, Boolean excludeMedia, Boolean excludeEntitlementDetails, Boolean excludePrimaryProductCategory, Boolean excludeVariationInfo, Boolean excludeAttributeSetInfo)

Parameters

webstoreId
Type: String
ID of the webstore.
productId
Type: String
ID of the product.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If null, the default value is determined from context.
fields
Type: List<String>
Comma-separated list of field names.

If this list is empty or unspecified, all fields are returned. There is no limit to the number of fields you can specify. The number of fields and number of characters in the field name may affect the URL size limit. If excludeFields and fields are specified, the excludeFields parameter takes precedence.

excludeFields
Type: Boolean
Specifies whether the fields are returned (false) or not (true). If unspecified, defaults to false.
mediaGroups
Type: List<String>
Comma-separated list of developer names of media group records.

If this list is empty or unspecified, all media groups are returned. If excludeMedia and mediaGroups are specified, the excludeMedia parameter takes precedence.

excludeMedia
Type: Boolean
Specifies whether the media groups and default images of the product are returned (false) or not (true). If unspecified, defaults to false.
excludeEntitlementDetails
Type: Boolean
Specifies whether the entitlement details of the product are returned (false) or not (true). If unspecified, defaults to false.
excludePrimaryProductCategory
Type: Boolean
Specifies whether the primary category path of the product is returned (false) or not (true). If unspecified, defaults to false.
excludeVariationInfo
Type: Boolean
Specifies whether the variation information for the product is returned (false) or not (true). If unspecified, defaults to false.
excludeAttributeSetInfo
Type: Boolean
Specifies whether the attribute set information for the product is returned (false) or not (true). If unspecified, defaults to false.

Return Value

Type: ConnectApi.ProductDetail

Usage

This method respects buyer View Product entitlements and only users entitled to view product data can access it.

getProduct(webstoreId, productId, effectiveAccountId, fields, excludeFields, mediaGroups, excludeMedia, excludeEntitlementDetails, excludePrimaryProductCategory, excludeVariationInfo, excludeAttributeSetInfo, excludeQuantityRule)

Get a product with quantity rule information.

API Version

52.0

Available to Guest Users

52.0

Requires Chatter

No

Signature

public static ConnectApi.ProductDetail getProduct(String webstoreId, String productId, String effectiveAccountId, List<String> fields, Boolean excludeFields, List<String> mediaGroups, Boolean excludeMedia, Boolean excludeEntitlementDetails, Boolean excludePrimaryProductCategory, Boolean excludeVariationInfo, Boolean excludeAttributeSetInfo, Boolean excludeQuantityRule)

Parameters

webstoreId
Type: String
ID of the webstore.
productId
Type: String
ID of the product.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If null, the default value is determined from context.
fields
Type: List<String>
Comma-separated list of field names.

If this list is empty or unspecified, all fields are returned. There is no limit to the number of fields you can specify. The number of fields and number of characters in the field name may affect the URL size limit. If excludeFields and fields are specified, the excludeFields parameter takes precedence.

excludeFields
Type: Boolean
Specifies whether the fields are returned (false) or not (true). If unspecified, defaults to false.
mediaGroups
Type: List<String>
Comma-separated list of developer names of media group records.

If this list is empty or unspecified, all media groups are returned. If excludeMedia and mediaGroups are specified, the excludeMedia parameter takes precedence.

excludeMedia
Type: Boolean
Specifies whether the media groups and default images of the product are returned (false) or not (true). If unspecified, defaults to false.
excludeEntitlementDetails
Type: Boolean
Specifies whether the entitlement details of the product are returned (false) or not (true). If unspecified, defaults to false.
excludePrimaryProductCategory
Type: Boolean
Specifies whether the primary category path of the product is returned (false) or not (true). If unspecified, defaults to false.
excludeVariationInfo
Type: Boolean
Specifies whether the variation information for the product is returned (false) or not (true). If unspecified, defaults to false.
excludeAttributeSetInfo
Type: Boolean
Specifies whether the attribute set information for the product is returned (false) or not (true). If unspecified, defaults to false.
excludeQuantityRule
Type: Boolean
Specifies whether the quantity rule information for the product is returned (false) or not (true). If unspecified, defaults to false.

Return Value

Type: ConnectApi.ProductDetail

Usage

This method respects buyer View Product entitlements and only users entitled to view product data can access it.

getProductCategory(webstoreId, productCategoryId, effectiveAccountId, fields, excludeFields, mediaGroups, excludeMedia)

Get a product category.

API Version

49.0

Available to Guest Users

51.0

Requires Chatter

No

Signature

public static ConnectApi.ProductCategoryDetail getProductCategory(String webstoreId, String productCategoryId, String effectiveAccountId, List<String> fields, Boolean excludeFields, List<String> mediaGroups, Boolean excludeMedia)

Parameters

webstoreId
Type: String
ID of the webstore.
productCategoryId
Type: String
ID of the product category.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If null, the default value is determined from context.
fields
Type: List<String>
Comma-separated list of field names.

If this list is empty or unspecified, all fields are returned. There is no limit to the number of fields you can specify. The number of fields and number of characters in the field name may affect the URL size limit. If excludeFields and fields are specified, the excludeFields parameter takes precedence.

excludeFields
Type: Boolean
Specifies whether the fields are returned (false) or not (true). If unspecified, defaults to false.
mediaGroups
Type: List<String>
Comma-separated list of developer names of media group records.

If this list is empty or unspecified, all media groups are returned. If excludeMedia and mediaGroups are specified, the excludeMedia parameter takes precedence.

excludeMedia
Type: Boolean
Specifies whether the media groups and default images of the product are returned (false) or not (true). If unspecified, defaults to false.

getProductCategoryChildren(webstoreId, effectiveAccountId, parentProductCategoryId, fields, excludeFields, mediaGroups, excludeMedia)

Get product categories.

API Version

52.0

Available to Guest Users

52.0

Requires Chatter

No

Signature

public static ConnectApi.ProductCategoryDetailCollection getProductCategoryChildren(String webstoreId, String effectiveAccountId, String parentProductCategoryId, List<String> fields, Boolean excludeFields, List<String> mediaGroups, Boolean excludeMedia)

Parameters

webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If null, the default value is determined from context.
parentProductCategoryId
Type: String
ID of the product category for which you want to get all the children product categories. If null, returns all the top-level product categories for the store.
fields
Type: List<String>
Comma-separated list of field names.

If this list is empty or unspecified, all fields are returned. There is no limit to the number of fields you can specify. The number of fields and number of characters in the field name may affect the URL size limit. If excludeFields and fields are specified, the excludeFields parameter takes precedence.

excludeFields
Type: Boolean
Specifies whether the fields are returned (false) or not (true). If unspecified, defaults to false.
mediaGroups
Type: List<String>
Comma-separated list of developer names of media group records.

If this list is empty or unspecified, all media groups are returned. If excludeMedia and mediaGroups are specified, the excludeMedia parameter takes precedence.

excludeMedia
Type: Boolean
Specifies whether the media groups and default images of the product are returned (false) or not (true). If unspecified, defaults to false.

getProductCategoryPath(webstoreId, productCategoryId)

Get the product category path from the root category to the current category.

API Version

49.0

Available to Guest Users

51.0

Requires Chatter

No

Signature

public static ConnectApi.ProductCategoryPath getProductCategoryPath(String webstoreId, String productCategoryId)

Parameters

webstoreId
Type: String
ID of the webstore.
productCategoryId
Type: String
ID of the product category.

Return Value

Type: ConnectApi.ProductCategoryPath

Usage

This method respects buyer View Product entitlements and only users entitled to view product data can access it.

getProducts(webstoreId, effectiveAccountId, ids, skus, fields, excludeMedia, excludePrices)

Get fields, prices, and default images for a list of products.

API Version

54.0

Available to Guest Users

54.0

Requires Chatter

No

Signature

public static ConnectApi.ProductOverviewCollection getProducts(String webstoreId, String effectiveAccountId, List<String> ids, List<String> skus, List<String> fields, Boolean excludeMedia, Boolean excludePrices)

Parameters

webstoreId
Type: String
ID of the webstore.
effectiveAccountId
Type: String
ID of the buyer account or guest buyer profile for which the request is made. If unspecified, the default value is determined from context.
ids
Type: List<>
List of product IDs. Specify either a list of up to 20 product IDs or SKUs, but not both.
skus
Type: List<>
List of SKUs. Specify either a list of up to 20 SKUs or product IDs, but not both.
fields
Type: List<>
Comma-separated list of field names to return for each product. If the list is empty or not specified, all fields are returned. You can specify any number of fields.
excludeMedia
Type: Boolean
Specifies whether default images are returned for the products (false) or not (true). The default is false.
excludePrices
Type: Boolean
Specifies whether prices are returned for the products (false) or not (true). The default is false.