Skip to main content

Drawers

This object is sent to the specified endpoint with every drawer transaction that occurs within our system and includes detailed references to associated orders and employees.

At the root level, the object holds summary information for a given drawer session, while also containing an events array that holds detailed information about the transactions that were performed affecting currency amounts in the cash drawer.

Note

Each drawer event is sent separately to the target address.

The Drawers documentation includes the following sections:

  • The Drawer Status section describes the status of a given drawer session at the time of a given transaction.

  • The Example Drawer section includes sample JSON that illustrates a typical payload sent to the webhook URL.

  • The Data Models section defines each object and attribute that makes up the Drawer Object.

Drawer Status

This field describes the status of a given drawer session at the time of a given transaction.

Drawer Status

Description

Open

The drawer session has begun with the amount specified in the startingAmount field.

Suspended

The drawer operator has invoked the "Suspend Drawer" function, temporarily disabling transactions.

Closed

The drawer session has completed and no further transactions can be performed against it.

Counted

The drawer session has been reconciled and a "Drawer Count" event has been recorded.

Example Drawer Object

The code below shows an example of a Drawer Object that is published to the webhook URL:

{
        "entityName": "Drawer",
        "data": {
          "ownerId": "6023f01de2d4dc00015eee99",
          "participants": [
            {
              "id": "6023f01de2d4dc00015eee99",
              "name": "John D",
              "pos_id": "1",
              "job_code": [
                "Server"
              ],
              "employee_corporate_code": "1",
              "actorType": "user"
            },
            {
              "id": "5a5901f0fcacfe00019a7fda",
              "name": "Reg 1 (Cashier)",
              "actorType": "system"
            }
          ],
          "terminalId": "5a5901f0fcacfe00019a7fda",
          "status": "open",
          "siteId": "60103f03fc8b6e00078d682e",
          "drawerNumber": "1_1",
          "startAmount": 150,
          "currentAmount": 150,
          "businessDate": "2021-06-08T00:00:00.000Z",
          "_id": "e068ca03-6249-4ba2-839b-a808b30fdde7",
          "companyId": "5ddab0e3d93109001df6a76c",
          "bankingMode": "employee",
          "terminalNumber": 1,
          "lastUpdated": "20XX-06-08T18:44:00.912Z",
          "timePunchId": "602428a2e2d4dc00015ef080",
          "drawerId": "8d1e8e59-a721-4a4a-b999-aa48937ccc76",
          "sessionNumber": 1072,
          "created": "20XX-06-08T18:44:00.911Z",
          "events": [
            {
              "description": "User 6023f01de2d4dc00015eee99 opened drawer 
                {8d1e8e59-a721-4a4a-b999-aa48937ccc76} with session 
                {e068ca03-6249-4ba2-839b-a808b30fdde7} and start amount 150",
              "eventType": "opened",
              "amount": 150,
              "terminal": {
                "title": "Reg 1 (Cashier)",
                "terminal_number": "1",
                "_id": "5a5901f0fcacfe00019a7fda"
              },
              "cardNumber": null,
              "date": "20XX-06-08T18:44:00.912Z",
              "actor": {
                "id": "6023f01de2d4dc00015eee99",
                "name": "Deshaun Tester",
                "pos_id": "1",
                "job_code": [
                  "Server"
                ],
                "employee_corporate_code": "1",
                "actorType": "user"
              },
              "reason": null,
              "includes_starting_amount": false,
              "duration": "0",
              "actorId": "6023f01de2d4dc00015eee99",
              "account": null,
              "orderInfo": null,
              "id": "de0df7fc-1147-4cdb-90dc-dbda0b83e488"
            }
          ]
        }
      }

For more information, see Data Models General Structure - Drawers.

Data Models

Data Models General Structure - Drawers

The table below defines the objects and attributes that the Data Stream service sends as part of the Drawers object:

Field Name

Type

Description

_id

string

The unique identifier (UID) of the drawer session document.

Example:

"_id": "f7872f8a-76a0-4f49-b7f8-048d56ec5a18"

bankingMode

string

Describes the type of banking session assigned to this terminal.

The available values are as follows:

  • employee

  • terminal

Example:

"bankingMode": "employee"

businessDate

string

The Date/Time value of the business date, as assigned by the point of sale (POS) terminal.

Example:

"businessDate": "20XX-06-08T00:00:00.000Z"

companyId

string

The UID of the company within which this drawer event was created.

Example:

"companyId": "60a29826879a1a0007021082"

created

string

The date and time when this drawer session was created.

Example:

"created": "20XX-06-08T18:44:00.911Z"

currentAmount

decimal

The actual amount of the currency in the cash drawer at the moment of a new event creation.

Example:

"currentAmount": 178.24

drawerId

string/ UUID

Length: 36

The UID of the drawer session

Example:

"drawerId": "9d8e6c81-ab6f-4447-b03d-2d859818177f"

drawerNumber

string

The readable drawer identifier in the format:

[Terminal Number]_[Sequential number that was assigned to the current drawer]

Example:

"drawerNumber": "1_1"

events

array

The list of transactions that affected current drawer amount.

Structure: events Array

lastUpdated

string

The Date/Time value describing when this drawer session was last updated.

Example:

"lastUpdated": "2021-06-08T18:44:00.912Z"

ownerId

string / UUID

Length: 36

The universally unique identifier (UUID) of the employee who actually opened this drawer session. For the "Employee" Banking Type, this is a unique identifier that serves as a reference to the employee that owns the Drawer. For the "Terminal" Banking Type, this is a unique identifier for the terminal that owns the drawer.

Example:

"ownerId": "60c71dd2c89b350001338a20"

participants

array

The list of employees that were associated with this drawer session.

Structure: participants Array

sessionNumber

integer

The assigned identifier for a given drawer session.

Example:

"sessionNumber": 1072

siteId

string / UUID

Length: 36

The UID of the site where this drawer session occurred.

Example:

"siteId":"6081b53bd84efe003494358c

startAmount

decimal

The amount of currency in the physical drawer at the time of the drawer "Open" event.

Example:

"startAmount": 150

status

string

Describes the status of the drawer at the time of a given event.

The available values are as follows:

  • closed

  • counted

  • open

  • suspended

Example:

"status": "open"

terminalId

string

References the UUID of the terminal associated with this drawer session.

Example:

"terminalId": "5a5901f0fcacfe00019a7fda"

terminalNumber

integer

The numeric identifier of the terminal associated with this drawer session.

Example:

"terminalNumber": 1

timePunchId

string / UUID

Length: 36

The reference to the time punch associated with this banking session if applicable configuration is enabled.

Example:

"timePunchId":"6092bc5ecb0604000155e2f4"

events Array

Field Name

Type

Description

_id

string

The unique identifier (UID) of the event

actor

object

The detailed information of the employee or terminal that performed the transaction.

Structure: participants Array

actorId

string

The UID of the employee or entity identifier of the terminal that initiated the event

amount

decimal

The amount of money associated with the transaction

date

string

The ISO timestamp of the event

description

string

The readable event description

duration

string

The duration of the physical drawer being open in milliseconds

eventType

string

The associated event's type.

The available values are as follows:

  • cash-pull

  • closed

  • counted

  • gift-card-cash-out

  • no-sale

  • opened

  • pay-in

  • pay-out

  • pay-out-tips

  • popped

  • resumed

  • suspended

  • void

  • peripheral_open

  • peripheral_closed

order_info

object

The information regarding the order in relation to the creation of this drawer event.

The drawer event contains useful information regarding the order only for the drawer event with type POPPED, as only this type of event is related to the order.

Structure:

Field Name

Type

Description

orderId

string

The UID of the related order

order_number

string

The number of the related order

paymentIds

array

The array of the payments' UIDs of the related order. It contains a list of UIDs.

terminal

object

The extended information regarding the terminal on which this drawer event was created.

Structure:

Field Name

Type

Description

_id

string

The UID of the related terminal

terminal_number

string

The numeric identifier of the related terminal

title

string

The readable name of the related terminal

reason

string

The optional or mandatory (depends on settings) for pay-in/out events

account

object

The detailed information about the General Ledger Account (GLA) chosen during pay-in/out events.

Structure:

Field Name

Type

Description

_id

string

The UID of the GLA record

name

string

The GLA's name

account_number

string

The GLA's actual value

allowed_for_paid_in

boolean

Displays whether the GLA can be used for pay-in operations

allowed_for_paid_out

boolean

Displays whether the GLA can be used for pay-in operations

entity_id

string

The GLA's UID in the Data Management configuration

cardNumber

string

The mandatory field for gift card pay-out transactions

received_by

string

The unique identifier of the employee to whom tips amount was paid by the manager from the current drawer

Sample Drawers Object events Array

"events": [
  {
   "actor": {
   "id": "60c71dd2c89b350001338a20",
   "name": "Tetiana Tester2",
   "pos_id": "89",
   "job_code": [
    "Cashier"
   ],
   "employee_corporate_code": "9782",
   "actorType": "user"
  },
  "actorId": "60c71dd2c89b350001338a20",
  "amount": 3.04,
  "date": "20XX-07-09T07:32:29.972Z",
  "description": 
    "60c71dd2c89b350001338a20 performed a cash 
     transaction on session {6aa83faa-f830-
     4bd6-b3bf-2bb649c8a22f}",
  "duration": "73",
  "eventType": "popped",
  "orderInfo": {
    "paymentIds": [
      "6cbd1d17-59df-4064-9117-c4f7a0a74929"
    ],
    "orderId": 
      "5f2ce498-ce67-43bc-bbc6-e48b542d54c4",
    "order_number": "100020"
  },
  "terminal": {
    "title": "Reg 1 (Cashier)1",
    "terminal_number": "1",
    "_id": "5a5901f0fcacfe00019a7fda"
  },
  "id": "3bd315b2-063c-47fe-ab88-3f32b844b6fa"
 }
]

participants Array

Field Name

Type

Description

id

string

The unique identifier (UID) of the employee or entity identifier of the terminal that initiated one of the drawer events

name

string

The employee's or terminal's name

pos_id

string

The point of sale (POS) user identifier of the employee working with the drawer.

Warning

Omitted for the terminal.

job_code

array

Contains job code data associated with this employee, for this drawer session. It includes the names of job codes assigned to the employee.

employee_corporate_code

string

The numeric UID of the employee in our system

actorType

string

Describes the type of participant.

The available values are as follows:

  • user

  • system

Sample Drawers Object participants Array

"participants": [
 {
  "id": "6023f01de2d4dc00015eee99",
  "name": "John D.",
  "pos_id": "1",
  "job_code": [
   "Server"
  ],
  "employee_corporate_code": "1",
  "actorType": "user"
 }
]