Ordering
Ordering a Product
To order a product through the remote API, you need to know the ID of the product you want to order. Every product that is configured on the coffee machine has an identifier that uniquely identifies that specific product. These identifiers are visible in a backup of the “Products”. Thus restoring these Products on a different machine will give you the same unique identifiers for the same products. Similarly adding and deleting products on a coffee machine will change the known identifiers on the machine. Changing parameter values of a product will however not change their identifiers.
The API offers a function to get a list of all configured products with their names as shown in the user interface together with this ID. The ID is required in subsequent API functions to refer to a product.
Various conditions on the coffee machine can prevent it from pouring some or all of the configured products. For example, when the milk container is empty, none of the milk products can be poured. To know which products can be poured at the moment, the API provides requests and events which inform about the currently available products.
Order processing
After a product has been ordered at the coffee machine, the status of the order is reported each time
the data changes. The order_changed message returns the Order data set.
Cleaning and rinsing are also considered products.
This data set contains a unique identifier for the order and an identifier for the associated product.
As long as an Order exists on the machine, the status can be queried using the identifier.
When the machine cleans up one or more outdated orders, an orders_removed message is sent. This
message contains a list of the identifiers of the removed orders.
Cup placement handling - cup not placed
Note
This scenario is only applicable if the machine has a cup sensor and the sensor is activated.
If there is no cup placed below the outlet, the product cannot be poured. A CupPlacementAction::WaitForCup
is sent to inform about the missing cup.
Additional information is provided if the sensor detects a cup that is too small.
Cup placement handling - cup already placed
Note
This scenario is only applicable if the machine has a cup sensor and the sensor is activated.
If a cup of the required size is already placed below the outlet, no CupPlacementAction is sent.
Instead, the product dispensing starts immediately.