Orders
Introduction
This page describes API for delivering orders directly to POS. Everyone in the restaurant uses POS and accepting orders and their lifecycle should be as easy as pressing an accept button. Menu should be automatically synchronized so no need to fill the menu manually.
In order to make it work we need to make following steps. We recomend to implement in this order too :).
- Contact tech-support at techsupport@qerko.com so we can toggle the ordering feature in Restaurant Admin
- Menu synchronization
- Orders and their lifecycle
Menu synchronization
The job is clear. We need to make sure, that Qerko has the correct and up-to-date menu. Qerko shows it in mobile app to the customers who make orders. Qerko also caches menu to minimize performance requirements on the POS side.
Synchronization may be started by both sides:
- Qerko starts the synchronization by calling getMealMenus() method
- POS starts the synchronization by calling updateMenus() method
POS should sync whenever there is important change to the menu. For example when a meal becomes out-of-stock, new meal is added to the menu or an existing meal is removed from the menu.
Qerko syncs menu when we encounter certain errors in orderStart() method or orderPrepare() method. See Error codes of orderPrepare() method. Or after a while. Currently every 2 minutes, but only if there is a customer asking for the menu. The TTL of the cached menu will most probably change in the near futurue. We want to maximize it to minimize asking POS for menu.
Because it is only one-way synchronization (from POS to Qerko), no other steps are needed.
Orders and their lifecycle
Order is submited by a customer. He picks his meal from the menu and submits it. The customer can be sitting in the restaurant and he wants just another beer (delivery toBill
/toTable
) or he can be sitting in his livingroom and wants to pickup the order later (delivery byCustomer
) or he wants the order to be delivered to him (delivery byOperator
).
Delivery byOperator
is not ready yet. If you want to use it, please contact Qerko.
- orderPrepare() method is called. This method can change the order and/or offer additional discounts/upsells. When the customer decides to accept upsell or changes items by any other way then orderPrepare() method is called again.
- orderStart() method is called. This method submits the order to the POS. The order won’t change any more. It can be accepted or rejected. POS returns the state in which the order will be afterwards.
- Optionally orderMarkAsPaid() method is called. This method is called to announce that the customer has paid the order in advance. Standard Qerko payment is passed to this method.
- orderClose() method is called. This method is called when the order process is finished.
(Methods orderPrepare() method, orderMarkAsPaid() method, orderClose() method are analogous to the basic payment methods paymentStart, paymentProcessed, paymentClose.)
The order has a status which represents the current phase of the order:
OrderWaiting
- The order is waiting for restaurant personel to accept it. POS should show a dialog where the personel can accept the order.OrderPreparing
- The order is accepted and the cook is working on it.ReadyForPickUp
- The cook has finished his job and the order is waiting for the customer/operator to pick it up. Relevant for deliveries:byCustomer
,byOperator
Completed
- The order is completed and picked up/sentCancelled
- The order is cancelled
When the status changes POS should call updateQerkoOrderStatus() method. No need to support all statuses. Qerko won’t change the status itself. POS is always changing the status. Technically it is possible to switch status from any to any other status. The only limitation is Cancelled
status. The order remains Cancelled
no matter what. Switching the order to Cancelled
also returns money to the customer.
Methods
Method signatures use TypeScript syntax for documentation purposes.
POS Methods
Below is a list of methods which can be called by Qerko. POS must implement these methods.
All of these methods supports error code ERROR_MESSAGE
which shows returned error message to the customer. But try to use specific error codes where possible.
getMealMenus()
getMealMenus(): MealMenus
Qerko calls this method when it needs to get fresh menu from the POS. POS should respond with up-to-date menu. This method accepts no arguments.
This method returns MealMenus structure which should contain up-to-date menu.
Example
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "getMealMenus",
"args": []
}
/** Method call response (sent by POS) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "getMealMenus",
"result": {
"menus": [{
"id": "the-menu",
"currency": "CZK",
"deliveryTypes": [ "toTable", "toBill" ],
"categories": [
{
"id": "category-1",
"name": "Daily offer",
"description": "Meals served from 11 AM to 3 PM.",
"orderableTimeSlots": [{
"startTime": "11:00:00",
"endTime": "15:00:00"
}],
"items": [
{
"id": "item-1",
"name": "Vegetable soup",
"description": "Boiled potatoes and a few more ingredients.",
"price": "45",
"inStock": true,
"modifiers": [],
"type": "sale"
}, {
"id": "item-2",
"name": "T-bone steak",
"description": "Slice of cow's leg with the bone \"eye\" inside.",
"price": "145",
"inStock": true,
"modifiers": [
{
"id": "ab4a054a-5a0a-48fe-947b-f5c23a566bbe",
"minSelected": 1,
"maxSelected": 1,
"maxCount": 1,
"name": "Steak Doneness",
"options": [
{
"id": "b7055208-0827-4eca-8542-bd6d3b99252a",
"menuItemId": "rare",
"defaultSelected": 0,
"addPrice": "0",
"maxCount": 1
},
{
"id": "92d8519f-4cba-4c45-a8fb-989200d50d54",
"menuItemId": "medium",
"defaultSelected": 1,
"addPrice": "0",
"maxCount": 1
}
]
}
],
"type": "sale"
}
]
},{
"id": "category-2",
"name": "Drinks",
"description": "Drinks served all the time.",
"items": [
{
"id": "item-3",
"name": "Coca-Cola",
"description": "We all know it. Ice-cold black sweet drink with bubbles.",
"price": "45",
"inStock": true,
"modifiers": [],
"type": "sale"
}, {
"id": "item-4",
"name": "Beer",
"description": "Czech classic beer from Pilsen.",
"price": "45",
"inStock": true,
"modifiers": [],
"type": "sale"
}
]
},
{
"id": "modifiers",
"name": "modifiers",
"description": "This catogory is for modifier items and won't be showed in application",
"items": [
{
"id": "medium",
"name": "Medium",
"description": "This item will be hidden in application",
"price": "45",
"inStock": true,
"modifiers": [],
"type": "modifier"
},
{
"id": "rare",
"name": "Rare",
"description": "This item will be hidden in application",
"price": "45",
"inStock": true,
"modifiers": [],
"type": "modifier"
}
]
}
],
"minOrderTime": 0,
"maxOrderTime": 0
}],
"deliveryInfos": [
{
"type": "byOperator",
"paused": false
},
{
"type": "byCustomer",
"paused": false,
},
{
"type": "toTable",
"paused": false
},
{
"type": "toBill",
"paused": false,
},
],
}
}
orderPrepare()
orderPrepare(args: object): object
Qerko calls this method as a first step of the order. The order is not submitted by the customer yet, but he has reached a summary before the final submission. This is the moment where he might want to apply a discount, accept an upsell offer, etc. POS can pre-validate the order and offer upsell and/or discounts.
This method can be called multiple times for one order.
Offering discounts and upsells is not ready in this moment. Please contact Qerko if you want to use this feature.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | No | string length: 1 - 128 | ID of the order which might be assigned in the previous call. |
customerId | No | null / string length: 1 - 128 | ID of the customer. It is not required because the customer might not be logged in yet. |
orderDelivery | Yes | OrderDeliveryToTable, OrderDeliveryToBill, OrderDeliveryByCustomer, OrderDeliveryByOperator | Structure with details regarding the order delivery. See the specific type for details. Eg: { "deliveryType": "toBill", "billId": "xyz" } |
items | Yes | OrderItem[] items: 1 - 256 | Ordered items. Eg: [{ "mealId": "m2c1i1001" }] |
Returns:
Parameter | Required | Type | Description |
---|---|---|---|
orderId | No | string length: 1 - 128 | POS can set this to an identifier and Qerko will pass it to next call of this method or to orderStart method. |
orderDelivery | Yes | OrderDeliveryToTable OrderDeliveryToBill OrderDeliveryByCustomer OrderDeliveryByOperator | Structure with details regarding the order delivery. See the specific type for details. Eg: { "deliveryType": "toBill", "billId": "xyz" } |
allowTip | No | boolean | Can the customer add a tip? Default: true |
denyDiscounts | No | boolean | Whether Qerko can apply another discount. Set it to TRUE when there already is an internally applied discount by POS and other discounts are unwanted. This is related to discounts provided by restaurant owners only. Discounts paid by Qerko or third parties (sponsors like breweries) aren’t affected by this property. FALSE ‒ Qerko can apply a discount. TRUE ‒ Qerko can’t apply a discount. Default: false |
TIP: You can just return unchanged input.
Error codes
-
ITEM_NOT_AVAILABLE
- POS returns this error if the ordered item is unavailable.
- Qerko announces that an item is not availible any more and suggests to the custommer to make a new order.
- Qerko tries to update the menu.
-
INVALID_ITEM_PRICE
- POS returns this error if the ordered item has different price.
- Qerko announces that prices have been changed and suggests to the custommer to make a new order.
- Qerko tries to update the menu.
-
BILL_LOCKED
- POS returns this error if bill is locked (toBill).
- Qerko announces that there is a waiter operating with the bill right now and suggest to the customer to try the order afterwards.
-
BILL_NOT_FOUND
- POS returns this error if the bill with this id does not exist (toBill).
- Qerko announces that there is a waiter operating with the bill right now and suggest to the customer to try the order afterwards.
-
TABLE_NOT_FOUND
- POS returns this error if the table does not exist (toTable).
- Qerko announces that the table doesn’t exist any more and suggests to the custommer to make a new order.
-
BILL_CLOSED
- POS returns this error if the bill is closed. (toBill).
- Qerko announces that the bill was closed and it is not possible to make an order to this bill.
Example
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "orderPrepare",
"args": [{
"orderId": "id-order-124",
"items": [
{ "mealId": "m2c1i1001" }
],
"orderDelivery": {
"deliveryType": "toBill",
"billId": "xyz"
}
}]
}
/** Method call response (sent by POS) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "orderPrepare",
"result": {
"orderId": "id-order-124",
"items": [
{ "mealId": "m2c1i1001" }
],
"orderDelivery": {
"deliveryType": "toBill",
"billId": "xyz"
}
}
}
orderStart()
orderStart(args: object): object
Qerko calls this method as a second step of an order. The customer has just submitted the order. The order won’t change any more except its status. POS should validate it in this step. POS returns orders and their lifecycle status. Suggested statuses are OrderWaiting
, or OrderPreparing
.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | No | string length: 1 - 128 | ID of the order which might be assigned in the previous orderPrepare(). |
customerId | Yes | string length: 1 - 128 | ID of the customer. |
calculatedPrice | Yes | string regexp: ^\d{1,6}(?:\.\d{1,3})?$ length: 1 - 10 | Calculated price for items. Eg: “129.66” |
orderDelivery | Yes | OrderDeliveryToTable OrderDeliveryToBill OrderDeliveryByCustomer OrderDeliveryByOperator | Structure with details regarding the order delivery. See the specific type for details. Eg: { "deliveryType": "toBill", "billId": "xyz" } |
items | Yes | OrderItem[] items: 1 - 256 | Ordered items. Eg: [{ "mealId": "m2c1i1001" }] |
orderDateTime | Yes | string length: 1 - 25 | Marks the time the order has been placed in the Qerko app in the following format: 'yyyy-mm-ddTHH:MM:SS+HH:MM' Eg: "2022-03-21T14:41:50+01:00" |
Returns:
Parameter | Required | Type | Description |
---|---|---|---|
orderId | Yes | string length: 1- 128 | Identifier of the created order. |
billId | No | string length: 1- 128 | Required for delivery type toTable. It is the identifier of the created bill to which ordered items were added. This ID must match the ID returned in getTableContents |
orderReference | No | string length: 1- 128 | Could be used as code for pickup for delivery type byCustomer or byOperator |
status | Yes | string | One of - OrderWaiting - OrderPreparing - ReadyForPickUp - Completed - Cancelled See Orders and their lifecycle section for details. |
Error codes
The same as in orderPrepare method.
Example
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "orderStart",
"args": [{
"calculatedPrice": "129.34",
"items": [
{ "mealId": "m2c1i1001" }calculatedPrice
],
"orderDelivery": {
"deliveryType": "toBill",
"billId": "xyz"
}
}]
}
/** Method call response (sent by POS) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "orderStart",
"result": {
"orderId": "id-order-124",
"status": "OrderWaiting"
}
}
orderMarkAsPaid()
orderMarkAsPaid(args: Payment): Receipt
Qerko calls this method as an optional third step of an order. This method marks the order as paid. It receives the Payment object with a few modifications - orderId
is used instead of idBill
and the items
property contains an array of Order items instead of BillItems. It returns a Receipt. Analogous to the paymentProcessed method. Method is by default called for orders with delivery type byCustomer, but our experience shows that there is strong demand for orders with delivery type toTable that are paid in advance.
The payment always pays for the whole order. Never only part of it.
Any error cancels the order.
If you wish to integrate and test this method, contact techsupport at techsupport@qerko.com.
orderClose()
orderClose(args: object): null
Qerko calls this method is as a final step of an order. Error in this method won’t cancel the order. Analogous to the paymentClose method in payments.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | Yes | string length: 1 - 128 | ID of the order which was assigned in paymentStart() method. |
status | Yes | string | One of: OK - Success the order was successfuly ordered, Cancelled - Something went wrong. The order is cancelled. |
Example
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "orderClose",
"args": [{
"orderId": "id-order-124",
"status": "OK"
}]
}
/** Method call response (sent by POS) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "orderClose",
"result": null
}
orderStatus()
orderStatus(args: object): object
Qerko calls this method when it need to check the order status on the POS side.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | Yes | string length: 1 - 128 | ID of the order status of which should be returned. |
Returns:
Parameter | Required | Type | Description |
---|---|---|---|
status | Yes | string | Onde of: - OrderWaiting - OrderPreparing - ReadyForPickUp - Completed - Cancelled See Orders and their lifecycle section for details |
Example
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "orderStatus",
"args": [{
"orderId": "123"
}]
}
/** Method call response (sent by POS) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "orderStatus",
"result": {
"status": "OrderWaiting"
}
}
getResource()
getResource(args: object): object | null
Qerko calls this method to get resource from the POS. Eg.: images. This method receives a string idResource
which was sent in MenuItem .images
array. This method returns a structure, which contains mime-type and the data of the resource. POS can also return null
if there is no resource avaialable.
Qerko can download all resources immediately after menu sync or any time after.
Qerko wil cache the resource. If you want to update the resource send another idResource
.
Parameter | Required | Type | Description |
---|---|---|---|
idResource | Yes | string length: 1 - 128 | String idResource which was sent in MenuItem.images array. |
Returns
Parameter | Required | Type | Description |
---|---|---|---|
mime | Yes | string | One of: image/png - PNG format. image/jpeg - JPEG format. |
data | Yes | string length: 0 - 1000000 | Base64 encoded data. Size of the image in B64 encoding is 1MB (1000000 bytes). It means max file size 750kB (750000 bytes) using B64 encoding, without padding and line ends. |
Example with resource
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "getResource",
"args": [{
"idResource": "C:\\POS\\images\\the-product.jpg::lastMod=1234567890"
}]
}
/** Method call response (sent by POS) */1000000
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "getResource",
"result": {
"mime": "image/jpeg",
"data": " ... JPEG data in Base64 ..."
}
}
Example with no resource available
/** Method call request (sent by Qerko) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "getResource",
"args": [{
"idResource": "C:\\POS\\images\\the-product.jpg::lastMod=1234567890"
}]
}
/** Method call response (sent by POS) */1000000
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "getResource",
"result": null
}
Qerko Methods
Below is a list of methods which can be called by POS using websocket or REST endpoint. Qerko implements them.
updateMenus()
updateMenus(menus: MealMenus): null
POS calls this method and passes MealMenus structure to perform synchronization of menu whenever there is an important change in the menu. It accepts the same structure as is returned by getMealMenus() method.
Example
Websocket
/** Method call request (sent by POS) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "updateMenus",
"args": [{
"menus": [{
"id": "the-menu",
"lang": "cs",
"currency": "CZK",
"deliveryTypes": [ "toTable", "toBill" ],
"categories": [
{
"id": "category-1",
"name": "Daily offer",
"description": "Meals served from 11 AM to 3 PM.",
"orderableTimeSlots": [{
"startTime": "11:00:00",
"endTime": "15:00:00"
}],
"items": [
{
"id": "item-1",
"name": "Vegetable soup",
"description": "Boiled potatoes and a few more ingredients.",
"price": "45",
"tagIds": [ "tag-1", "tag-2" ],
"inStock": true
}, {
"id": "item-2",
"name": "T-bone steak",
"description": "Slice of cow's leg with the bone \"eye\" inside.",
"price": "145",
"inStock": true
}
]
},{
"id": "category-2",
"name": "Drinks",
"description": "Drinks served all the time.",
"items": [
{
"id": "item-3",
"name": "Coca-Cola",
"description": "We all know it. Ice-cold black sweet drink with bubbles.",
"price": "45",
"inStock": true
}, {
"id": "item-4",
"name": "Beer",
"description": "Czech classic beer from Pilsen.",
"price": "45",
"inStock": true
}
]
}
],
"minOrderTime": 0,
"maxOrderTime": 0
}],
"deliveryInfos": [
{
"type": "byOperator",
"paused": false
},
{
"type": "byCustomer",
"paused": false,
},
{
"type": "toTable",
"paused": false
},
{
"type": "toBill",
"paused": false,
},
],
}]
}
/** Method call response (sent by Qerko) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "updateMenus",
"result": null
}
Long-polling
Request:
POST /api/v2/pos/update-menus HTTP/1.1
Host: sandbox.qerko.com
Content-Type: application/json
Pos-Id: my-pos-id
Authorization: Bearer foo-bar-api-key
{
"menus": [{
"id": "the-menu",
"lang": "cs",
"currency": "CZK",
"deliveryTypes": [ "toTable", "toBill" ],
"categories": [
{
"id": "category-1",
"name": "Daily offer",
"description": "Meals served from 11 AM to 3 PM.",
"orderableTimeSlots": [{
"startTime": "11:00:00",
"endTime": "15:00:00"
}],
"items": [
{
"id": "item-1",
"name": "Vegetable soup",
"description": "Boiled potatoes and a few more ingredients.",
"price": "45",
"tagIds": [ "tag-1", "tag-2" ],
"inStock": true
}, {
"id": "item-2",
"name": "T-bone steak",
"description": "Slice of cow's leg with the bone \"eye\" inside.",
"price": "145",
"inStock": true
}
]
},{
"id": "category-2",
"name": "Drinks",
"description": "Drinks served all the time.",
"items": [
{
"id": "item-3",
"name": "Coca-Cola",
"description": "We all know it. Ice-cold black sweet drink with bubbles.",
"price": "45",
"inStock": true
}, {
"id": "item-4",
"name": "Beer",
"description": "Czech classic beer from Pilsen.",
"price": "45",
"inStock": true
}
]
}
],
"minOrderTime": 0,
"maxOrderTime": 0
}],
"deliveryInfos": [
{
"type": "byOperator",
"paused": false
},
{
"type": "byCustomer",
"paused": false,
},
{
"type": "toTable",
"paused": false
},
{
"type": "toBill",
"paused": false,
},
],
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{}
updateQerkoOrderStatus()
updateQerkoOrderStatus(args: object): object
POS calls this method to change status of the order. Beware: setting the order to Cancelled
status is irreversible and will return money to the customer.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | Yes | string length: 1 - 128 | ID of the order which was assigned in paymentStart() method. |
status | Yes | string | One of OrderWaiting , OrderPreparing , ReadyForPickUp , Completed , Cancelled . See Orders and their lifecycle section for details. |
collectionDateTime | No | string | When will the order be availible for pickup Eg: "2020-01-30T23:42:42Z" |
Returns:
Parameter | Required | Type | Description |
---|---|---|---|
status | Yes | string | One of OrderWaiting , OrderPreparing , ReadyForPickUp , Completed , Cancelled . See Orders and their lifecycle section for details. |
Example
Websocket
/** Method call request (sent by POS) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "updateQerkoOrderStatus",
"args": [{
"collectionDateTime": "2020-01-30T23:42:42Z",
"orderId": "order-1",
"status": "Completed"
}]
}
/** Method call response (sent by Qerko) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "updateQerkoOrderStatus",
"result": {
"status": "Completed"
}
}
Long-polling
Request:
POST /api/v2/pos/update-qerko-order-status HTTP/1.1
Host: sandbox.qerko.com
Content-Type: application/json
Pos-Id: my-pos-id
Authorization: Bearer foo-bar-api-key
{
"orderId": "the-order-id",
"status": "OrderPreparing",
"collectionDateTime": "2021-05-06T12:22:49Z"
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{ "status":"OrderPreparing" }
getQerkoOrderStatus()
getQerkoOrderStatus(args: object): object
POS calls this method to get a status of the order.
Parameter | Required | Type | Description |
---|---|---|---|
orderId | Yes | string length: 1 - 128 | ID of the order which was assigned in paymentStart() method. |
Returns
Parameter | Required | Type | Description |
---|---|---|---|
status | Yes | string | One of OrderWaiting , OrderPreparing , ReadyForPickUp , Completed , Cancelled . See Orders and their lifecycle section for details. |
paymentStatus | No | string | State of related payment, if the order was marked as paid. One of STARTED , PROCESSING , PAID , CANCELLED , ERROR . |
|
Error Codes
NOT_FOUND
- We couldn’t find specified order. For POS it means that the order is cancelled. Something could go so wrong, that the order is just lost.
Example
Websocket
/** Method call request (sent by POS) */
{
"type": "method-call-request",
"uuid": "call-uuid",
"method": "getQerkoOrderStatus",
"args": [{ "orderId": "order-1" }]
}
/** Method call response (sent by Qerko) */
{
"type": "method-call-response",
"uuid": "call-uuid",
"calledMethod": "getQerkoOrderStatus",
"result": {
"status": "Completed",
"paymentStatus": "PAID"
}
}
Long-polling
Request:
POST /api/v2/pos/get-qerko-order-status HTTP/1.1
Host: sandbox.qerko.com
Content-Type: application/json
Pos-Id: my-pos-id
Authorization: Bearer foo-bar-api-key
{ "orderId": "the-order-id" }
Response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{ "status": "OrderPreparing", "paymentStatus": "PAID" }
Data structures
Follows a list of data structures, which are used for data exchange between POS and Qerko.
DeliveryAddress
This represent delivery address.
Property | Required | Type | Description |
---|---|---|---|
name | Yes | string | John Doe |
phone | Yes | string | +420602341203 |
email | No | string | johndoe@gmail.com_ |
street | Yes | string | Street address |
postcode | Yes | string | Zip-code |
city | Yes | string | City name |
latitude | no | string | 38.8951 |
longitude | no | string | -77.0364 |
OrderItem
This represent order item.
Property | Required | Type | Description |
---|---|---|---|
mealId | Yes | string length: 1 - 128 | Coresponds to menuItem.id . |
modifiers | No | OrderItemModifier[] items: 0 - 256 | Modifiers of the item. Default: [] (empty array) Eg: medium-rare |
price | No | string regexp: ^\d{1,6}(?:\.\d{1,3})?$ length: 0 - 10 | Price of the item without used modifiers. |
OrderItemModifier
This represent modifier in order item.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the modifier. |
selectedOptions | Yes | OrderItemModifierOption[] | Selected options of modifiers. Eg: “raw”, “medium” |
OrderItemModifierOption
This represent option of modifier in order item.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the modifier option. |
item | Yes | OrderItem | OrderItem which is used as modifier |
Category
This represent menu category. Menus are divided into categories which contains menu items.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the category. |
name | Yes | string length: 1 - 128 | Human readable name. Should be short. _Eg: "Drinks" , "Soups" , … |
description | No | string length: 0 - 256 | Human readable description. Default: "" (empty string) Eg: "These are our delicious homebrewn drinks." |
items | No | MenuItem[] items: 0 - 256 | List of items in this category. Default: [] (empty array) |
orderableTimeSlots | No | OrderableTimeSlot[] items: 0 - 256 | Slot when it is possible to order items from this category. It can only further limit `orderableTimeSlots` from the whole menu. Default: unlimited |
MenuItem
This represents one orderable item.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the item. You will receive this in order as `mealId`. |
name | Yes | string length: 1 - 128 | Human readable name. Should be short |
inStock | Yes | boolean | Is item available (= true ) or sold-out (= false )? |
price | Yes | string regexp: ^\d{1,6}(?:\.\d{1,3})?$ | Total price for this items including taxes and packaging. |
type | No | string | Type of MenuItem. Default: "sale" . Possible values: "sale" - Item can be ordered alone."modifier" - Item is hidden in application and can be ordered only like modifier. |
description | No | string length: 0 - 512 | Human readable description. Default: "" (empty string) Eg: "The best drink on Earth. Our bartender has spent a lot of effort to prepare this. Get ready for the best time of your life while drinking it." |
deliveryTypes | No | string[] items: 1 - 4 unique items | List of allowed delivery types. It can only further limit deliveryTypes of the whole menu. Possible values: "toTable" , "toBill" , "byCustomer" , "byOperator" Notice: byOperator is unimplemented. Contact Qerko if you want to use it. |
images | No | string[] length: 1 - 2000 items: 0 - 10 | This is list of resourceId s. See getResource() method. Qerko will use these IDs to pull the resources when they are needed. Menu can be quite lengthy and we don’t want to overload the connection with hundreds of images :). Default: [] (empty array) |
modifiers | No | MenuItemModifier[] items: 0 - 256 | Modifiers that are available for this item Default: [] (empty array) Eg: medium-rare |
MenuItemModifier
This represent modifier in menu item.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the modifier. |
minSelected | Yes | number range 0 - 65635 | Minimum count of selected unique options |
maxSelected | No | number / null range 1 - 65635 | Maximum count of selected unique options. Default null. If null then unlimited. |
maxCount | Yes | number range: 1 - 65635 | Maximum count of selected non-unique options. |
name | Yes | string length: 1 - 128 | Name of modifier. Eg. “Pick steak doneness” |
options | Yes | MenuItemModifierOption[] | Modifier options. Eg. “medium rare” “raw” |
MenuItemModifierOption
This represent option of a modifier in menu item.
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the modifier option. |
menuItemId | Yes | string | ID of MenuItem which will be used like modifier option value. |
addPrice | Yes | string | Price of option, which will be added to final orderItem. This price overrides price of the menuItem linked by menuItemId. |
defaultSelected | No | number/null | Number of default selected items. Default null. |
maxCount | No | number/null | Maximum number of selections for this option. Default null. If null then unlimited. |
MealMenus
This structure contains a collection of menus. There can be multiple menu alternatives because of different currencies, languages and delivery options.
Property | Required | Type | Description |
---|---|---|---|
menus | Yes | OneMealMenu[] items: 0 - 256 | Array of menu alternatives. Up to 5000 items. |
deliveryInfos | Yes | DeliveryInfo[] items: 0 - 4 unique items | Delivery info effects availability of delivery type for the restaurant. If Delivery info for delivery type is missing it means that delivery type is disabled. |
OneMealMenu
This sturcrure represents one menu alternative for concrete language, currency and set of delivery types
Property | Required | Type | Description |
---|---|---|---|
id | Yes | string length: 1 - 128 | Identifier of the menu. |
categories | Yes | Category[] items: 0 - 256 | List of categories which further contains menu items. |
currency | Yes | string length: 3 | Currency code according to ISO 4217. Eg: "CZK" |
deliveryTypes | Yes | string[] items: 1 - 4 unique items | List of allowed delivery types. Possible values: "toTable" - The order can be added to the table as a new open bill. "toBill" - The order can be added to the existing bill. "byCustomer" - The order can be picked up by customer. Used in takeaway windows. "byOperator" - The order can be delivered to given address. This is unimplemented. Contact Qerko if you want to use it. |
minOrderTime | Yes | number value: 0 - 2147483647 | Minimum order delay in minutes. Minimum: 0 (Setting the delay to zero means the order can be picked up immediately.) Eg: 10 - it means that the customer can express his preference of pickup time to be in 10 minutes or later. |
maxOrderTime | Yes | number value: 0 - 2147483647 | Maximum order delay in minutes. Eg: 30 - it means that the customer can express his preference of pickup time to be in 30 minutes or before. |
lang | Yes | string length: 2 | ISO 639-1 language code. Default: universal Eg: "cs" |
orderableTimeSlots | No | OrderableTimeSlot[] items: 0 - 256 | Slot when it is possible to order items from this menu. Default: unlimited |
OrderableTimeSlot
This structure represents a timespan from to which is used to allow orders.
Property | Required | Type | Description |
---|---|---|---|
startTime | Yes | string length: 8 | Start time of this slot. Timezone is handled by Qerko configuration, because this isn’t timezoned information. The restaurant usualy opens in 11 AM regardless of summer or winter time. Eg: "11:00:00" |
endTime | Yes | string length: 8 | Start time of this slot. Timezone is handled by Qerko configuration, because this isn’t timezoned information. The restaurant usualy closes in 11 PM regardless of summer or winter time. Eg: "23:00:00" |
startDate | No | string length: 10 null | Start date of this slot. Use dates only if there is some sort of speciality in opening hours like New years eve. Or if it is special category like daily menu. Default: null , means every day Eg: "2021-03-02" |
endDate | No | string length: 10 null | End date of this slot. Use dates only if there is some sort of speciality in opening hours like New years eve. Or if it is special category like daily menu. Default: null , means every day Eg: "2021-03-02" |
OrderDeliveryByOperator
This structure holds info about delivery by operator. This means classic delivery as known from Uber Eats, Wolt, Foodora, etc.
Property | Required | Type | Description |
---|---|---|---|
customer | Yes | DeliveryAddress | Address where to deliver |
deliveryType | Yes | string | Constant value - "byOperator" |
collectionNotes | No | string length: 0 - 256 | Customers note meant for the operator. Eg: "Leave the package under the bridge." |
kitchenNotes | No | string length: 0 - 256 | Customers note meant for the cook. Eg: "Shaken, not stirred." |
OrderDeliveryByCustomer
This structure holds info for customers pickup. The customer will pick up the order in the restaurant.
Property | Required | Type | Description |
---|---|---|---|
name | Yes | string length: 0 - 128 | Name of the customer. Eg: "Miloslav M." |
collectionDateTime | Yes | string | Date and time when the customer wants to arrive Eg: "2021-03-02T14:35:00.000+01:00" |
deliveryType | Yes | string | Constant value - "byCustomer" |
orderReference | No | string | Reference number or ID of the order for easier pickup. We strongly recommend to use this property |
collectionNotes | No | string length: 0 - 256 | This feature is not yet implemented. Contact Qerko if you want to use it. Note regarding pickup Eg: "Wrap it into something special" |
kitchenNotes | No | string length: 0 - 256 | This feature is not yet implemented. Contact Qerko if you want to use it. Customers note meant for the cook. Eg: "Shaken, not stirred." |
phone | No | string | This feature is not yet implemented. Contact Qerko if you want to use it. Phone to the customer. Eg: "+420123456789" |
OrderDeliveryToTable
Property | Required | Type | Description |
---|---|---|---|
tableCode | Yes | string length: 1 - 256 | Code of the table where the customer sits. Coresponds to idTable returned from getTableList |
deliveryType | Yes | string | Constant value - "toTable" |
kitchenNotes | No | string length: 0 - 256 | This feature is not yet implemented. Contact Qerko if you want to use it. Customers note meant for the cook. Eg: "Shaken, not stirred." |
OrderDeliveryToBill
Property | Required | Type | Description |
---|---|---|---|
billId | Yes | string length: 1 - 128 | Identifier of the customers bill. Coresponds to Bill.id |
deliveryType | Yes | string | Constant value - "toBill" |
kitchenNotes | No | string length: 0 - 256 | This feature is not yet implemented. Contact Qerko if you want to use it. Customers note meant for the cook. Eg: "Shaken, not stirred." |
tableCode | No | string length: 1 - 128 | Table identification |
Payment
The difference from the default Payment structure is that there is orderId
used instead of idBill
and the items
property contains an array of Order items instead of BillItems.
Used in orderMarkAsPaid() method.
Receipt
Refers to the same structure as in Receipt data structure. Used in orderMarkAsPaid() method.
DeliveryInfo
This structure contains info about a supported delivery types.
Property | Required | Type | Description |
---|---|---|---|
type | Yes | string | Delivery type identifier. Correct values are toTable , toBill , byCustomer , byOperator |
paused | Yes | boolean | Shoud be true if ordering for delivery type is paused. Can be used if restaurant needs temporarily pause ordering for high demand or other issues. |