Configure Price Quote (CPQ) CPQ for SOAP API Developers API Reference Asset Service Current: Getting a list of Products to be swapped with Assets PDF Download PDF Download page Getting a list of Products to be swapped with Assets. Current page All pages Getting a list of Products to be swapped with Assets The global method fetches a list of products that are to be swapped. Ensure that the Replacement Rule is active for Swapping Assets. APISignaturegetSwappedProductsstatic Apttus_Config2.CPQStruct.RecommendationResponseDO getSwappedProducts(Apttus_Config2.CPQStruct.RecommendationRequestDO request)ParametersNameTypeDescriptionrequestApttus_Config2.CPQStruct.RecommendationRequestDORequest object invoked by the methodRequest Data Object - Apttus_Config2.CPQStruct.RecommendationRequestDO()NameTypeDescriptionCartIdIdId of Cart for which Swap action is performedProductIdsList<ID>Id of the product with which the Asset is being swapped.Response Data Object - Apttus_Config2.CPQStruct.RecommendationResponseDOFieldTypeDescriptionProductIdsList<ID>Ids of products that can be swapped with assets.Code SampleThe code sample below helps you fetch the list of Product Ids that can be swapped with Assets. // create list of product ids List<ID> listProductId = new List<ID>(); for (ProductWrapperClass product : wrapperProductList) { if (product.selected) { listProductId.add(product.productId); } } // create and populate request object Apttus_Config2.CPQStruct.RecommendationRequestDO request = new Apttus_Config2.CPQStruct.RecommendationRequestDO(); request.cartId = cartId; request.ProductIds = listProductId; // call getSwappedProducts API Apttus_Config2.CPQStruct.RecommendationResponseDO response = Apttus_Config2.AssetService.getSwappedProducts(request); ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info,'getSwappedProducts: ' + response)); CODE ×