Search code examples
intuit-partner-platformquickbooks-online

Get total number of items via QuickBooks API


The QuickBooks Online api supports paging and sorting results with special query parameters. Paging requires two parameters: PageNumber and ResultsPerPage. However, there doesn't seem to be any way of figuring out how many pages are available at a given number of results per page, or how many objects there are. The response only includes the current page and how many things are on it.

Is it possible to get either a total count of items for a given search? Or at least a total number of pages?


Solution

  • In QBO there is no direct api to get the total count or the total number of pages.

    You need to use paging only for this use case.

    To use paging use the findAll method(with page no and chunk size attributes) of the corresponding entity. ex - Ref doc for Customer(QBO) http://developer-static.intuit.com/SDKDocs/QBV2Doc/ipp-java-devkit-2.0.10-SNAPSHOT-javadoc/ (QBOEmployeeService). Ref example -https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0200_ipp_java_devkit/0800_crud_examples