๐๏ธ OrdersThis 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 Pagination property. Describing number of records to skip from beginning of result collection.
Pagination property. Maximum count of items to be returned.
Comma separated list of property names. Please see NData syntax.
If set to true
, response will not contain items
collection. Use to get resource count, not the resources themselves.
Name Type Description Authorization header with authorization token.
200: OK Successful response
Copy {
"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 Authorization header with authorization token.
200: OK Resource found. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nรกjdenรฝ" ,
"status" : 404
}
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.
Name Type Description Authorization header with authorization token.
Request Body
Name Type Description Conext to specify order processing.
202: Accepted Order processing is accepted and may continue after API response is sent to caller.
Copy [
{
"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 Authorization header with authorization token.
Request Body
200: OK Order status updated.
Copy {
"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 Authorization header with authorization token.
Request Body
200: OK Order item status updated.
Copy {
"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 Authorization header with authorization token.
Request Body
200: OK Order endpoint status updated.
Copy {
"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 Authorization header with authorization token.
200: OK Successfuly deleted. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nรกjdenรฝ" ,
"status" : 404
}