Hi, I was trying out the Square APIs on the latest Square-Version and encountered this issue when trying to fetch labor shifts using its search
endpoint (v2/labor/shifts/search).
First POST request
URL: https://connect.squareup.com/v2/labor/shifts/search
Body:
{
“limit”: 1
}
I successfully got one object of type ‘shifts’ as well as a cursor. I appended the cursor to my next request’s URL like this:
Second POST request
URL: https://connect.squareup.com/v2/labor/shifts/search?cursor=value-I-got-from-previous-response
Body:
{
“limit”: 1
}
But in the response, I got the same ‘shifts’ object and the cursor as I had gotten in the previous request, even though I am using the cursor value I obtained in the first request’s response.
Is this an issue or am I doing something wrong?
Edit: I have observed the same issue with the ‘v2/team-members/search’ endpoint.
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Build with the Labor API
Labor API: How It Works
Cash Drawer Shifts API
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The issue you’re encountering is due to the incorrect placement of the cursor. In the Square API, the cursor should be included in the request body, not as a query parameter in the URL.
Here’s how you should structure your second POST request:
URL: https://connect.squareup.com/v2/labor/shifts/search
Body:
{
“limit”: 1,
“cursor”: “value-I-got-from-previous-response”
}
This way, the API will understand that you’re requesting the next set of results.
This answer was reviewed by @Bryan-Square.
Thanks, that fixed it! It seems I did not go through the reference properly.
Glad to hear it’s working for you now. 
Hello!
Did you get any proper solution?, I am also facing the same issue.