You can generate the invoice summary line by calling the following API. 

Set<Id> invoiceIds = new Set<Id>{'a2V3m000007Ly1A', 'a2V3m000007Ly1B', 'a2V3m000007Ly1C'};
Map<String, Object> result = Apttus_Billing.BillingService.generateInvoiceLinesSummary(

invoiceIds, // Set of Invoice Ids

'AssetLineItemId__r.Apttus_Config2__ChargeType__c' // Criteria Name

false); // Boolean flag - If yes then batch mode will be executed otherwise sync mode will run


System.debug('================'+result);
CODE