v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Labor

PublishScheduledShift

Publishes a scheduled shift. When a scheduled shift is published, Square keeps the draft_shift_details field as is and copies it to the published_shift_details field.

post/v2/labor/scheduled-shifts/{id}/publish

Path parameters

idstring required

The ID of the scheduled shift to publish.

Request body

idempotency_keystring required

A unique identifier for the PublishScheduledShift request, used to ensure the idempotency of the operation.

versioninteger

The current version of the scheduled shift, used to enable optimistic concurrency control. If the provided version doesn't match the server version, the request fails. If omitted, Square executes a blind write, potentially overwriting data from another publish request.

scheduled_shift_notification_audience'ALL' | 'AFFECTED' | 'NONE'

Indicates whether Square sends an email notification to team members when a scheduled shift is published and which team members receive the notification.

Example request

{
  "idempotency_key": "HIDSNG5KS478L",
  "scheduled_shift_notification_audience": "ALL",
  "version": 2
}

Response

Success

Example response

{
  "scheduled_shift": {
    "created_at": "2019-02-25T03:11:00-05:00",
    "draft_shift_details": {
      "end_at": "2019-01-25T13:11:00-05:00",
      "is_deleted": false,
      "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
      "location_id": "PAA1RJZZKXBFG",
      "notes": "Dont forget to prep the vegetables",
      "start_at": "2019-01-25T03:11:00-05:00",
      "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
      "timezone": "America/New_York"
    },
    "id": "K0YH4CV5462JB",
    "published_shift_details": {
      "end_at": "2019-01-25T13:11:00-05:00",
      "is_deleted": false,
      "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
      "location_id": "PAA1RJZZKXBFG",
      "notes": "Dont forget to prep the vegetables",
      "start_at": "2019-01-25T03:11:00-05:00",
      "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
      "timezone": "America/New_York"
    },
    "updated_at": "2019-02-25T03:11:00-05:00",
    "version": 2
  }
}