πŸ›ŽοΈOrders

This page provides a description of the available API routes for managing orders.

After each ticket update, orders are automatically generated. Each order includes contextual information about the products and specifies the order endpoint where the products will be processed.

Order is represented by Order class.

API methods

Get orders

GET http://{server-address}/orders

Returns all orders that matches query parameters. Result is of type QueryResult<Order>.

Query Parameters

Name
Type
Description

deviceName

string

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

id

string

Supports NData syntax.

number

int

Supports NData syntax.

ticketId

string

Supports NData syntax.

ticketName

string

Supports NData syntax.

userUserName

string

Supports NData syntax.

isProcessed

bool

Supports NData syntax.

isProcessable

bool

Supports NData syntax.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "id": "64b70e39fa08b1c38bfc5c56",
            "number": 2,
            "deviceName": "PDA1",
            "user":
            {
                "name": "Cashier",
                "userName": "999",
                "featureName": null
            },
            "ticket":
            {
                "id": "64b70d71fa08b1c38bfc5c55",
                "name": "G-01-01",
                "location":
                {
                    "zoneName": "Garden",
                    "tableName": "G-01"
                },
                "purchaseType": "WalkIn",
                "customer": null,
                "version": 2
            },
            "items":
            [
                {
                    "id": 1,
                    "plu":
                    {
                        "name": "Pilsner",
                        "code": 405,
                        "stockName": "S01"
                    },
                    "quantity":
                    {
                        "amount": 2.0,
                        "unit": "ks"
                    },
                    "comment": null,
                    "endpoints":
                    [
                        {
                            "name": "Bar",
                            "statusChanges":
                            [
                                {
                                    "status": "Created",
                                    "date": "2023-07-18T13:12:09.344Z"
                                },
                                {
                                    "status": "Processed",
                                    "date": "2023-07-18T13:12:09.706Z"
                                }
                            ],
                            "orderItemStatus": "Processed",
                            "isProcessed": true,
                            "isProcessable": false
                        }
                    ],
                    "courseNumber": null,
                    "isProcessable": false,
                    "isProcessed": true
                },
                {
                    "id": 2,
                    "plu":
                    {
                        "name": "Chicken wings",
                        "code": 172,
                        "stockName": "S01"
                    },
                    "quantity":
                    {
                        "amount": 1.0,
                        "unit": "ks"
                    },
                    "comment": "Extra spicy, please!",
                    "endpoints":
                    [
                        {
                            "name": "Kitchen",
                            "statusChanges":
                            [
                                {
                                    "status": "Created",
                                    "date": "2023-07-18T13:12:09.346Z"
                                },
                                {
                                    "status": "Processed",
                                    "date": "2023-07-18T13:12:09.706Z"
                                }
                            ],
                            "orderItemStatus": "Processed",
                            "isProcessed": true,
                            "isProcessable": false
                        }
                    ],
                    "courseNumber": null,
                    "isProcessable": false,
                    "isProcessed": true
                }
            ],
            "isProcessed": true,
            "isProcessable": false
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get order

GET http://{server-address}/orders/{id}

Result is of type Order.

Path Parameters

Name
Type
Description

id*

string

Unique order identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64b70e39fa08b1c38bfc5c56",
    "number": 2,
    "deviceName": "PDA1",
    "user":
    {
        "name": "Cashier",
        "userName": "999",
        "featureName": null
    },
    "ticket":
    {
        "id": "64b70d71fa08b1c38bfc5c55",
        "name": "G-01-01",
        "location":
        {
            "zoneName": "Garden",
            "tableName": "G-01"
        },
        "purchaseType": "WalkIn",
        "customer": null,
        "version": 2
    },
    "items":
    [
        {
            "id": 1,
            "plu":
            {
                "name": "Pilsner",
                "code": 405,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 2.0,
                "unit": "ks"
            },
            "comment": null,
            "endpoints":
            [
                {
                    "name": "Bar",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.344Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        },
        {
            "id": 2,
            "plu":
            {
                "name": "Chicken wings",
                "code": 172,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 1.0,
                "unit": "ks"
            },
            "comment": "Extra spicy, please!",
            "endpoints":
            [
                {
                    "name": "Kitchen",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.346Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        }
    ],
    "isProcessed": true,
    "isProcessable": false
}

Process order

POST http://{server-address}/orders

Invokes order processing. Method accepts ProcessOrdersContext in request body, that is used to specify orders to be processed, using Ticket identifiers. Collection of all affected Order models is returned.

Required rights

Authorized user must have OrderProcess right assigned.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

ProcessOrdersContext

Conext to specify order processing.

[
    {
        "id": "64b70e39fa08b1c38bfc5c56",
        "number": 2,
        "deviceName": "PDA1",
        "user":
        {
            "name": "Cashier",
            "userName": "999",
            "featureName": null
        },
        "ticket":
        {
            "id": "64b70d71fa08b1c38bfc5c55",
            "name": "G-01-01",
            "location":
            {
                "zoneName": "Garden",
                "tableName": "G-01"
            },
            "purchaseType": "WalkIn",
            "customer": null,
            "version": 2
        },
        "items":
        [
            {
                "id": 1,
                "plu":
                {
                    "name": "Pilsner",
                    "code": 405,
                    "stockName": "S01"
                },
                "quantity":
                {
                    "amount": 2.0,
                    "unit": "ks"
                },
                "comment": null,
                "endpoints":
                [
                    {
                        "name": "Bar",
                        "statusChanges":
                        [
                            {
                                "status": "Created",
                                "date": "2023-07-18T13:12:09.344Z"
                            },
                            {
                                "status": "Processed",
                                "date": "2023-07-18T13:12:09.706Z"
                            }
                        ],
                        "orderItemStatus": "Processed",
                        "isProcessed": true,
                        "isProcessable": false
                    }
                ],
                "courseNumber": null,
                "isProcessable": false,
                "isProcessed": true
            },
            {
                "id": 2,
                "plu":
                {
                    "name": "Chicken wings",
                    "code": 172,
                    "stockName": "S01"
                },
                "quantity":
                {
                    "amount": 1.0,
                    "unit": "ks"
                },
                "comment": "Extra spicy, please!",
                "endpoints":
                [
                    {
                        "name": "Kitchen",
                        "statusChanges":
                        [
                            {
                                "status": "Created",
                                "date": "2023-07-18T13:12:09.346Z"
                            },
                            {
                                "status": "Processed",
                                "date": "2023-07-18T13:12:09.706Z"
                            }
                        ],
                        "orderItemStatus": "Processed",
                        "isProcessed": true,
                        "isProcessable": false
                    }
                ],
                "courseNumber": null,
                "isProcessable": false,
                "isProcessed": true
            }
        ],
        "isProcessed": true,
        "isProcessable": false
    }
]

Set order status

POST http://{server-address}/orders/{id}/status

Manually changes status for entire order (for all items and all associated order endpoints). Method accepts OrderStatusContext in request body. Updated Order is returned.

Required rights

Authorized user must have OrderUpdate right assigned.

Path Parameters

Name
Type
Description

id*

string

Order unique identifier

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

OrderStatusContext

{
    "id": "64b70e39fa08b1c38bfc5c56",
    "number": 2,
    "deviceName": "PDA1",
    "user":
    {
        "name": "Cashier",
        "userName": "999",
        "featureName": null
    },
    "ticket":
    {
        "id": "64b70d71fa08b1c38bfc5c55",
        "name": "G-01-01",
        "location":
        {
            "zoneName": "Garden",
            "tableName": "G-01"
        },
        "purchaseType": "WalkIn",
        "customer": null,
        "version": 2
    },
    "items":
    [
        {
            "id": 1,
            "plu":
            {
                "name": "Pilsner",
                "code": 405,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 2.0,
                "unit": "ks"
            },
            "comment": null,
            "endpoints":
            [
                {
                    "name": "Bar",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.344Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        },
        {
            "id": 2,
            "plu":
            {
                "name": "Chicken wings",
                "code": 172,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 1.0,
                "unit": "ks"
            },
            "comment": "Extra spicy, please!",
            "endpoints":
            [
                {
                    "name": "Kitchen",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.346Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        }
    ],
    "isProcessed": true,
    "isProcessable": false
}

Set order item status

POST http://{server-address}/orders/{id}/items/{itemId}/status

Manually changes order status for specified order item. Status is set for all order endpoints associated with given order item. Method accepts OrderStatusContext in request body. Updated Order is returned.

Required rights

Authorized user must have OrderUpdate right assigned.

Path Parameters

Name
Type
Description

id*

string

Order unique identifier

itemId*

int

Order item identifier

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)

OrderStatusContext

{
    "id": "64b70e39fa08b1c38bfc5c56",
    "number": 2,
    "deviceName": "PDA1",
    "user":
    {
        "name": "Cashier",
        "userName": "999",
        "featureName": null
    },
    "ticket":
    {
        "id": "64b70d71fa08b1c38bfc5c55",
        "name": "G-01-01",
        "location":
        {
            "zoneName": "Garden",
            "tableName": "G-01"
        },
        "purchaseType": "WalkIn",
        "customer": null,
        "version": 2
    },
    "items":
    [
        {
            "id": 1,
            "plu":
            {
                "name": "Pilsner",
                "code": 405,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 2.0,
                "unit": "ks"
            },
            "comment": null,
            "endpoints":
            [
                {
                    "name": "Bar",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.344Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        },
        {
            "id": 2,
            "plu":
            {
                "name": "Chicken wings",
                "code": 172,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 1.0,
                "unit": "ks"
            },
            "comment": "Extra spicy, please!",
            "endpoints":
            [
                {
                    "name": "Kitchen",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.346Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        }
    ],
    "isProcessed": true,
    "isProcessable": false
}

Set order endpoint status

POST http://{server-address}/orders/{id}/endpoints/{endpointName}/status

Manually change the order status for a specified order item on a specific order endpoint. Method accepts OrderStatusContext in request body. Updated Order is returned.

Required rights

Authorized user must have OrderUpdate right assigned.

Path Parameters

Name
Type
Description

id*

string

Order unique identifier

endpointName*

string

Order endpoint name

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)

OrderStatusContext

{
    "id": "64b70e39fa08b1c38bfc5c56",
    "number": 2,
    "deviceName": "PDA1",
    "user":
    {
        "name": "Cashier",
        "userName": "999",
        "featureName": null
    },
    "ticket":
    {
        "id": "64b70d71fa08b1c38bfc5c55",
        "name": "G-01-01",
        "location":
        {
            "zoneName": "Garden",
            "tableName": "G-01"
        },
        "purchaseType": "WalkIn",
        "customer": null,
        "version": 2
    },
    "items":
    [
        {
            "id": 1,
            "plu":
            {
                "name": "Pilsner",
                "code": 405,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 2.0,
                "unit": "ks"
            },
            "comment": null,
            "endpoints":
            [
                {
                    "name": "Bar",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.344Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        },
        {
            "id": 2,
            "plu":
            {
                "name": "Chicken wings",
                "code": 172,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 1.0,
                "unit": "ks"
            },
            "comment": "Extra spicy, please!",
            "endpoints":
            [
                {
                    "name": "Kitchen",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.346Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        }
    ],
    "isProcessed": true,
    "isProcessable": false
}

Delete order

DELETE http://{server-address}/orders/{id}

Required rights

Authorized user must have OrderDelete right assigned.

Path Parameters

Name
Type
Description

id*

string

Unique order identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64b70e39fa08b1c38bfc5c56",
    "number": 2,
    "deviceName": "PDA1",
    "user":
    {
        "name": "Cashier",
        "userName": "999",
        "featureName": null
    },
    "ticket":
    {
        "id": "64b70d71fa08b1c38bfc5c55",
        "name": "G-01-01",
        "location":
        {
            "zoneName": "Garden",
            "tableName": "G-01"
        },
        "purchaseType": "WalkIn",
        "customer": null,
        "version": 2
    },
    "items":
    [
        {
            "id": 1,
            "plu":
            {
                "name": "Pilsner",
                "code": 405,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 2.0,
                "unit": "ks"
            },
            "comment": null,
            "endpoints":
            [
                {
                    "name": "Bar",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.344Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        },
        {
            "id": 2,
            "plu":
            {
                "name": "Chicken wings",
                "code": 172,
                "stockName": "S01"
            },
            "quantity":
            {
                "amount": 1.0,
                "unit": "ks"
            },
            "comment": "Extra spicy, please!",
            "endpoints":
            [
                {
                    "name": "Kitchen",
                    "statusChanges":
                    [
                        {
                            "status": "Created",
                            "date": "2023-07-18T13:12:09.346Z"
                        },
                        {
                            "status": "Processed",
                            "date": "2023-07-18T13:12:09.706Z"
                        }
                    ],
                    "orderItemStatus": "Processed",
                    "isProcessed": true,
                    "isProcessable": false
                }
            ],
            "courseNumber": null,
            "isProcessable": false,
            "isProcessed": true
        }
    ],
    "isProcessed": true,
    "isProcessable": false
}

Last updated