Un-apply Payment
unapplyPaymentsToInvoices API is used to reverse the payment applied to an invoice.
|
API |
Signature |
|---|---|
|
unapplyPaymentsToInvoices |
|
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 |
|
Yes |
Payment record ID associated with the invoice |
|
Invoice Record ID |
|
Yes |
Invoice record ID from which the payment is to be reversed |
|
Transaction amount |
|
Yes |
Exact applied amount to be reversed |
Response
|
Field |
Type |
Description |
|---|---|---|
|
CustomClass.UnapplyPaymentResponse |
|
A result parameter is returned for each request parameter. |
Apttus_Billing.CustomClass.UnapplyPaymentRequest input1 = new Apttus_Billing.CustomClass.UnapplyPaymentRequest(
'a5VDc000000AEWX', //paymentIds
'a5TDc00000161lP', //InvoiceIds
20 //transaction amount
);
Apttus_Billing.CustomClass.UnapplyPaymentRequest input2 = new Apttus_Billing.CustomClass.UnapplyPaymentRequest(
'a5VDc000000AEWX', //paymentIds
'a5TDc00000161lP', //InvoiceIds
10 //transaction amount
);
Apttus_Billing.CustomClass.UnapplyPaymentRequest input3 = new Apttus_Billing.CustomClass.UnapplyPaymentRequest(
'a5VDc000000AEWX', //paymentIds
'a5TDc00000161lLMAQ', //InvoiceIds
110 //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.InvoiceService.unapplyPaymentsToInvoices(unapplyRequest);
System.debug('---Response---'+unapplyResp);---Response---(UnapplyPaymentResponse:[errorMessage=null, invoiceId=a5TDc00000161lP, isSuccess=true, paymentId=a5VDc000000AEWX, txnAmount=50])
