Newer Version Available
IssueVoucherInput Class
Use this class to issue a voucher to a loyalty program member.
This class receives the input parameter values for the Issue Voucher action.
Namespace
Example
1public void issueVoucherTest(){
2 //...Create a list with LoyaltyManagement.IssueVoucherInput as a datatype
3 List<LoyaltyManagement.IssueVoucherInput> issueVoucherList = new List<LoyaltyManagement.IssueVoucherInput>();
4
5 //...Create an instance of the list object and set the input values
6 issueVoucherList.add(new LoyaltyManagement.IssueVoucherInputBuilder().setLoyaltyProgramMemberId('0lMRM0000002BD12AM')
7 .setProgramName('LP01')
8 .setVoucherDefinitionName('V1')
9 .setVoucherCode('demoCode')
10 .setJournalId('0lVRM0000004DH22AM')
11 .build());
12
13 //...Pass the list that contains the input values to the LoyaltyResources.issueVoucher() function.
14 //...Store the output returned by the function in the IssueVoucherOutput object
15 List<LoyaltyManagement.IssueVoucherOutput> issueVoucherActionResults = LoyaltyManagement.LoyaltyResources.issueVoucher(issueVoucherList);
16 System.debug('Issue Voucher Successful Operation:'+ issueVoucherActionResults.get(0));
17}