Dirmeier's REST API for Cash Interface provides a contemporary way to communicate between a cash register and Dirmeier's dispensing equipment. It lifts all known methods from the outdated serial communication to an HTTP/REST API, improving the process. No special equipment like serial cables and cash registers with COM-Ports are needed.
{
"type": "object",
"properties": {
"ID": { "type": "number" },
"Waiter": { "type": "number" },
"PLU": { "type": "number" },
"Count": { "type": "number" },
"Table": { "type": "number" },
"Place": { "type": "number" },
"ArticleName" : { "type": "string" },
"StationID": { "type": "number" },
"CustomerID": { "type": "number" }
}
"required": ["ID", "Waiter", "PLU", "Count"]
// Note: For PUT requests, ID is passed separately as a URL parameter
}
Example:
{
"Waiter": 1,
"PLU": 101,
"Count": 1
}
// Note: ID is passed separately as a URL parameter, (not shown here)
{
"type": "object",
"properties": {
"Credits": {
"type": "array",
"items": { "$ref": "#/components/schemas/Credit" }
}
}
}
Example:
{
"Credits": [
{
"ID": 11696861732318,
"Waiter": 2,
"PLU": 103,
"Table": 3,
"Place": 4,
"StationID": -1,
"CustomerID": "5",
"Count": 2
},
{
"ID": 11696861732319,
"Waiter": 1,
"PLU": 103,
"Table": 1,
"Place": 1,
"StationID": -1,
"CustomerID": "3",
"Count": 2
}
]
}
{
"type": "object",
"properties": {
"ID": { "type": "number" },
"Waiter": { "type": "number" },
"PLU": { "type": "number" },
"Place": { "type": "number" },
"Table": { "type": "number" },
"Price": { "type": "number" },
"Articlename": { "type": "string" },
"Amount": { "type": "number" },
"Count": { "type": "number" }
}
}
Example:
{
"ID": 10820,
"Waiter": 1,
"PLU": 201,
"Place": 0,
"Table": 5,
"Price": 0,
"Articlename": "Bt",
"Amount": 0,
"Count": 1
}
{
"type": "object",
"properties": {
"Debits": {
"type": "array",
"items": { "$ref": "#/components/schemas/Debit" }
}
}
}
Example:
{
"Debits": [
{
"ID": 10820,
"Waiter": 1,
"PLU": 201,
"Place": 0,
"Table": 5,
"Price": 0,
"Articlename": "Cola",
"Amount": 0,
"Count": 1
},
{
"ID": 10821,
"Waiter": 1,
"PLU": 201,
"Place": 0,
"Table": 5,
"Price": 0,
"Articlename": "Cola",
"Amount": 0,
"Count": 1
}
]
}
200 OK: List of credits (Example: single credit or multiple credits)410 Gone: No content available503 Service Unavailable: Service is paused (e.g., during Configuration Mode)201 Created: Resource created successfully200 OK: Credit information for the specified ID503 Service Unavailable: Service is paused (e.g., during Configuration Mode)200 OK: Credit deleted successfully410 Gone: Credit is no longer available or has already been used503 Service Unavailable: Service is paused (e.g., during Configuration Mode)200 OK: Credit updated successfully202 Accepted: Service is paused, data received but processed later400 Bad Request: Invalid request404 Not Found: Credit not found200 OK: List of debits410 Gone: No content available503 Service Unavailable: Service is paused (e.g., during Configuration Mode)200 OK: Debits deleted successfully410 Gone: Debits are no longer available200 OK: Debit information for the specified ID410 Gone: Debit is no longer available503 Service Unavailable: Service is paused (e.g., during Configuration Mode)200 OK: Debit deleted successfully410 Gone: Debit is no longer availableCreating an Empty Credit:
POST /credits HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Content-Type: application/json
Response:
HTTP/1.1 201 Created
Location: /credits/11667928260823
Updating the Created Credit:
PUT /credits/11667928260823 HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Content-Type: application/json
{
"Waiter": 3,
"PLU": 103,
"Count": 3
}
Response:
HTTP/1.1 200 OK
Creating an Empty Credit for Cancellation:
POST /credits HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Content-Type: application/json
Response:
HTTP/1.1 201 Created
Location: /credits/11667928260824
Cancelling the Credit with Negative Count:
PUT /credits/11667928260824 HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Content-Type: application/json
{
"Waiter": 4,
"PLU": 104,
"Count": -2
}
Response:
HTTP/1.1 200 OK
Fetching List of Debits:
GET /debits HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"Debits": [
{
"ID": 18652,
"Waiter": 2,
"PLU": 13,
"Place": 0,
"Table": 802,
"Price": 310.00,
"Articlename": "Cola 1/2",
"Amount": 550,
"Count": 1
},
{
"ID": 18653,
"Waiter": 2,
"PLU": 19,
"Place": 0,
"Table": 802,
"Price": 0.00,
"Articlename": "Orangenlimo 1/4",
"Amount": 25,
"Count": 1
},
{
"ID": 18654,
"Waiter": 2,
"PLU": 19,
"Place": 0,
"Table": 802,
"Price": 0.00,
"Articlename": "Orangenlimo 1/4",
"Amount": 25,
"Count": 1
}
]
}
Deleting a Specific Debit:
DELETE /debits/18652 HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Response:
HTTP/1.1 200 OK
Deleting Multiple Debits:
DELETE /debits HTTP/1.1
Host: http://192.168.2.39/cash/1.0
Content-Type: application/json
{
"Debits": [
{
"ID": 18653,
"Waiter": 2,
"PLU": 19,
"Place": 0,
"Table": 802,
"Price": 0.00,
"Articlename": "Orangenlimo 1/4",
"Amount": 25,
"Count": 1
},
{
"ID": 18654,
"Waiter": 2,
"PLU": 19,
"Place": 0,
"Table": 802,
"Price": 0.00,
"Articlename": "Orangenlimo 1/4",
"Amount": 25,
"Count": 1
}
]
}
Response:
HTTP/1.1 200 OK