Request Data Object - Apttus_CPQApi.CPQAsset.SwapAssetsRequestDO
Name
Type
Description
NewStartDate
Date
The new Asset Start Date on Swapping
ProductIds
List<ID>
Id of the product with which an Asset is being swapped
AssetIds
List<ID>
ID of an asset that is swapped.
CartId
ID
ID of the cart for which an asset is being swapped.
Response Data Object - Apttus_CPQApi.CPQAsset.SwapAssetsResponseDO
Field
Type
Description
LineItemMap
List<LineItemEntryDO>
Line items that are cancelled and swapped.
Errors
List<String>
List of error messages if any error occurred.
LineItemEntryDO
Name
Type
Description
LineItemId
ID
Lineitem ID
LineItemSO
Apttus_Config2__LineItem__c
LineItem 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;
}