Workflows
The Workflow Object provides point of sale (POS) generated workflow data. The workflow data allows managers to verify that, during the End of Day (EOD) process, all required steps were passed successfully. This also allows managers to ensure all financial operations have been finalized and all reports display result totals without uncontrolled updates.
The Workflows documentation includes the following sections:
Example Workflow Object - A sample JSON illustrating a typical payload sent to the webhook URL.
Data Models - Defines the objects and attributes that make up the Workflow Object.
Example Workflow Object
The code below shows an example of the Workflow Object that is published to the webhook URL:
{
"entityName": "Workflow",
"data": {
"_id": "ab0cc78a-c719-4f83-91fa-6502d675ceqe",
"company_id": "61939a5901181700091be07a",
"site_id": "61939a9701181700091be08b",
"name": "BusinessDayWorkflow",
"created": "2021-12-23T02: 58: 12.664Z",
"offline": true,
"type": "BusinessDate",
"status": "finished",
"business_date": [
"2021-12-21T00: 00: 00.000Z",
"2021-12-22T00: 00: 00.000Z"
],
"terminal": {
"id": "5e74f976c85213975de2f275",
"terminal_number": "22",
"title": "DRIVE-THRURIGHT",
"business_date": "2021-12-22T00: 00: 00.000Z"
},
"employee": {
"id": "5f7babeb9b87ec0001192600",
"name": "RuslanSushko",
"title": "employee",
"code": "0001"
},
"steps": [
{
"type": "drawers",
"status": "success",
"errors": []
},
{
"type": "terminals",
"status": "unsuccess",
"errors": [
{
"name": "errorName",
"info": {}
}
]
},
{
"type": "deposits",
"status": "success",
"errors": []
},
{
"type": "employee_shifts",
"status": "success",
"errors": []
}
]
}
}For more information, see Data Models General Structure - Workflows.
Data Models
Data Models General Structure - Workflows
The table below defines the objects and attributes that the Data Stream service sends as part of the Workflow Object:
Field Name | Type | Description |
|---|---|---|
| string | The unique identifier (UID) of the workflow document in the database |
| string | The UID of the workflow document's source company, which is an internal UID for our system |
| string | The UID of the workflow document's source site, which is an internal UID for our system |
| string | The workflow name |
| string | The workflow creation time (final point) in UTC in the ISO8601 Format |
| boolean | A flag that indicates if the workflow was finalized in the offline mode |
| string | The workflow type |
| string | The workflow status |
| array | A list of business dates affected by the current workflow run |
| The information about a terminal from which the workflow was initiated | |
| The information about an employee that initiated the workflow run | |
| A list of steps with details and statuses that were passed within the workflow run |
terminal Object
Field Name | Type | Description |
|---|---|---|
| string | The unique identifier (UID) of the terminal from which the workflow was initiated, which is an internal UID for our system in the database |
| string | The readable identifier of the terminal that is configured in Data Management |
| string | The readable name of the terminal that is configured in Data Management |
| string | The current business date on the terminal in the UTC ISO8601 Format |
Sample terminal Object Body
"terminal": {
"id": "5e74f976c85213975de2f275",
"terminal_number": "22",
"title": "DRIVE-THRURIGHT",
"business_date": "2021-12-22T00:00:00.000Z"
}employee Object
Field Name | Type | Description |
|---|---|---|
| string | The unique identifier (UID) of the employee that initiated the workflow run, which is an internal UID for our system in the database |
| string | The employee name set up in Staff |
| string | The employee title |
| string | The readable identifier of the employee that is configured in Staff |
Sample employee Object Body
"employee": {
"id": "5f7babeb9b87ec0001192600",
"name": "John Smith",
"title": "employee",
"code": "0001"
}steps Array
Field Name | Type | Description |
|---|---|---|
| string | Name of the step type. The available types are as follows:
|
| string | The step status. The available statuses are as follows:
|
| Contains detailed information about errors received during the processing of the step. NoteThis structure is not static and can be extended based on the needs of the point of sale (POS) system. |
Sample steps Array Body
"steps": [
{
"type": "drawers",
"status": "unsuccess",
"errors": [
{
"name": "uncounted drawer",
"info": {
"drawerId": "ca1ed7d7-4411-4970-acb9-cad938513018",
"businessDate": "2022-03-31T00:00:00.000Z",
"status": "closed"
}
}
]
},
{
"type": "terminals",
"status": "unsuccess",
"errors": [
{
"name": "offline terminal",
"info": {
"terminalId": "590206e1643fef34001fv243",
"terminalNumber": "2",
"terminalTitle": "Terminal 2",
"status": "offline"
}
},
{
"name": "incorrect business date",
"info": {
"terminalId": "140256e1643r342323114351",
"terminalNumber": "3",
"terminalTitle": "Terminal 3",
"businessDate": "2022-03-31T00:00:00.000Z",
"status": "online"
}
}
]
},
{
"type": "deposits",
"status": "unsuccess",
"errors": [
{
"name": "undeposited cash pull",
"info": {
"cashPullId": "19cc1095-256a-4653-b529-e74239150d5e",
"businessDate": "2022-03-31T00:00:00.000Z"
}
},
{
"name": "undeposited drawer",
"info": {
"drawerId": "fabf27f1-c34d-4c5f-8680-7cd3bfe924e8",
"businessDate": "2022-03-31T00:00:00.000Z",
"status": "counted"
}
}
]
},
{
"type": "employee_shifts",
"status": "success",
"errors": []
}
]errors Array
Field Name | Type | Description |
|---|---|---|
| string | The error name |
| object | Additional information about the error. It has a different set of fields based on the parent entity. See the tables below for additional information. |
info Object Drawers Step
Field Name | Type | Description |
|---|---|---|
| string | The unique identifier (UID) of the drawer session |
| string | The drawer session's business date in the UTC ISO8601 Format |
| string | The drawer's sessions status. The available statuses are as follows:
|
info Object Terminals Step
Field Name | Type | Description |
|---|---|---|
| string | The unique identifier (UID) of the terminal from which the workflow was initiated, which is an internal UID for our system in the database |
| string | The readable identifier of the terminal that is configured in Data Management |
| string | The readable name of the terminal that is configured in Data Management |
| string | The terminal status. The available statuses are as follows:
|
| string | The terminal business date. NoteThis field is empty for offline terminals. |
info Object Deposits Step
Field Name | Type | Description |
|---|---|---|
| string | The cash pull event unique identifier (UID) |
| string | The cash pull session's business date in UTC ISO8601 Format |