My Products
Help
kjell_walvag
VISMA

Change in dynamic pageSize for GET customerinvoice

by kjell_walvag (Updated ‎11-08-2020 08:14 by kjell_walvag VISMA )
We have implemented GET cutomerInvoices with dynamic pageSize. 
This stopped working last week.
 
We do not know the max pageSize we can use so we call the 1. time with a pageSize set to 100:
https//integration.visma.net/API/controller/api/v1/customerinvoice?status=Open&pageSize=100&pageNumber=1
 
After receiving the response we look at element in the response
 
 "metadata":{
         "totalCount":447,
         "maxPageSize":500
      }
 
Here the maxPageSize is 500 so next time we call with:
https//integration.visma.net/API/controller/api/v1/customerinvoice?status=Open&pageSize=500&pageNumber=2
 
But this call will return an empty response:
 
[]
 
This was working OK until last week.
 
Must we call GET customerInvoice with a static pageSize. In that case what pageSize should we use?
1 REPLY 1
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

 

According to what you are writing in your email, this is working as intended.

 

The first response says that you have 447 invoices available, and then when you call page 2 of 500 invoices per page you get an empty response.

Eg. Pagesize = 500: Page 1 will contain item 1-500, Page 2 will contain 500-1000.

 

Changing the pagesize between the calls while incrementing the pagenumber would mean that you miss getting the difference in pageSize.

 

Please have a look at this article:, it looks like some of these changes are already being implemented:

Enforcement of pagination on API endpoints and change of maxPagesize - September release (8.25)