Split by Date
// Set Billing Schedule input parameters for Split Billing Schedule
List<Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper> SplitLineWrapperInputs1 = new List<Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper>();
List<Apttus_Billing.BillingScheduleSplitWrapper> SplitWrapperInputs = new List<Apttus_Billing.BillingScheduleSplitWrapper>();
Id billingScheduleId1 = 'Billing Schedule ID';
Id assetId1 = 'Asset ID';
SplitLineWrapperInputs1.add(new Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper(Date.newInstance(2023, 1, 2), 3.0)); //Date formate (YYYY,MM,DD), Amount 4.0 OR Percentage 33.333 OR null(when its SPLIT_BY_DATE)
SplitLineWrapperInputs1.add(new Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper(Date.newInstance(2023, 1, 15), 4.0)); //Date formate (YYYY,MM,DD), Amount 4.0 OR Percentage 33.333 OR null(when its SPLIT_BY_DATE)
SplitWrapperInputs.add(new Apttus_Billing.BillingScheduleSplitWrapper(
billingScheduleId1, //Billing Schedule ID
assetId1, //Asset ID
Apttus_Billing.BillingScheduleSplitWrapper.SplitMethod.SPLIT_BY_AMOUNT, //SPLIT_BY_AMOUNT,SPLIT_BY_PERCENTAGE,SPLIT_BY_DATE
2, //Number of Split
SplitLineWrapperInputs1 //inputs for SplitLineItems
));
List<Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper> SplitLineWrapperInputs2 = new List<Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper>();
Id billingScheduleId2 = 'Billing Schedule ID';
Id assetId2 = 'Asset ID';
SplitLineWrapperInputs2.add(new Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper(Date.newInstance(2023, 2, 2), 5.0)); //Date formate (YYYY,MM,DD), Amount 4.0 OR Percentage 33.333 OR null(when its SPLIT_BY_DATE)
SplitLineWrapperInputs2.add(new Apttus_Billing.BillingScheduleSplitWrapper.BillingScheduleSplitLineWrapper(Date.newInstance(2023, 2, 15), 6.0)); //Date formate (YYYY,MM,DD), Amount 4.0 OR Percentage 33.333 OR null(when its SPLIT_BY_DATE)
SplitWrapperInputs.add(new Apttus_Billing.BillingScheduleSplitWrapper(
billingScheduleId2, //Billing Schedule ID
assetId2, //Asset ID
Apttus_Billing.BillingScheduleSplitWrapper.SplitMethod.SPLIT_BY_AMOUNT, //SPLIT_BY_AMOUNT,SPLIT_BY_PERCENTAGE,SPLIT_BY_DATE
2, //Number of Split
SplitLineWrapperInputs2 //inputs for SplitLineItems
));
List<Apttus_Billing.BillingScheduleSplitWrapper> actualSplitResults = Apttus_Billing.BillingService.createSplitBilling(SplitWrapperInputs);
System.debug('actualSplitResults========================' + actualSplitResults);
CODE