Question or Problem Statement:
I would like to ask how can I use the Zuora API to create a partial refund on a payment made for multiple invoices. The Zuora Knowledge Center indicates that the ‘Amount’ field on the ‘Refund’ object cannot handle partial refunds on multiple invoices. However, RefundInvoicePaymentData supports it and its value must be RefundInvoicePayment which is the result of a successful refund process. Does this mean that I have to create a refund first, and if yes, which field should I put the refund amount if the ‘Amount’ field cannot support partial refunds?
We do support create a partial Refund on a Payment made for multiple Invoices via SOAP API. Please find the sample code below:
<ns1:create xmlns:ns1="http://api.zuora.com/"> <ns1:zObjects xmlns:ns2="http://object.api.zuora.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Refund"> <ns2:AccountId>4028924549bdb5e00149bdbc19770011</ns2:AccountId> <ns2:Amount>4</ns2:Amount> <ns2:PaymentId>4028924549bdb5e00149bdbf164d004d</ns2:PaymentId> <ns2:Type>Electronic</ns2:Type> <ns2:RefundInvoicePaymentData> <ns1:RefundInvoicePayment xsi:type="ns2:RefundInvoicePayment"> <ns2:RefundAmount>2</ns2:RefundAmount> <ns2:InvoiceId>4028924549bdb5e00149bdbed3da0038</ns2:InvoiceId> </ns1:RefundInvoicePayment> <ns1:RefundInvoicePayment xsi:type="ns2:RefundInvoicePayment"> <ns2:RefundAmount>2</ns2:RefundAmount> <ns2:InvoiceId>402881e849b885fe0149b892f90c007f</ns2:InvoiceId> </ns1:RefundInvoicePayment> </ns2:RefundInvoicePaymentData> </ns1:zObjects> </ns1:create>
InvoiceID is included in RefundInvoicePayment wrapper. If you would like to apply the refund to a specific Invoice, just specify the Invoice Id.
This feature is only supported with WSDL Version 64+.