You can invoke this API to swap assets.

APISignature
swapAssetswebService static Apttus_CPQApi.CPQAsset.SwapAssetsResponseDO swapAssets(Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO request)
Parameters

Name

Type

Description

request

Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO

Request object passed by the invoker method.

Request Data Object - Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO

Name

Type

Description

NewStartDateDateThe new Asset Start Date on Swapping
ProductIdsList<ID>Id of the product with which an Asset is being swapped
AssetIdsList<ID>ID of an asset that is swapped.
CartIdIDID of the cart for which an asset is being swapped.
Response Data Object - Apttus_CPQApi.CPQAsset.SwapAssetsResponseDO

Field

Type

Description

LineItemMapList<LineItemEntryDO>Line items that are cancelled and swapped.
ErrorsList<String>List of error messages if any error occurred.
LineItemEntryDO

Name

Type

Description

LineItemIdIDLineitem ID
LineItemSOApttus_Config2__LineItem__cLineItem SObject


Code Sample

The following code sample helps you swap assets.

Public Apttus_CPQApi.CPQAsset.SwapAssetsResponseDO swapAssets() 
{
	// create and populate request object 
	Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO request = new Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO(); 
	request.CartId = 'sa1I6C000000k6lmUAA';
	request.NewStartDate = Date.newInstance(YYYY, MM, DD);
	request.ProductIds  = new List<ID>{'01t3C000002oEVL'};
	// only one asset can be swapped per API call
	request.AssetIds = new List<ID> {'a0e6C000001uATS'};

	// call swapAssets API 
	Apttus_CPQApi.CPQAsset.SwapAssetsResponseDO response = Apttus_CPQApi.CPQAssetWebService.swapAssets(request); 
	return response;
}
CODE