Unapplying Payment Using an API
This API reverses the payment applied to an invoice.
API |
Signature |
---|---|
Apttus_Billing.BillingService.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(
'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);
---Response---(UnapplyPaymentResponse:[errorMessage=null, invoiceId=a5T040000001WeY, isSuccess=true, paymentId=a5V040000006VpM, txnAmount=50])