Troubleshoot the Labor API
Find problems and solutions related to opening shifts, adding breaks, and closing shifts using the Labor API.
Square's error response says that the new Shift
overlaps other shifts for a team member who has no other shifts on this day.
Cause
The team member has an open shift from a previous day that needs to be closed.
Solution
Find the previous shift and verify that the end_at
field is null or missing. Close the shift by setting an
end_at
value and sending an UpdateShift
request for the shift to be closed.
When checking for an open shift, use code like the following example and provide the ID of the team member associated with the open shift:
The response to the shift search request is an empty object if the team member does not have an OPEN
shift:
Cause
A new idempotency key was not generated for this operation.
Solution
Generate a new idempotency key and retry the operation.
There are no overlapping shifts for the employee and the body of the close request is formed correctly.
Cause
The Shift
to be closed has an open Break.
Solution
Iterate the Break
objects in the shift. When a Break
with no end_at
property
is found, set the property to the current time.
Cause
A filter field is invalid (REST only) or an enum value is invalid (REST and SDK). When the search endpoint receives a filter field or enum value it does not recognize, the related filter criteria is ignored.
Solution
Enums and JSON field names are case-sensitive. Confirm that the field name is correct and lowercase (REST) and the provided enum values match their definition in the Technical Reference.
If you need more assistance, contact Developer Support or ask for help in the Developer Forums.