You can invoke this API to fetch a list of products to be swapped with assets. Relevant replacement rules should be active for getting the list of products that can be swapped with assets.

APISignature
getSwappedProductsWebService static Apttus_CPQApi.CPQAsset.RecommendationResponseDO getSwappedProducts(Apttus_CPQApi.CPQAsset.RecommendationRequestDO request)
Parameters

Name

Type

Description

requestApttus_CPQApi.CPQAsset.RecommendationRequestDORequest object passed by the invoker method.
Request Data Object - Apttus_CPQApi.CPQAsset.RecommendationRequestDO

Name

Type

Description

ProductIdsList<ID>List of product IDs with which an asset is being swapped.
CartIdIDID of the cart for which the swap action is performed.
Response Data Object - Apttus_CPQApi.CPQAsset.RecommendationResponseDO

Field

Type

Description

ProductIdsList<ID>List of product IDs that can be swapped with assets.
ErrorsList<String>List of error messages if any error occurred.


Code Sample

The following code sample helps you fetch the list of product IDs that can be swapped with assets.

Public Apttus_CPQApi.CPQAsset.RecommendationResponseDO getSwappedProducts() 
{
	// create and populate request object 
	Apttus_CPQApi.CPQAsset.RecommendationRequestDO request = new Apttus_CPQApi.CPQAsset.RecommendationRequestDO(); 
	request.ProductIds = new List<ID> {'01t3C000000l8qi', '01t2f000000dV1d'};
	request.CartId = 'a1I6C000000k6lmUAA';
	// call getSwappedProducts API 
	Apttus_CPQApi.CPQAsset.RecommendationResponseDO response = Apttus_CPQApi.CPQAssetWebService.getSwappedProducts(request); 
	return response;
}
CODE