Update shift
PUT
/v2/labor/shifts/{id}
Updates an existing Shift
.
When adding a Break
to a Shift
, any earlier Breaks
in the Shift
have
the end_at
property set to a valid RFC-3339 datetime string.
When closing a Shift
, all Break
instances in the shift must be complete with end_at
set on each Break
.
Permissions
TIMECARDS_WRITE
TIMECARDS_READ
Try in API Explorer
Name | Description |
---|---|
id
Required
|
ID of the object being updated. |
Name | Description |
---|---|
shift
Required
|
The updated |
Response Fields
Name | Description |
---|---|
shift
|
The updated |
errors
|
Any errors that occurred during the request. |
Examples
PUT
/v2/labor/shifts/{id}
cURL
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/labor/shifts/K0YH4CV5462JB \
-X PUT \
-H 'Square-Version: 2021-01-21' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"shift": {
"team_member_id": "ormj0jJJZ5OZIzxrZYJI",
"location_id": "PAA1RJZZKXBFG",
"start_at": "2019-01-25T03:11:00-05:00",
"end_at": "2019-01-25T13:11:00-05:00",
"wage": {
"title": "Bartender",
"hourly_rate": {
"amount": 1500,
"currency": "USD"
}
},
"breaks": [
{
"id": "X7GAQYVVRRG6P",
"start_at": "2019-01-25T06:11:00-05:00",
"end_at": "2019-01-25T06:16:00-05:00",
"break_type_id": "REGS1EQR1TPZ5",
"name": "Tea Break",
"expected_duration": "PT5M",
"is_paid": true
}
],
"version": 1
}
}'
Response JSON
{
"shift": {
"id": "K0YH4CV5462JB",
"team_member_id": "ormj0jJJZ5OZIzxrZYJI",
"employee_id": "ormj0jJJZ5OZIzxrZYJI",
"location_id": "PAA1RJZZKXBFG",
"timezone": "America/New_York",
"start_at": "2019-01-25T03:11:00-05:00",
"end_at": "2019-01-25T13:11:00-05:00",
"wage": {
"title": "Bartender",
"hourly_rate": {
"amount": 1500,
"currency": "USD"
}
},
"breaks": [
{
"id": "X7GAQYVVRRG6P",
"start_at": "2019-01-25T06:11:00-05:00",
"end_at": "2019-01-25T06:16:00-05:00",
"break_type_id": "REGS1EQR1TPZ5",
"name": "Tea Break",
"expected_duration": "PT5M",
"is_paid": true
}
],
"status": "CLOSED",
"version": 2,
"created_at": "2019-02-28T00:39:02Z",
"updated_at": "2019-02-28T00:42:41Z"
}
}