Button Maps
| Type | Base Path | Trigger Name | 
|---|---|---|
| REST resource | ~{realm}/button-maps/ | button-maps | 
The button map resource defines the layout of the cash register's product buttons, but also take-out menus. It's basically an ordered grid or list of products, organized in sections.
Endpoints
| Name | Method | Relative Path | Payload | Response | Description | 
|---|---|---|---|---|---|
addButtonMap | POST | ~{realm}/button-maps/ | ButtonMap | Stored_ButtonMap | Adds a new button map to the list. | 
listButtonMaps | GET | ~{realm}/button-maps/ | N/A | Stored_ButtonMap[] | Retrieves a list of button maps. | 
getButtonMap | GET | ~{realm}/button-maps/{id} | N/A | Stored_ButtonMap | Retrieves a button map. | 
putButtonMap | PUT | ~{realm}/button-maps/{id} | ButtonMap | Stored_ButtonMap | Replaces a button map. | 
updateButtonMap | PATCH | ~{realm}/button-maps/{id} | Partial_ButtonMap | Stored_ButtonMap | Updates specified button map fields. | 
removeButtonMap | DELETE | ~{realm}/button-maps/{id} | N/A | N/A | Deletes a button map. | 
Permissions
| Permission | Description | 
|---|---|
edit-button-maps | Client is allowed to add new button maps and to modify or delete existing button maps. | 
show-button-maps | Client is allowed to query the button map list and to fetch individual button maps. | 
Entities
Interface ButtonMap
namespace ButtonMap {
    type Theme = 'classic' | 'modern';
    type Type = 'tablet-groups' | 'tablet-buttons' | 'phone-buttons' | 'menu' | 'menu-section';
}
interface ButtonMap {
    'name': string;
    'type': ButtonMap.Type;
    'width': number;
    'height': number;
    'buttons': ButtonMapItem[];
    'theme'?: ButtonMap.Theme;
    'id'?: number;
    'created'?: DateTime;
    'updated'?: DateTime;
    'deleted'?: DateTime;
    'updated-by'?: number;
    'updated-from'?: number;
    'tags'?: string[];
    'labels'?: number[];
}
| Property | Data Type | Description | 
|---|---|---|
name | String | Button map name. | 
type | ButtonMap.Type | Type of button map. | 
width | Integer | Width of button map (number of buttons per row). Always set to 0 (meaning adaptive) for take-out menus and 1 for take-out menu sections. | 
height | Integer | Height of button map (number of buttons per column). Always set to 1 for take-out menus and 0 (meaning adaptive) for take-out menu sections. | 
buttons | ButtonMapItem[] | A list of buttons. | 
theme | ButtonMap.Theme? | Defines the appearance of the button map. Default, if unspecified, is classic. | 
id | Int64? | The resource ID of this entity. | 
created | DateTime? | Date and time when this entity was first created. | 
updated | DateTime? | Date and time when this entity was last modified. | 
deleted | DateTime? | Date and time when this entity was deleted. | 
updated-by | Int64? | ID of User who last modified this entity. | 
updated-from | Int64? | ID of Till (trusted device) which last modified this entity. | 
labels | Int64[]? | A list of Label IDs associated with this entity. | 
The following table describes all available button map types.
| Action | Description | 
|---|---|
tablet-groups | Defines the upper group buttons (1 or 2 rows) in the cash register tablet UI. | 
tablet-buttons | Defines the main (lower) button area in the cash register tablet UI. | 
phone-buttons | Defines the main button area in the cash register mobile/phone UI. | 
menu | Defines a take-out menu. Should only contain display-button-map buttons that link to menu-section button maps. | 
menu-section | Defines a section in the take-out menu. Should contain add-product-item buttons that specifies products that can be ordered. | 
Interface ButtonMapItem
namespace ButtonMapItem {
    type Action =
        | 'add-product-item'
        | 'display-button-map'
        | 'display-parent-button-map'
        | 'display-previous-page'
        | 'display-next-page'
        | 'add-tab-discount'
        | 'open-uri'
        ;
    type DiscountType =
        | 'percentage'
        | 'fixed-amount'
        ;
}
interface ButtonMapItem {
    'name'?: string;
    'theme'?: number;
    'x': number;
    'y': number;
    'action': ButtonMapItem.Action;
    'product'?: number;
    'button-map'?: number;
    'uri'?: string;
    'discount-type'?: ButtonMapItem.DiscountType;
    'amount'?: number;
    'discount-rate'?: number;
}
| Property | Data Type | Description | 
|---|---|---|
name | String | Button name. If unspecified, the name is taken from the referenced product or button map. | 
theme | Int32? | Defines the appearance/color of the button. See table below. | 
x | Int32 | Defines the horizontal position of the button. First column is 0; first column on second page is the value of ButtonMap.width. | 
y | Int32 | Defines the vertical position of the button. First row is 0; if larger or equal to ButtonMap.height, the button will not show. | 
action | ButtonMapItem.Action | Kind of button. See table below. | 
product | Int64? | The product to add, if action is add-product-item. | 
button-map | Int64? | The button map referenced, if action is display-button-map. | 
uri | URI? | The URI to open, if action is open-uri. | 
discount-type | ButtonMapItem.DiscountType? | The type of discount to add, if action is add-tab-discount. | 
amount | Money? | If discount-type is fixed-amount, how much discount to give (in default currency). | 
discount-rate | Float32? | If discount-type is percentage, how much discount to give (in percent). | 
The following table describes the current button themes. Note that this might change in the future.
| Theme | Classic Phone | Classic Tablet | Modern Tablet | 
|---|---|---|---|
null | Light blue | White | Dark gray | 
0 | Light green | Light green | Green | 
1 | Light blue | Light blue | Blue | 
2 | Light yellow | Light yellow | Yellow | 
3 | Light pink | Light red | Red | 
4 | Dark marine | Dark marine | Not used (displays as purple) | 
5 | Dark green | Dark green | Dark green | 
6 | Dark blue | Dark blue | Dark blue | 
7 | Dark yellow | Dark yellow | Orange | 
8 | Dark pink | Dark red | Dark red | 
9 | Light purple | Black | Purple | 
The following table describes all available actions.
| Action | Description | 
|---|---|
add-product-item | Adds the product specified in product to the current tab. For maps of type menu-section, specifies what product to show at this position. | 
display-button-map | Navigates to the button map specified in button-map. For maps of type menu, specifies what menu section to include at this position. | 
display-parent-button-map | Navigates to the previous/parent button map (which contained the display-button-map action). | 
display-previous-page | Navigates to the previous page of a multi-page button map. | 
display-next-page | Navigates to the next page of a multi-page button map. | 
add-tab-discount | Adds a discount to the current tab. | 
open-uri | Opens a custom URI/URL. Can be a web site, Android Intent or any other URI the cash register knows how to open. |