Request Data Object - Apttus_CPQApi.CPQ.CreateCouponsForIncentiveRequestDO
Name
Type
Description
IncentiveIds
List
The IDs of the incentives for which you want to generate coupons.
NumCoupons
List
The number of coupons you want to generate.
For example, if you enter 10000, CPQ will generate 10000 coupons for the specified incentive.
Reponse Parameter Data Object - Apttus_CPQApi.CPQ.CreateCouponsForIncentiveResponseDO
Name
Type
Description
Coupons
List
The list of generated coupon codes.
IsAsync
Boolean
Indicates whether coupons were created in aysnc mode or not.
If there are <10k coupons, CPQ returns Async as False.
If there are >10k coupons, CPQ returns Async as True.
If there are multiple incentives, CPQ returns Async as True.
JobId
Id
The ID of the job created to generate coupons.
Code Sample
The sample code below demonstrates the coupons created in sync mode and async mode.
//Sync Test
Apttus_CPQApi.CPQ.CreateCouponsForIncentiveRequestDO request = new Apttus_CPQApi.CPQ.CreateCouponsForIncentiveRequestDO();
request.IncentiveIds.add(incentiveSO.Id);
// add corresponding number of coupons parameter
request.NumCoupons.add(5);
Apttus_CPQApi.CPQ.CreateCouponsForIncentiveResponseDO result = Apttus_CPQApi.CPQWebService.createCouponsForIncentives(request);
//Async Test
Apttus_CPQApi.CPQ.CreateCouponsForIncentiveRequestDO request2 = new Apttus_CPQApi.CPQ.CreateCouponsForIncentiveRequestDO();
request2.IncentiveIds.add(incentiveSO.Id);
request2.IncentiveIds.add(incentiveSO2.Id);
// add corresponding number of coupons parameter
request2.NumCoupons.add(5);
request2.NumCoupons.add(5);
Apttus_CPQApi.CPQ.CreateCouponsForIncentiveResponseDO result2 = Apttus_CPQApi.CPQWebService.createCouponsForIncentives(request2);