Happy Business Starts Here

Tutor

Determine where which payment Refund is associated with

With the recent changes of removing PaymentId from Refund, how do we, using the Refund object, determine which payment the refund is attached to? Also, is there a way, using the Refund object, to determine if a refund is from a credit balance? Also, is there an updated documentation for the API to reference with these recent changes?

1 REPLY 1
Highlighted
Master

Re: Determine where which payment Refund is associated with

Hi @prayos

 

You are asking three questions. I will reply to them in order.

 

Note:
I show you how to use the Data Source function of the UI instead of using the API.
If you want to query these via the API, you will be using Export ZOQL.
To learn how to execute Export ZOQL via the API please refer to the following link:
https://knowledgecenter.zuora.com/DC_Developers/M_Export_ZOQL


1. How to find Payment related to Refund

In order to find a Payment related to Refund object, you need to search the RefundInvoicePayment object.

RefundInvoicePayment.png

When you create Refund for Payment, Zuora creates RefundInvoicePayment at the same time.

https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Refund#Non-R...
> A RefundInvoicePayment object is created when you create a Refund object. This object ties the Refund object to the associated InvoicePayment object.

 

You can know RefundId and PaymentId by setting RefundInvoicePayment object as base.
Select "Refund Invoice Payment" as Data Source:

datasource01.png

Select Payment.Id and Refund.Id.

datasource02.png

datasource03.png

CSV:

datasource04.png

 

Note:
There is a constraint that the PaymentId field of the Refund object can not be queried directly.
It can be confirmed since there is no "Query" string here.
https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Refund
paymentid.png

 

 

2. How to find Refund for Credit Balance

Refund object has a SourceType field. This field contains the string "Payment" or "CreditBalance".
https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Refund
> SourceType
> Specifies whether the refund is a refund payment or a credit balance.

 

So, in order to find Refund for Credit Balance, execute Data Source function under the following conditions:
refundforcreditbalance.png

 

Note:
If Refund is created for CreditBalance, no RefundInvoicePayment object is created.

 

3. PaymentId was removed from Refund

I think, PaymentId has not been removed from Refund.

 

If such action is taken, it will be listed in API Changelog.
https://community.zuora.com/t5/Developers/API-Changelog/gpm-p/18092

 

Also, you can check the fields of the object using the describe call.
https://www.zuora.com/developer/api-reference/#tag/Describe
I confirmed the field of Refund object. It has PaymentId field.

refundhaspaymentid.png