Add Breaks to a Shift
Learn how to get details for the shift you want to update, get available break types, and add a break to a shift.
You need a valid access token. You should test with Sandbox credentials whenever possible. For more information, see Access Tokens and Other Square Credentials.
If you are using OAuth, you need
TIMECARDS_WRITE
permission to update a shift andTIMECARDS_READ
permission to retrieve ashift
.You need to create a
Shift
object using the Labor API. To create your first shift, see Build with the Labor API.You need to know the shift ID you want to update.
Important
A shift is complete when it has a start time and end time. If an employee takes breaks during a shift, the shift must be updated with each break including start and end times for the breaks taken.
The response to the shift request is a Shift
object that matches the specified shift ID. For example:
The response to the request is an array of BreakType
objects assigned to the
Location ID
. For example:
Create a new break object with a start time, a name, and the ID of the break template and then add it to the shift.
Important
If the version value of the most recently updated shift does not equal the value of the Shift
object you are updating, the update fails and you receive an error response. If this happens, it is typically because a different client endpoint has updated the same shift after your application got the shift. To resolve the error, get a fresh instance of the shift by restarting the workflow from step 1.
The response is a Shift
object updated with the added break and an incremented version number. For example:
The response is an updated version of the Shift
object with an incremented version number. For example:
If you need more assistance, contact Developer Support or ask for help in the Developer Forums.