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.

Unapplying Payment Using an API

This API reverses the payment applied to an invoice.

API

Signature

Apttus_Billing.BillingService.unapplyPaymentsToInvoices

static List unapplyPaymentsToInvoices(List unapplyPaymentRequests)

The API accepts payment term ID, invoice ID, and transaction amount as the required input parameters.

Request - UnappplyPaymentRequestInput

Field

Type

Required

Description

Payment Record ID

ID

Yes

Payment record ID associated with the invoice

Invoice Record ID

ID

Yes

Invoice record ID from which the payment is to be reversed

Transaction amount

Decimal

Yes

Exact applied amount to be reversed

Response

Note: If there are multiple records found within an invoice matching the invoice ID, payment ID, txn amount; the API unapplies the last A/R entry.

Field

Type

Description

CustomClass.UnapplyPaymentResponse

List

A result parameter is returned for each request parameter.

Sample Code - Request
Apttus_Billing.CustomClass.UnapplyPaymentRequest input1 = new Apttus_Billing.CustomClass.UnapplyPaymentRequest(
'a5V040000006VpM', //paymentIds
'a5T040000001WeY', //InvoiceIds
50                //transaction amount
);
List<Apttus_Billing.CustomClass.UnapplyPaymentRequest> unapplyRequest = new List<Apttus_Billing.CustomClass.UnapplyPaymentRequest>();
unapplyRequest.add(input1);
unapplyRequest.add(input2);
unapplyRequest.add(input3);
unapplyRequest.add(input4);
List<Apttus_Billing.CustomClass.UnapplyPaymentResponse> unapplyResp = new List<Apttus_Billing.CustomClass.UnapplyPaymentResponse>();
unapplyResp = Apttus_Billing.BillingService.unapplyPaymentsToInvoices(unapplyRequest);
System.debug('---Response---'+unapplyResp);
Sample Code - Response
---Response---(UnapplyPaymentResponse:[errorMessage=null, invoiceId=a5T040000001WeY, isSuccess=true, paymentId=a5V040000006VpM, txnAmount=50])