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 |
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 |
|---|---|---|
| string | The unique identifier (UID) of the drawer session document. Example: "_id": "f7872f8a-76a0-4f49-b7f8-048d56ec5a18" |
| string | Describes the type of banking session assigned to this terminal. The available values are as follows:
Example: "bankingMode": "employee" |
| 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" |
| string | The UID of the company within which this drawer event was created. Example: "companyId": "60a29826879a1a0007021082" |
| string | The date and time when this drawer session was created. Example: "created": "20XX-06-08T18:44:00.911Z" |
| decimal | The actual amount of the currency in the cash drawer at the moment of a new event creation. Example: "currentAmount": 178.24 |
| string/ UUID Length: 36 | The UID of the drawer session Example: "drawerId": "9d8e6c81-ab6f-4447-b03d-2d859818177f" |
| string | The readable drawer identifier in the format: [Terminal Number]_[Sequential number that was assigned to the current drawer] Example: "drawerNumber": "1_1" |
| array | The list of transactions that affected current drawer amount. Structure: events Array |
| string | The Date/Time value describing when this drawer session was last updated. Example: "lastUpdated": "2021-06-08T18:44:00.912Z" |
| 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" |
| array | The list of employees that were associated with this drawer session. Structure: participants Array |
| integer | The assigned identifier for a given drawer session. Example: "sessionNumber": 1072 |
| string / UUID Length: 36 | The UID of the site where this drawer session occurred. Example: "siteId":"6081b53bd84efe003494358c |
| decimal | The amount of currency in the physical drawer at the time of the drawer "Open" event. Example: "startAmount": 150 |
| string | Describes the status of the drawer at the time of a given event. The available values are as follows:
Example: "status": "open" |
| string | References the UUID of the terminal associated with this drawer session. Example: "terminalId": "5a5901f0fcacfe00019a7fda" |
| integer | The numeric identifier of the terminal associated with this drawer session. Example: "terminalNumber": 1 |
| 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 | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| string | The unique identifier (UID) of the event | |||||||||||||||||||||
| object | The detailed information of the employee or terminal that performed the transaction. Structure: participants Array | |||||||||||||||||||||
| string | The UID of the employee or entity identifier of the terminal that initiated the event | |||||||||||||||||||||
| decimal | The amount of money associated with the transaction | |||||||||||||||||||||
| string | The ISO timestamp of the event | |||||||||||||||||||||
| string | The readable event description | |||||||||||||||||||||
| string | The duration of the physical drawer being open in milliseconds | |||||||||||||||||||||
| string | The associated event's type. The available values are as follows:
| |||||||||||||||||||||
| 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:
| |||||||||||||||||||||
| object | The extended information regarding the terminal on which this drawer event was created. Structure:
| |||||||||||||||||||||
| string | The optional or mandatory (depends on settings) for pay-in/out events | |||||||||||||||||||||
| object | The detailed information about the General Ledger Account (GLA) chosen during pay-in/out events. Structure:
| |||||||||||||||||||||
| string | The mandatory field for gift card pay-out transactions | |||||||||||||||||||||
| 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 |
|---|---|---|
| string | The unique identifier (UID) of the employee or entity identifier of the terminal that initiated one of the drawer events |
| string | The employee's or terminal's name |
| string | The point of sale (POS) user identifier of the employee working with the drawer. WarningOmitted for the terminal. |
| array | Contains job code data associated with this employee, for this drawer session. It includes the names of job codes assigned to the employee. |
| string | The numeric UID of the employee in our system |
| string | Describes the type of participant. The available values are as follows:
|
Sample Drawers Object participants Array
"participants": [
{
"id": "6023f01de2d4dc00015eee99",
"name": "John D.",
"pos_id": "1",
"job_code": [
"Server"
],
"employee_corporate_code": "1",
"actorType": "user"
}
]