You are viewing an old version of the API
Update shift

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.

Required permissions TIMECARDS_WRITE TIMECARDS_READ

Path Parameters

Name Description
id
string

Required

ID of the object being updated.

Request Body

Name Description
shift
Shift

Required

The updated Shift object.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

shift
Shift

The updated Shift.

Examples

You are viewing an old version of the API
PUT /v2/labor/shifts/{id}
cURL
  • cURL
  • Ruby
  • Python
curl https://connect.squareup.com/v2/labor/shifts/{id} \
  -X PUT \
  -H 'Square-Version: 2019-11-20' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -d '{
    "shift": {
      "employee_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",
    "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"
  }
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?