You can request labor reporting data for a single day, week, or
month. The type of time range you use determines the rate limit for this
endpoint and method type. The rate limit for a month
time
range is 10 requests per hour. The rate limit for day
and
week
time ranges is 10 requests per minute and 60 requests
per hour. For more information about API rate limits for the analytics
API, see Analytics API rate limits.
You must include the startBusinessDate
and
endBusinessDate
properties in the message body to identify
the start and end dates for the time range, in YYYYMMDD
format. For the day
time range, the dates must be the
same.
Optionally, you can use the restaurantIds
in the
message body to list the GUIDs of specific restaurants from the
management group that you want to include, or the
excludedRestaurantIds
in the message body to list the GUIDs
of specific restaurants from the management group that you want to
exclude. If you add restaurant GUIDs to the restaurantIds
value, all restaurants not listed are excluded from the labor reporting
data. If you add restaurant GUIDs to the
excludedRestaurantIds
value, all restaurants not listed are
included in the labor reporting data.
Important |
You can include restaurant GUIDs for only one of these values.
Listing restaurant GUIDs for both |
You can optionally include only data from currently inactive
restaurants using onlyInactiveRestaurants
as a query
parameter. For more information, see Viewing inactive restaurant data.
Send a POST
request to the
/era/v1/labor/{timeRange}
endpoint to request labor
reporting data for a specific time range. The time range you specify can
be day
, week
, or month
.
To create a request for labor data, you must include:
-
The
restaurantIds
value in the message body. This identifies the only restaurants to include in the returned data using the restaurant GUID. All restaurants not listed are excluded from the returned data. This value can be left empty to include all restaurants. -
The
excludedRestaurantIds
value in the message body. This identifies the only restaurants to exclude in the returned data using the restaurant GUID. All restaurants not listed are included in the returned data. This value can be left empty to include all restaurants.Important
You can only include restaurant GUIDs for either
restaurantIds
orexcludedRestaurantIds
. Listing restaurant GUIDs for both results in a 400 error or blank data. -
The
startBusinessDate
value in the message body. This identifies the start date for the return data. This value must match theendBusinessDate
value if using theday
time range. -
The
endBusinessDate
value in the message body. This identifies the end date for the return data. This value must match thestartBusinessDate
value if using theday
time range.
The following example curl command sends a
POST
request to the
/era/v1/labor/{timeRange}
endpoint. This example uses the
day
time range.
curl -i -X POST \ 'https://[toast-api-hostname]/labor/day' \-H 'Authorization: Bearer [token]' \
-H 'Content-Type: application/json' \
-d @[request-info].json \
Send a |
|
Include an authentication token. For more information, see Authentication and restaurant access. |
|
Set the data type of the message body to
|
|
Include details about the requested labor reporting data in the message body. The following example is the message body for this curl command example. |
The following example shows the message body for creating a labor reporting data request.
{ "startBusinessDate": "20230205","endBusinessDate": "20230205",
"restaurantIds": [],
"excludedRestaurantIds": [],
"groupBy": [“JOB”]
}
The start date of the time range for the labor reporting
data, in |
|
The end date of the time range for the labor reporting data,
in |
|
The list of restaurant GUIDs from the management group to include in the labor reporting data. Restaurant GUIDs not listed are excluded. |
|
The list of restaurant GUIDs from the management group to
exclude from the labor reporting data. In this example,
restaurants are included with the |
|
This request for labor reporting data is grouped by job. |
The following example shows the response from the
/era/v1/labor/day
endpoint.
"707d9f10-e0fe-4e6d-af49-3123a78cd2b3"
The GUID for the labor reporting data request, also called
the |
For an example that shows how to retrieve the labor reporting data, see Retrieving the labor reporting data.