Cash Drawer Shifts API Overview

Get cash drawer shift data to create bookkeeping reports for cash drawer activity on a Square Point of Sale device paired with a cash drawer.

The Square Cash Drawer Shifts API is a reporting API for businesses that use a cash drawer with their Square Point of Sale terminals. The API allows you to get filtered and paged lists of cash drawer shifts and their related shift events for a given location. It replaces the deprecated Connect v1 Cash Drawer Shifts API.

This guide explains how to complete the following essential Cash Drawer Shifts API tasks:

  • Get a paged list of cash drawer shift summaries.
  • Retrieve a single cash drawer shift.
  • Get a paged list of CashDrawerShiftEvent entries for a cash drawer shift by location and shift.
Link to section

Before you call the API

To use the Cash Drawers Shifts API, you need the following:

  • You have a valid Square account. To create a Square account in minutes, visit squareup.com/signup.
  • You have cash management turned on in Square Point of Sale and have created and opened a cash drawer in a Square Point of Sale tablet application.
  • You have an access token and location ID to get cash drawer shifts and events. To learn about getting Sandbox access tokens, see Square Sandbox.

Note

You should do your testing and development of the Cash Drawer Shifts API in production if you need to test against production data. The API only has read-only operations so you cannot update any production data with it.

If you're using OAuth tokens, add CASH_DRAWER_READ permission.

To learn more about how to code the OAuth flow in the Sandbox and production, see OAuth Walkthrough: Test Authorization with a Web Server.

Link to section

Get a personal access token

  1. Open the Developer Dashboard and choose an application. The Credentials page for the selected application appears.
  2. At the top of the page, set the dashboard mode to Production for a production environment access token or Sandbox for a Sandbox environment access token.
  3. Copy the Access Token in the Credentials section of the page.

Store the copied personal access token in a secure location. Any developer can use that token in their own application to get full API access to your Square account.

Did you know?

For more secure access to your Square account, use an OAuth token. The OAuth flow enforces security in two ways:

  • Challenges a user to identify themselves before granting access to a Square account.
  • Limits the scope of access to a Square account and only after the authenticated user authorizes access.
Link to section

Get your location ID

All employee cash drawer shifts processed with the Cash Drawer Shifts API must be associated with a valid location ID for the associated Square account. Use the Locations API to find your location ID.

To see a cURL example showing how to get a specific location, see the Retrieve a specific location code example. To get started quickly:

  1. Go to the Locations page of your Square application in the Developer Dashboard.
  2. Copy the ID of the location you want to use.

Alternatively, you can call the ListLocations operation with the following cURL command:

List locations

In the list of returned locations, select the ID that corresponds to the location you want cash drawers from.

Link to section

List cash drawer shifts

To get information about what cash drawer shifts are opened at a location, issue a GET request to /v2/cash-drawers/shifts. You have the following options for query parameters.

Query parameters

NameTypeDescription
sort_orderSortOrderThe order in which cash drawer shifts are listed in the response, based on their opened_at field. The default value is ASC.
begin_timestringThe inclusive start time of the query on opened_at, in ISO 8601 format. For example, 2019-11-01T00:00:00-08:00.
end_time.stringThe exclusive end date of the query on opened_at, in ISO 8601 format. For example, 2019-11-30T00:00:00-08:00.
limitintegerThe maximum size of a page of results.
cursorstringThe cursor for fetching the next page.
location_idstringThe ID of the location to list cash drawer shifts for.
Link to section

Command line

Use the following cURL command to get cash drawers for a given time period:

List cash drawer shifts

The following response carries an array of CashDrawerShiftSummary:

Link to section

Retrieve a cash drawer shift

When you get a cash drawer shift and want more information about it, you can retrieve more details by using a GET request to /v2/cash-drawers/shifts/{{SHIFT_ID}}. You have the following options for query parameters:

NameTypeDescription
location_idstringThe ID of the location to list cash drawer shifts for.
shift_idstringThe shift’s ID.

Retrieve cash drawer shift

The following response carries a CashDrawerShift:

Link to section

List cash drawer shift events

To get the events for a cash drawer shift, you issue a GET request to /v2/cash-drawers/shifts/{{SHIFT_ID}}/events. You have the following options for query parameters.

Query parameters

NameTypeDescription
limitintegerThe number of resources on a page (with 200 being the default and 1000 being the maximum.)
cursorstringThe opaque cursor for fetching the next page.
location_idstringThe ID of the location to list cash drawer shifts for.
shift_idstringThe shift’s ID.
Link to section

Command line

Use the following cURL command to get cash drawers for a given time period:

List cash drawer shift events

The following response carries an array of CashDrawerShiftEvent: