Use Webhooks to Integrate with a Payroll System

Applies to: Labor API

Learn about Labor API webhook events that are published when labor shifts are created, updated, or deleted.

Link to section

Subscribe to Labor API events

The Labor API supports the following webhook events:

EventPermissionDescription
labor.shift.createdTIMECARDS_READA worker started a shift.
Webhook notification data is packaged as a Shift.
labor.shift.updatedTIMECARDS_READA shift was updated.
Typically a break was started or ended or a worker ended the shift.
Webhook notification data is packaged as a Shift.
labor.shift.deletedTIMECARDS_READA shift was deleted.
Notification data includes the deleted shift ID and the isDeleted flag.

A webhook is a subscription where you specify which events you want to be notified about. For information about using webhooks, see Square Webhooks. For a list of all webhook events supported by Square APIs, see Webhook Events Reference.

  • Shift created - labor.shift.created
  • Shift delete - labor.shift.deleted
  • Shift updated - labor.shift.updated
Link to section

Shift event notification body

The event notification body includes properties that identify the notification and a data object for the current state of the Shift that is changed.

Read the type property to identify the notification as a create, update, or delete notification. The merchant_id property identifies the merchant/employer of the worker associated with the shift.

The current state of the Shift is carried by the value of data.object.shift.

To access a Shift represented by a notification, your application requests TIMECARDS_READ permission when authenticating with the OAuth flow.

Link to section

Shift created event

When a Shift is created (normally when an employee starts a shift), the webhook notification body includes a shift object representing the new shift.

If you use this event to synchronize an external payroll system with a Square Point of Sale time clock, use the value of data.object.shift.id to create a unique ID for the created shift in the payroll system.

Shifts are created using a Square POS terminal or by calling CreateShift.

Call GetShift with data.object.shift.id to get the newest version of the Shift represented by the notification. The Shift returned by the GetShift call returns an equal or greater version value as the notification data.object.shift.version.

Link to section

Shift updated event

Shifts are updated when a break is started, a break is ended, or the shift ends. Other actions that trigger this event include updates to any read/write property.

If you use this event to synchronize an external payroll system with a Square Point of Sale time clock, use the value of data.object.shift.id to look up the shift in the payroll system.

The following example event body shows that a team member signed out for a break:

Shifts are updated using a Square POS terminal or by calling UpdateShift.

Call GetShift with data.object.shift.id to get the newest version of the Shift represented by the notification. The Shift returned by the GetShift call returns an equal or greater version value as the notification data.object.shift.version.

Link to section

Shift deleted event

When a Shift is deleted, the data object provides the id of the deleted shift. If you use this event to synchronize an external payroll system with a Square Point of Sale time clock, look up the ID of the deleted shift using the value of data.id.

{ "merchant_id": "6SSW7HV8K2ST5", "type": "labor.shift.deleted", "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", "created_at": "2019-10-29T17:26:16.808603647Z", "data": { "type": "labor", "id": "PY4YSMVKXFY9E", "deleted": true } }

Shifts are deleted by calling DeleteShift.