Happy Business Starts Here

Get list of invoices with account name


Get list of invoices with account name


I am creating a customer service application. Since customer support usually have a customer on the line, i would like to use the fastest method to get Invoice list containing the customer name. I would like something similar to the list that is in Zuora Invoices.


To get the list I am using a query


	"queryString": "Select accountid, amount, AmountWithoutTax, Balance, CreatedDate, DueDate, Id, IncludesOneTime, IncludesRecurring, InvoiceDate, InvoiceDate, InvoiceNumber, LastEmailSentDate, PaymentAmount, RefundAmount, Status, TargetDate from Invoice"

It would have been brilliant if I could use Account.Name in it, but it seems that is not possible as its a ZOQL and not export.



So far the only options I have found is either  get the account names in a seperate api call or to use an ZOQL Export. 



Neither of this methods seems like they are efficient. So I am wondering if there is a easier way to get the name of the account on a invoice? 


Zuora Staff

Re: Get list of invoices with account name

Hi - 


You can check out Data Query to solve this for you.

Here is the documentation, be sure to check out our limitations section. If your Accounts or Invoice tables are very large, you will have to add filters on the tables. 

Here is the API reference.

Here is where you can request enabalement through a support ticket if you haven't already for your tenant. 

Here is the query you can write: 

select name from account join invoice on invoice.accountid = account.id
Happy querying 🙂 
Kate, Data Query PM