This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

Getting order identifiers for a time period (deprecated)

You can send a GET request to the /orders endpoint to get a list of the orders that were last modified during a period of time.

When you send a GET request to the /orders endpoint, you specify the period of time that you want to return orders for by using one of two query parameter options:

  • You can select the orders that were last modified during a time period of up to one hour by specifying dates and times in the startDate and endDate query parameters. Note that modification includes creation; that is, these query parameters will return orders that were created or modified during the specified time period.

  • You can select the orders that were created during a single restaurant business day by setting the businessDate query parameter. The restaurant's business day cutoff is determined by the closeoutHour value in the General object within the RestaurantInfo object in the restaurants API.

Toast support recommends that you use the startDate and endDate query parameters, because these parameters get order information using the order's modification timestamp. The businessDate query parameter gets the information using the order's creation date. This means, for example, that if you retrieve order GUIDs with the businessDate query parameter, you will not get orders that were modified on that date but created on an earlier date.

Request for orders last modified during a time period

The following example shows the path for a GET request that will return orders last modified during a one-hour period. The values of the startDate and endDate query parameters must be URL encoded. For more information about date and time formats, see Dates and timestamps.

curl -X GET \
-H "Authorization: Bearer eyJzI1NiJ9hbGciOiJSU.eyJhd9yaXR5Ij
oiQ1JVTkNIVElNRSIsInJzR3VpZCI6IjE4YzQ5YWJlLWFlODItNGFlYy04ND
M1LWJhYTRjMjVlYTY2MiIsInNjb3BlIjpbImxWQiOlsidG9hc3QiXSwibmFt
aW5nQXV0aGhYm9yIiwib3JkZXJzIiwidXNlcm1nbXQiXSwiZXhwIjoxNDg0M
zg5ODUwLCJqdGkiOiJlMDYzZjJkMy1jNGYyLTRiZjItODJmNi01MTg1NWMzZ
DAxM2YiLCJjbGllbnRfaWQiOiJjcnVuY2h0aW1lIn0.X1_0y9Hzj5F9gdOw2
o6VSYTyZwooAJiFMDmNakbZrtiUdYwLzuLwLpCMQzX5pKYtOqDUz_cetGJL3
txKL1L-K2j1Enoq8An8hEM6e8J0KdAiwrYFO3W3CmWedaoz95K9ghNZVCs28
Td2Sp3Ix3fObxbrvanocx9_OT8S9uM8hdSXmBI_ykTWvOVgK4hO24V3DJy4b
9bz1FtgOvrClhELxCe8dJy7jiwAR60xczlCF5rna98RMLN6zY4ffjmljKFZ6
QV0KkVppWjEiJn7oFHiIylCX1sSg7sddrGatj0xJzts3GJ8u8_lryUNHaEvJ
dWq4Yzwo007AMgxjH9d241Y-g" \1
-H "Toast-Restaurant-External-ID: 4622e7a9-b4be-3fef-9220-b3dad273e0b4" \2
"https://[toast-api-hostname]/orders/v2/orders?3
startDate=2019-02-27T09%3A00%3A00.000-0500&
endDate=2019-02-27T09%3A59%3A00.000-0500"4

1

Include an authentication token. For more information, see Authentication and restaurant access.

2

Specify the GUID of the restaurant that created the orders. This must be an individual restaurant, not the GUID for a restaurant group.

3

Send a GET request to the /orders endpoint of the orders API.

4

Specify a period of time up to one hour by including dates and times in the startDate and endDate query parameters.


Request for orders created during one business day

The following example curl command shows a request for all of the orders that were created during one restaurant business day. Specify the restaurant business day with the businessDate query parameter.

curl -X GET \
-H "Authorization: Bearer eyJzI1NiJ9hbGciOiJSU.eyJhd9yaXR5Ij
oiQ1JVTkNIVElNRSIsInJzR3VpZCI6IjE4YzQ5YWJlLWFlODItNGFlYy04ND
M1LWJhYTRjMjVlYTY2MiIsInNjb3BlIjpbImxWQiOlsidG9hc3QiXSwibmFt
aW5nQXV0aGhYm9yIiwib3JkZXJzIiwidXNlcm1nbXQiXSwiZXhwIjoxNDg0M
zg5ODUwLCJqdGkiOiJlMDYzZjJkMy1jNGYyLTRiZjItODJmNi01MTg1NWMzZ
DAxM2YiLCJjbGllbnRfaWQiOiJjcnVuY2h0aW1lIn0.X1_0y9Hzj5F9gdOw2
o6VSYTyZwooAJiFMDmNakbZrtiUdYwLzuLwLpCMQzX5pKYtOqDUz_cetGJL3
txKL1L-K2j1Enoq8An8hEM6e8J0KdAiwrYFO3W3CmWedaoz95K9ghNZVCs28
Td2Sp3Ix3fObxbrvanocx9_OT8S9uM8hdSXmBI_ykTWvOVgK4hO24V3DJy4b
9bz1FtgOvrClhELxCe8dJy7jiwAR60xczlCF5rna98RMLN6zY4ffjmljKFZ6
QV0KkVppWjEiJn7oFHiIylCX1sSg7sddrGatj0xJzts3GJ8u8_lryUNHaEvJ
dWq4Yzwo007AMgxjH9d241Y-g" \
-H "Toast-Restaurant-External-ID: 4622e7a9-b4be-3fef-9220-b3dad273e0b4" \
"https://[toast-api-hostname]/orders/v2/orders?
businessDate=20190227"

Response data containing order GUIDs for one business day

The following example shows the response data from the /orders endpoint using the businessDate query parameter. It contains the GUIDs of each order that was created at a restaurant during a business day. The response data from a request using the startDate and endDate query parameters will contain the GUIDs of orders that were modified or created during the specified time period.

[
  "017fdd94-4a30-4657-9475-b1a684758531",1
  "a64ce8be-c3d0-44cb-a807-86b997847469",
  "bd1e031e-cb86-4ea5-baea-7a6d887d41d8",

  [contents omitted]

  "12acb0c5-27e1-4022-9ad3-2a58f389d590",
  "b89eb706-55ee-4fa2-915c-377568b831cd",
  "e5f91d49-1167-405d-a809-0e36ce260e3d"
]

1

The /orders endpoint returns a JSON array of order GUIDs.