POST /v2/labor/shifts/search

Returns a paginated list of Shift records for a business. The list to be returned can be filtered by:

The list can be sorted by:

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
query Object No

The parameters of a Shift search query, which includes filter and sort options.

query.filter Object No

Defines a filter used in a search for Shift records. AND logic is used by Square's servers to apply each filter property specified.

query.filter.end Object No

Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled.

query.filter.end.start_at String No

A datetime value in RFC 3339 format indicating when the time range starts.

query.filter.end.end_at String No

A datetime value in RFC 3339 format indicating when the time range ends.

query.filter.team_member_ids[] Array Yes

Fetch shifts for the specified team members. Replaced employee_ids at version "2020-08-26".

query.filter.location_ids[] Array Yes

Fetch shifts for the specified location.

query.filter.workday Object No

A Shift search query filter parameter that sets a range of days that a Shift must start or end in before passing the filter condition.

query.filter.workday.default_timezone String No

Location-specific timezones convert workdays to datetime filters. Every location included in the query must have a timezone or this field must be provided as a fallback. Format: the IANA timezone database identifier for the relevant timezone.

query.filter.workday.date_range Object No

A range defined by two dates. Used for filtering a query for Connect v2 objects that have date properties.

query.filter.workday.date_range.start_date String No

A string in YYYY-MM-DD format, such as 2017-10-31, per the ISO 8601 extended format for calendar dates. The beginning of a date range (inclusive).

query.filter.workday.date_range.end_date String No

A string in YYYY-MM-DD format, such as 2017-10-31, per the ISO 8601 extended format for calendar dates. The end of a date range (inclusive).

query.filter.workday.match_shifts_by String No

The strategy on which the dates are applied.

query.filter.status String No

Fetch a Shift instance by Shift.status.

query.filter.employee_ids[] Array No

Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use team_member_ids instead.

query.filter.start Object No

Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled.

query.filter.start.start_at String No

A datetime value in RFC 3339 format indicating when the time range starts.

query.filter.start.end_at String No

A datetime value in RFC 3339 format indicating when the time range ends.

query.sort Object No

Sets the sort order of search results.

query.sort.field String No

The field to sort on.

query.sort.order String No

The order in which results are returned. Defaults to DESC.

limit Integer No

The number of resources in a page (200 by default).

cursor String No

An opaque cursor for fetching the next page.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.