Happy Business Starts Here

Highlighted
Student

Get filtered and paginated Invoices real-time

Hi,

 

We are building an interface to display relevant billing information to our end customers. We want to show the historic of invoices and pagination is required.

 

I was planning on using Transaction Invoices from the REST API but I need to exclude at least the invoices which status is Draft. Current API doesn't allow filtering by any fields of the model that is being requested (in this case it only allows setting the page size and page number). I thought on going for ZOQL using Query but ZOQL it doesn't allow setting limit nor offset and using batchSize and queryMore does not look like an option to me as the client of the API we are building could potentially request page numbers in any order, not exactly sequentially. Then I read about Export ZOQL but I also read it's intended for data replication use cases and not for querying data in real time.

 

Is the any feature not documented for the API that could help my use-case?

 

Thanks

3 REPLIES 3
Support SME

Re: Get filtered and paginated Invoices real-time

HI @jehupacheco Maybe you can try Get billing documents https://www.zuora.com/developer/api-reference/#operation/GET_BillingDocuments It is real-time and has paginated. 

Student

Re: Get filtered and paginated Invoices real-time

Thanks @Yong for the answer, it's really helpful that I can filter the status of the documents, is there any way to get only the invoices using  Get billing documents? That will cover my use case, if not, it will be the a similar problem I have with Get Invoices in which I can get only invoices but I'm unable to get only the Posted ones

Support SME

Re: Get filtered and paginated Invoices real-time

If you have Invoice Settlement enabled, the documentType is "Invoice" "CreditMemo" "DebitMemo". https://knowledgecenter.zuora.com/CB_Billing/Invoice_Settlement

If you don't have this feature yet, only Invoice will be returned because CM and DM do not exist at all.