Opening the cash drawer

Using the REST Pay API, developers can open the cash drawer from their app so merchants can handle cash transactions. It is also possible to get a list of all the connected cash drawers supported by the merchant's Clover device.

When a cash drawer is discovered, it means that the cash drawer is already connected or a hardware port is available to connect it. The behavior varies based on the type of cash drawer. For example, local RJ12-type cash drawers may or may not actually be connected at the time the operation is invoked, but will still be discovered. Other types of cash drawers such as USB cash drawers are only discovered if they are physically connected at the time of the call.

The API provides two endpoints for controlling cash drawers:

Prerequisites

  • The cash drawer is connected correctly to the Clover device
  • The cash drawer is unlocked
  • The POS is connected to the device using a network or cloud connection

Getting a list of cash drawers

Send a GET request to the /v1/device/cash-drawers endpoint. Be sure to include the required headers for the request you are making.

A list of cash drawers is returned. Note the ID of the drawer you want to open.

{
  "drawers": [
    {
      "id": "com.clover.SEIKO_MINI_USB_001",
      "name": "Local Cash Drawer",
      "number": 1
    }
  ]
}

Opening a specific cash drawer

To open a specific cash drawer, send a POST request to the /v1/device/cash-drawer/open {cashDrawerId} endpoint, where {cashDrawerId} is the id of the cash drawer to be opened. Be sure to include the required headers for the request you are making. The reason property is optional.

{
    "cashDrawerId": "com.clover.SEIKO_MINI_USB_001",
    "reason": "cash transaction"
}

The successful response indicates the drawer that was signaled to open.

{ "cashDrawerId": "com.clover.SEIKO_MINI_USB_001" }

Opening the default cash drawer

The default cash drawer is the first drawer that is returned on the list of discovered cash drawers. To open the default cash drawer, send an empty POST request to the /v1/device/cash-drawer/open endpoint. Be sure to include the required headers for the request you are making.

The successful response indicates the drawer that was signaled to open.

{
  "cashDrawerId": "com.clover.SEIKO_MINI_USB_001"
}

Did this page help you?