Happy Business Starts Here

Is the Reversed field on Invoice Object is accessible via API

iganesan
Honor Student

Is the Reversed field on Invoice Object is accessible via API

Hi,

 

I would like to access the Reversed field (standard field) on Invoice Object via API call. This is checked during invoice reversal and i would like to know if this field is accessible or not, as i could not find the field API name in the Object's standard field list in the knowledge center.

2 REPLIES 2
kconnor
Valued Scholar

Re: Is the Reversed field on Invoice Object is accessible via API

The Knowledge Center explicitly says that this field is not available via the REST or SOAP APIs. https://knowledgecenter.zuora.com/CB_Billing/IA_Invoices/Reverse_Posted_Invoices

 

This is a big problem for us. If an invoice is reversed, we need to handle it differently than a normal invoice. Are there any plans to add this field to the API?

octavian
Savvy Scholar

Re: Is the Reversed field on Invoice Object is accessible via API

I found 2 options:

1. There is a Rest endpoint to get a list of Invoices for an Account, which response includes a "reversed: <boolean>" field:

https://www.zuora.com/developer/api-reference/#operation/GET_TransactionInvoice

 

2. There is a trick via ZOQL. 

 select Id, Reversed from Invoice where ...

Query works, but the Reversed field will not be included in the result. But it also won't throw an error, which led me to this workaround: 

 select Id, ... from Invoice where ... and Reversed = true

This works and correctly only returns Invoices that have been reversed.