Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Approve Invoices

The approveInvoices API is used to approve multiple invoices at once by accepting a set of Invoice IDs. This is especially useful for bulk operations, such as approving all invoices after an invoice run.

APISignature
approveInvoicesstatic List approveInvoices(Set invoiceIds)
When you call the API and input a set of invoice IDs, the API:
Note: If the tax callback class is registered, then the user must call the tax calculation API separately. For more information, see Updating Tax Calculation and Breakups on Invoice.
  • Validates each invoice in the set.
  • Approves invoices that are eligible (e.g., in Draft or Pending Approved status).
  • The status of the associated billing schedules is changed to Invoiced.
  • The Remaining Billable Amount field is reduced by the fee amount of the schedule that was just invoiced.
  • The usage quantity and the corresponding fee amount are locked for that billing period.
  • Return a list of results, one for each invoice, indicating success or failure for each approval attempt.

Request Parameters

FieldTypeRequiredDescription
invoiceIdsSetYesA set of Invoice record IDs you want to approve.

Response

FieldTypeDescription
CustomClass.InvoiceActionResultListA result parameter is returned for each request parameter.

Code Sample - Request

Set<Id> invoiceIds = new Set<Id>{'a5TDc00000161lM','a5TDc00000161lN', 'a5TDc00000161lO', 'a5TDc00000161lP', 'a5TDc00000161lQ', 'a5TDc00000161lR', 'a5TDc00000161lG'};
List<Apttus_Billing.CustomClass.InvoiceActionResult> approveInvoices = 
Apttus_Billing.InvoiceService.approveInvoices(invoiceIds);
System.debug('-approveInvoices-'+approveInvoices);

Code Sample - Response

approveInvoices-(InvoiceActionResult:[invoiceId=a5TDc00000161mlMAA, isSuccess=true, message=Invoice has been Approved.], InvoiceActionResult:[invoiceId=a5TDc00000161mmMAA, isSuccess=true, message=Invoice has been Approved.])