You are viewing an old version of the API
Create shift

Creates a new Shift

A Shift represents a complete work day for a single employee. You must provide the following values in your request to this endpoint:

  • location_id
  • employee_id
  • start_at

An attempt to create a new Shift can result in a BAD_REQUEST error when:

  • The status of the new Shift is OPEN and the employee has another shift with an OPEN status.
  • The start_at date is in the future
  • the start_at or end_at overlaps another shift for the same employee
  • If Breaks are set in the request, a break start_at must not be before the Shift.start_at. A break end_at must not be after the Shift.end_at
Required permissions TIMECARDS_WRITE

Request Body

Name Description
shift
Shift

Required

The Shift to be created

idempotency_key
string

Unique string value to insure the idempotency of the operation.

Max Length 128

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

shift
Shift

The Shift that was created on the request.

Examples

You are viewing an old version of the API
POST /v2/labor/shifts
cURL
  • cURL
  • Ruby
  • Python
curl https://connect.squareup.com/v2/labor/shifts \
  -X POST \
  -H 'Square-Version: 2019-11-20' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -d '{
    "idempotency_key": "HIDSNG5KS478L",
    "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": "Barista",
        "hourly_rate": {
          "amount": 1100,
          "currency": "USD"
        }
      },
      "breaks": [
        {
          "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
        }
      ]
    }
  }'
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": "Barista",
      "hourly_rate": {
        "amount": 1100,
        "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": 1,
    "created_at": "2019-02-28T00:39:02Z",
    "updated_at": "2019-02-28T00:39:02Z"
  }
}

Share Feedback

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