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.

download

Changing the Status of Billing Schedule by Calling an API

Once you invoice a billing schedule its status changes from Pending Billing to Pending Invoiced or Invoiced. The status change depends upon whether the invoice is created with a Draft or Approved status.

If the invoicing is done through the “Invoice Run” framework, this status change is understood by Conga Billing and is in sync with the batch job that updates the field “Remaining Billable Amount”. This batch job calculates the total fee amount from the billing schedules with a “Pending Billing” status. Hence if the status of a billing schedule changes from Pending Billing to Invoiced, the remaining billable amount is reduced equivalent to the fee amount of the schedule.

If the invoicing is done through different means like any other automated interface or manually, the status change is not communicated to the batch job and hence the RBA is not updated. For such instances, an API is required so that the status change of the billing schedules can be understood by Conga Billing.

The following table lists all the combinations of the actions and the status change that is supported by Conga Billing.

Action

Status Change

From

To

Auto Approved = True

Pending Billing

Invoiced

Auto Approved = False

Pending Billing

Pending Invoiced

Approve Invoice

Pending Invoiced

Invoiced

Cancel Invoice

Pending Invoiced

Pending Billing

Move to draft

Invoiced

Pending Invoiced

Cancel button

Invoiced

Pending Billing

(From Billing Plan)

Pending Milestone

Pending Billing

The following table lists all the combinations of the actions (ABO operations such as Change or Termination) and the status change that is NOT supported by Conga Billing.

Action

Status Change

From

To

Amendment

Pending Billing

Superseded

Termination

Pending Billing

Canceled

Amendment

Pending Invoiced

Superseded

Termination

Pending Invoiced

Canceled

Termination on mid-date of Invoice

Invoiced

Invoiced Canceled

Termination

Invoiced

Canceled

Warning:
  • For a wallet asset line item (WALI), when you run the API to update or change the status of a billing schedule from Invoiced to Pending Billing, then the API validates the billing schedule fee amount with respect to the wallet balance. If the validation passes, it executes the request otherwise displays a validation message if there is no sufficient available balance in the wallet.
  • If multiple billing schedule IDs belonging to the same WALI are passed then the validation is done by taking the sum of the fee amounts of all those billing schedules belonging to a single WALI.
  • If you pass multiple billing schedule IDs, the order of processing happens in the order of the IDs sent to the API.

The following table lists the parameters of the API and the results that are returned.

Parameters

Result

// Set Billing Schedule input parameters for Split Billing Schedule List<Apttus_Billing.BillingScheduleChangeStatusWrapper> BillingScheduleChangeStatusInputs = new List<Apttus_Billing.BillingScheduleChangeStatusWrapper>(); // Add the first input Id billingScheduleId1 = 'billing schedule ID'; // Replace this with the desired billing schedule Id String expectedStatus1 = 'Invoiced'; // Replace this with the desired status for the first input BillingScheduleChangeStatusInputs.add(new Apttus_Billing.BillingScheduleChangeStatusWrapper(billingScheduleId1, expectedStatus1)); // Add the second input Id billingScheduleId2 = 'billing schedule ID'; // Replace this with the desired billing schedule Id String expectedStatus2 = 'Invoiced'; // Replace this with the desired status for the second input BillingScheduleChangeStatusInputs.add(new Apttus_Billing.BillingScheduleChangeStatusWrapper(billingScheduleId2, expectedStatus2)); // Add more inputs as needed List<Apttus_Billing.BillingScheduleChangeStatusWrapper> actualChangeStatusResults = Apttus_Billing.BillingService.changeBillingScheduleStatus(BillingScheduleChangeStatusInputs); System.debug('actualChangeStatusResults========================' + actualChangeStatusResults);

If you pass the list of wrappers as a parameter, the API changes the status of the billing schedules to the next higher or to the previous status.

Example:

Suppose you have defined a recurring asset line with the following information:

Selling Frequency: Yearly

Billing Frequency: Monthly

List Price: USD 1,200.00

Remaining Billable Amount (RBA): USD 1,200.00

12 billing schedules are generated with a Fee Amount of USD 100.00 and the status as Pending Billing.

When you execute the API the status of the billing schedules and the RBA changes as:

ID

Current Status

String expected status

Response

RBA

BS1 ID

Pending Billing

Invoiced

Success

USD 1,100.00

BS1 ID

Invoiced

Pending Invoiced

Success

USD 1,200.00

Set<Id> billingScheduleIds = new Set<Id>{'billing schedule 1 ID', 'billing schedule 2 ID'}; // Replace this with the desired billing schedule Id String expectedStatus = 'Invoiced'; // Replace this with the desired status for all the inputs String result = Apttus_Billing.BillingService.changeBillingScheduleStatus(billingScheduleIds, expectedStatus); System.debug(result);

If you pass a set of IDs as a parameter, the API performs bulk processing and changes the status of the billing schedules to the next higher or to the previous status.

Example:

Suppose you have defined a recurring asset line with the following information:

Selling Frequency: Yearly

Billing Frequency: Monthly

List Price: USD 1,200.00

Remaining Billable Amount (RBA): USD 1,200.00

12 billing schedules are generated with a Fee Amount of USD 100.00 and the status as Pending Billing.

When you execute the API, you get the following response:

ID

Current Status

String expected status

Response

BS1 ID, BS2 ID, BS3 ID

Pending Billing

Invoiced

Success

BS1 ID, BS2 ID, BS3 ID

Pending Billing

Pending Billing

Error Message