createInvoiceDocuments API creates invoice documents for a given list of Invoice. It accepts a list of invoice IDs as input and produces invoice documents for each corresponding invoice ID. It also accepts Invoice Template Name as a parameter if you want to create Invoice Documents using a specific template.

You can generate invoice documents in the following formats:

  • PDF
  • DOCX
  • DOC
  • RTF

The document is generated in the format set at the Billing Preference in Invoice Output Format field. 

If you call this API from a batch or a scheduled job, it can process only one Invoice ID. Otherwise, if you call this API from a non-batch or a non-scheduled job, it can process up to 10 Invoices. 

There are two ways of creating Invoice Documents:

  • Using the default invoice template
  • Using a specific invoice template
APISignature
createInvoiceDocumentsstatic void createInvoiceDocuments(List invoiceIds)

This API uses the defualt Invoice Template specified on the Account or Account Location. 

Request

Field

Type

Required?

Description

invoiceIds

List <Id>

Yes

List of Invoice Ids

List<ID> invoiceIDs = new List<ID>();
//invoiceIDs.add('a4t1I000000H5hM');
Apttus_Billing.BillingService.createInvoiceDocuments(invoiceIDs);
Apttus_Billing.BillingService.createInvoiceDocuments(invoiceIDs);  
CODE


APISignature
createInvoiceDocumentsstatic void createInvoiceDocuments(List invoiceIds, String invoiceTemplateName)


This API is used to create invoice documents using a specific invoice template.

If you do not specify a valid template name or pass null as a value, Billing Management System uses the default template specified on the Account or Account Location.

Request

Field

Type

Required?

Description

invoiceIds

List <Id>

Yes

List of Invoice Ids

invoiceTemplateNameStringYesInvoice Template Name




List<ID> invoiceIDs = new List<ID>();
//invoiceIDs.add('a4t1I000000H5hM');      
//String invoiceTemplateName = 'myTestTemplate';
Apttus_Billing.BillingService.createInvoiceDocuments(invoiceIDs, invoiceTemplateName);
CODE