Applies to: Labor API | Webhooks
Learn how to get details for the timecard (shift) you want to update, get available break types, and add a break to the timecard using the Labor API.
Square API version - Square API version 2025-05-21 or later is required to call
Timecardendpoints. TheShiftobject and related endpoints, data types, and webhook events are deprecated and replaced byTimecardequivalents. For more information, see Migration notes.Valid access token - Square API requests require an
Authorizationheader with a bearer access token. The examples in this topic use the Square Sandbox, so you can test using your Sandbox access token.Applications using OAuth access tokens to authorize requests typically require the following permissions for timecard management:
MERCHANT_PROFILE_READto retrieve location information.EMPLOYEES_READto retrieve team member, job, and wage information.TIMECARDS_READandTIMECARDS_WRITEto retrieve and manage timecards (shifts).TIMECARDS_SETTINGS_READandTIMECARDS_SETTINGS_WRITEto retrieve and manage break types and workweek settings.
To call Square APIs in the production environment, change the base URL to
https://connect.squareup.comand use your production (personal) access token.A timecard for testing - For this exercise, you need an
OPENtimecard (shift) to add a break to. In addition, you must create a break type that defines the break.A timecard is a record of the hours worked by a team member for a single shift on a specific day, including breaks, declared cash tips, and wage information. For open timecards, the
statusfield is set toOPENand there's noend_attimestamp. To learn how to create a timecard, see Start and End Timecards.
Note
The Labor API defines two types of objects; be careful not to confuse them:
- A ScheduledShift is used to manage team schedules.
- A Timecard represents a single work shift for a team member. Each
Timecardcaptures:- The actual time worked during one shift
- Information needed for payroll processing
For example, if an employee works five different shifts in a week, they will have five separate Timecard records - one for each shift.
Note: The older Shift object type is deprecated. Use Timecards instead. For information about migration, see Migration notes.
To get details about the target timecard, call RetrieveTimecard and specify the timecard ID. If you don't have the timecard ID, call SearchTimecards using supported filters to get the timecard.
The timecard is updated each time the team member takes a break during the shift.
Retrieve timecard
To get details about available break types, call ListBreakTypes. For businesses with more than one location, you can filter by location_id.
List break types
When the break starts, call UpdateTimecard to add the break to the Timecard.breaks field. Specify the start_at time of the break, as well as the name, break_type_id, expected_duration, and is_paid fields that correspond to the break type.
Note
Including the version field in the request enables optimistic concurrency control. If the specified version doesn't match the current version of the Timecard object, the update fails and you receive an error.
Update timecard
Updating a timecard triggers a labor.timecard.updated webhook event.
When the break ends, call UpdateTimecard again and update the break with the end_at time. Make sure to specify the latest version number of the timecard.
Update timecard
Updating a timecard triggers a labor.timecard.updated webhook event.