Labor
BulkPublishScheduledShifts
Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish requests and returns a map of responses. When a scheduled shift is published, Square keeps the draft_shift_details field as is and copies it to the published_shift_details field.
The minimum start_at and maximum end_at timestamps of all shifts in a BulkPublishScheduledShifts request must fall within a two-week period.
post/v2/labor/scheduled-shifts/bulk-publish
Request body
Example request
{
"scheduled-shifts": {
"K0YH4CV5462JB": {
"version": 3
},
"scheduled-shift-2": {
"version": 2
}
},
"scheduled_shift_notification_audience": "AFFECTED"
}Response
Success
Example response
{
"responses": {
"idp_key_1": {
"scheduled_shift": {
"created_at": "2019-02-25T03:11:00-05:00",
"draft_shift_details": {
"end_at": "2019-03-25T13:18:00-05:00",
"is_deleted": false,
"job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
"location_id": "PAA1RJZZKXBFG",
"notes": "Don't forget to prep the vegetables",
"start_at": "2019-03-25T03:11:00-05:00",
"team_member_id": "ormj0jJJZ5OZIzxrZYJI",
"timezone": "America/New_York"
},
"id": "K0YH4CV5462JB",
"published_shift_details": {
"end_at": "2019-03-25T13:18:00-05:00",
"is_deleted": false,
"job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
"location_id": "PAA1RJZZKXBFG",
"notes": "Don't forget to prep the vegetables",
"start_at": "2019-03-25T03:11:00-05:00",
"team_member_id": "ormj0jJJZ5OZIzxrZYJI",
"timezone": "America/New_York"
},
"updated_at": "2019-02-25T03:11:15-05:00",
"version": 3
}
},
"idp_key_2": {
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_VALUE",
"detail": "Scheduled shift with id 'scheduled-shift-2' not found",
"field": "scheduled-shifts.scheduled-shift-2"
}
]
}
}
}