Troubleshoot the Labor API

Applies to: Labor API

Find problems and solutions related to managing timecards and breaks using the Labor API.

Note

The Shift object and related endpoints, data types and webhook events are deprecated in Square API version 2025-05-21 and replaced by Timecard equivalents. For more information, see Migration notes.

Link to section

I cannot create a new timecard for a team member

The error response says that the team member can only have one open timecard (or shift) at a time.

Cause

The team member has an open timecard (or shift) from a previous day that needs to be closed before a new one can be created.

Solution

  1. To find the open timecard, call SearchTimecards and verify that the end_at field is null or missing.

    When checking for an open timecard for a team member, use the status and team_member_ids query filters, as shown in the following example:

    Search timecards

    Note that the response is an empty object if the team member doesn't have an OPEN timecard:

    {}
  2. To end the timecard, call UpdateTimecard and set the end_at time.

Link to section

My create request returns the timecard from a previous create operation

Cause

An idempotency key was reused for the CreateTimecard (or CreateShift) request.

Solution

Generate a new idempotency key and resend the request.

Link to section

When closing a timecard, the API was unable to service the request

There are no overlapping timecards (or shifts) for the team member and the body of the update request is formed correctly.

Cause

An open Break needs to be closed.

Solution

Iterate the Break objects in the breaks field in the returned object. When a Break with no end_at property is found, set the property to the current time and resend your update request.

Link to section

My search query returns too many results

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 an enum value it doesn't recognize, the related filter criteria is ignored.

Solution

Enum values and 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 Square API Reference.

Link to section

See also