You can invoke this API to terminate or cancel assets.

APISignature
cancelAssetsWebService static Apttus_CPQApi.CPQAsset.CancelAssetsResponseDO cancelAssets(Apttus_CPQApi.CPQAsset.CancelAssetsRequestDO request)
Parameters

Name

Type

Description

request

Apttus_CPQApi.CPQAsset.CancelAssetsRequestDO

Request object passed by the invoker method.

Request Data Object - Apttus_CPQApi.CPQAsset.CancelAssetsRequestDO

Name

Type

Description

CancelDateDateThe termination date of an asset.
AssetIdsList<ID>List of asset IDs to be terminated.
CartIdIDID of the cart for which an asset is being terminated.
Response Data Object - Apttus_CPQApi.CPQAsset.CancelAssetsResponseDO

Field

Type

Description

LineItemMapList<LineItemEntryDO>Line items that are terminated.
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 terminate assets.

Public Apttus_CPQApi.CPQAsset.CancelAssetsResponseDO cancelAssets() 
{
	// create and populate request object 
	Apttus_CPQApi.CPQAsset.CancelAssetsRequestDO request = new                Apttus_CPQApi.CPQAsset.CancelAssetsRequestDO(); 

	request.CartId = 'a1I6C000000ju66';
	// list of primary asset ids 
	request.AssetIds = new List<ID> {'a0e6C000001tWxA', 'a0e6C000001wVWB'};
	request.CancelDate = Date.newInstance(YYYY, MM, DD);

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