You can use this API to set the incentives for a cart.

APISignature
setIncentivesForCartwebService static Apttus_CPQApi.CPQ.SetIncentivesForCartResponseDO setIncentivesForCart(Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO request)


Request Parameter
NameTypeDescription
requestApttus_CPQApi.CPQ.SetIncentivesForCartRequestDOThe Set Incentive request data object.


Request Data Object - Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO
NameTypeDescription
CartIdIdThe ID of the cart for which you want to set the incentives.
IncentiveCodesListThe list incentives code that you want to set for cart or line item.
LineItemIdIdThe ID of the line item for which you want to set the incentive.


Data Object - Apttus_CPQApi.CPQApi.CPQ.SetIncentivesForCartResponseDO
NameTypeDescription
IsSuccessBooleanIndicates whether the incentives were successfully set on the cart or line item.


Code Sample

The sample code below enables you to set incentives for a cart or a line item.


// set incentives for cart
Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO request = new Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO();
request.CartId = configSO.Id;
request.IncentiveCodes.add(incentiveSO.Apttus_Config2__IncentiveCode__c);

Apttus_CPQApi.CPQ.SetIncentivesForCartResponseDO result = Apttus_CPQApi.CPQWebService.setIncentivesForCart(request);

// set incentives for cart line item
Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO request4 = new Apttus_CPQApi.CPQ.SetIncentivesForCartRequestDO();
request4.LineItemId = lineItemSO.Id;
request4.IncentiveCodes.add(incentiveSO.Apttus_Config2__IncentiveCode__c);

Apttus_CPQApi.CPQ.SetIncentivesForCartResponseDO result4 = Apttus_CPQApi.CPQWebService.setIncentivesForCart(request4);

CODE