Cursor value is returned if there no records in the next batch

I am getting cursor value in the customer API response even if there is no customer records present.

I have 6 customers .
I am calling /v2/customers/search API
and setting only limit to 6 .
Within response i am getting all 6 records along with cursor value.
and if I set this cursor value then i get empty response.
This should not happen if i got all 6 records within first batch itself then i shouldn’t be getting the cursor value.

This is happening even with GET /v2/customers API when setting limit.

I just figured this out myself. “Limit” means limit the response to 6 customers per page. You are getting the cursor value because the API doesn’t know that there aren’t anymore customers after your first six. If you set the limit to requesting 7 customers per page, the API will hit that you have no more after the first 6 and not send you a cursor value.

In my case, I thought I was requesting only 1 order when I set limit to 1. Turns out that meant I was only receiving 1 order on each page, which meant my request was taking several minutes instead of the seconds it should have! This may seem obvious to experienced coders, but I’m still learning new details every day.