v1

latestOpenAPI 3.0.0Apache 2.02026-07-142008071.1 MB
Labor

CreateShift

Creates a new Shift.

A Shift represents a complete workday 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 date overlaps another shift for the same employee.
  • The Break instances are set in the request and a break start_at is before the Shift.start_at, a break end_at is after the Shift.end_at, or both.
post/v2/labor/shifts

Request body

idempotency_keystring

A unique string value to ensure the idempotency of the operation.

Example request

{
  "request_body": {
    "idempotency_key": "HIDSNG5KS478L",
    "shift": {
      "breaks": [
        {
          "break_type_id": "REGS1EQR1TPZ5",
          "end_at": "2019-01-25T06:16:00-05:00",
          "expected_duration": "PT5M",
          "is_paid": true,
          "name": "Tea Break",
          "start_at": "2019-01-25T06:11:00-05:00"
        }
      ],
      "end_at": "2019-01-25T13:11:00-05:00",
      "location_id": "PAA1RJZZKXBFG",
      "start_at": "2019-01-25T03:11:00-05:00",
      "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
      "wage": {
        "hourly_rate": {
          "amount": 1100,
          "currency": "USD"
        },
        "title": "Barista"
      }
    }
  }
}

Response

Success

Example response

{
  "shift": {
    "breaks": [
      {
        "break_type_id": "REGS1EQR1TPZ5",
        "end_at": "2019-01-25T06:16:00-05:00",
        "expected_duration": "PT5M",
        "id": "X7GAQYVVRRG6P",
        "is_paid": true,
        "name": "Tea Break",
        "start_at": "2019-01-25T06:11:00-05:00"
      }
    ],
    "created_at": "2019-02-28T00:39:02Z",
    "employee_id": "ormj0jJJZ5OZIzxrZYJI",
    "end_at": "2019-01-25T13:11:00-05:00",
    "id": "K0YH4CV5462JB",
    "location_id": "PAA1RJZZKXBFG",
    "start_at": "2019-01-25T03:11:00-05:00",
    "status": "CLOSED",
    "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
    "timezone": "America/New_York",
    "updated_at": "2019-02-28T00:39:02Z",
    "version": 1,
    "wage": {
      "hourly_rate": {
        "amount": 1100,
        "currency": "USD"
      },
      "title": "Barista"
    }
  }
}