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 Credit Memos

The approveCreditMemos API is used to approve multiple credit memos at once by accepting a list of credit memos.

When you call the API, it:
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 Credit Memos.
  • Validates each credit memo in the list.
  • If eligible (status is Draft or Pending Approved), it updates the status of the credit memo to Approved.
  • All credit memo line items under that memo are also marked as Approved.
  • If a credit memo line item has an associated billing schedule, the status of the billing schedule is changed to Invoiced.
  • The Remaining Billable Amount on the related asset line item is recalculated.
APISignature
approveCreditMemosstatic List approveCreditMemos(List creditMemoApprovalList)

Request Parameter

FieldTypeRequiredDescription
CustomClass.CreditMemoActionRequestListYesThe list of credit memos you want to approve.

Response

FieldTypeDescription
CustomClass.CreditMemoActionResultListA result parameter is returned for each request parameter.
Code Sample Request- for single input parameter
Note: By default Tax Calculation is set to True and Auto Apply Credit Memo to Invoice and Generate Document are set to false.
Apttus_Billing.CustomClass.CreditMemoActionRequest cr_1 = 
    new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9P');// Credit memo ID
 
Apttus_Billing.CustomClass.CreditMemoActionRequest cr_2 = 
    new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9Q');
Apttus_Billing.CustomClass.CreditMemoActionRequest cr_3 = 
    new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9R');
 
List<Apttus_Billing.CustomClass.CreditMemoActionRequest> crList = new List<Apttus_Billing.CustomClass.CreditMemoActionRequest>();
crList.add(cr_1);
crList.add(cr_2);
crList.add(cr_3);
 
List<Apttus_Billing.CustomClass.CreditMemoActionResult> approveCreditMemos = 
    Apttus_Billing.CreditMemoService.approveCreditMemos(crList);
System.debug('-approveCreditMemos-'+approveCreditMemos);

Code Sample Response - for single input parameters

approveCreditMemos-(CreditMemoActionResult:[creditMemoId=a5JDc000000lq9PMAQ, isSuccess=true, message=CreditMemo has been Approved.], CreditMemoActionResult:[creditMemoId=a5JDc000000lq9QMAQ, isSuccess=true, message=CreditMemo has been Approved.], CreditMemoActionResult:[creditMemoId=a5JDc000000lq9RMAQ, isSuccess=true, message=CreditMemo has been Approved.])
API Signature
approveCreditMemosstatic List approveCreditMemos(List creditMemoApprovalList)

Request Parameters

FieldTypeRequiredDescription
CustomClass.CreditMemoActionRequestListYesThe list of credit memos you want to approve.
taxCalculationBooleanNoThis flag specifies whether to recalculate tax and update the tax breakdown.
autoApplyCreditMemoToInvoiceBooleanNoThis flag specifies whether the credit memo is automatically applied to the related invoice after approval.
generateDocumentBooleanNoThis flag specifies whether a credit memo document should be generated.

Response

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

Code Sample Request - for multiple input parameters

Note: User can choose to enter the parameters such as Tax Calculation, Auto Apply Credit Memo to Invoice, and Generate Document.
Apttus_Billing.CustomClass.CreditMemoActionRequest cr_1 = 
   new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9S', true, false, true);
Apttus_Billing.CustomClass.CreditMemoActionRequest cr_2 = 
   new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9T', true, false, true);
List<Apttus_Billing.CustomClass.CreditMemoActionRequest> crList = new List<Apttus_Billing.CustomClass.CreditMemoActionRequest>();
crList.add(cr_1);
crList.add(cr_2);
List<Apttus_Billing.CustomClass.CreditMemoActionResult> approveCreditMemos = 
    Apttus_Billing.CreditMemoService.approveCreditMemos(crList);
System.debug('-approveCreditMemos-'+approveCreditMemos);"Apttus_Billing.CustomClass.CreditMemoActionRequest cr_1 = 
   new Apttus_Billing.CustomClass.CreditMemoActionRequest('a5JDc000000lq9L', true, false, true);

List<Apttus_Billing.CustomClass.CreditMemoActionRequest> crList = new List<Apttus_Billing.CustomClass.CreditMemoActionRequest>();
crList.add(cr_1);

List<Apttus_Billing.CustomClass.CreditMemoActionResult> approveCreditMemos = 
    Apttus_Billing.CreditMemoService.approveCreditMemos(crList);
System.debug('-approveCreditMemos-'+approveCreditMemos);

Apttus_Billing.CreditMemoService.updateCreditMemoTaxCalculationsAndBreakups(new Set<Id>{'a5JDc000000lq9L'}, true);

Code Sample Response - for multiple input parameters

approveCreditMemos-(CreditMemoActionResult:[creditMemoId=a5JDc000000lq9SMAQ, isSuccess=true, message=CreditMemo has been Approved.], CreditMemoActionResult:[creditMemoId=a5JDc000000lq9TMAQ, isSuccess=true, message=CreditMemo has been Approved.])