VisioLab Cash Register API 1.2.0

The iPad running VisioLab's Blink app (scanner) runs a websocket server in the local network on ws:/<local-ip>/visiolab-cash-register. Each message contains an event and a data property at the top level. The event property identifies the type of the message, so that actions can be dispatched based on it. The data property contains the actual content of the message. Messages constitute events and there is no fixed request-response relation between them. Still the events are expected to follow a certain sequence as described below. Once the register has established a connection, it should synchronize its articles using the syncArticles operation. Afterwards the scanner is ready to detect food.

Once articles are detected and the "Pay" button is pressed to initiate the checkout, setBasket will be sent. The register can optionally report actual article prices after recalculation based on guest identification using updateBasket at any time. If scale articles are detected, they are not send in the initial setBasket event. Instead they are send individually with the weighArticle command, to which the register should respond with a articleWeighed event in a case of success or with a weighingFailed event in a case of failure. The scanner can add additional articles to the basket after weighing using the addArticles event. The guestAuthenticated event should be send when a guest is identified, e.g. by putting their card on the reader, to inform the scanner that payment flows that require upfront authentication can proceed. After all articles are added to the basket, the payment is initiated by sending startPayment. The register can optionally report actual article prices after recalculation based on guest identification using updateBasket and should do so before sending articleWeighed to communicate the total price after weighing. Finally, it should handle the transaction and respond by sending either paymentSuccess or paymentFailure.

In case of malformed messages or other errors, the register or the scanner can send an error event. If deprecated events are being received, both sides can send a warining event.

Servers

  • ws://<local-ip>/visiolab-cash-registerwsvisiolab

Operations

  • PUB /visiolab-cash-register

    Messages the client can send.

    Operation IDsendMessage

    Accepts one of the following messages:

    • #0syncArticles

      Synchronize available articles in the cash register.

      The synchronized articles are currently used to updated the prices of articles already available in the Blink app, based on matching PLUs.

      object

      Examples

    • #1updateBasket

      Report a change in article prices in the current basket after guest identification.

      The updated prices are used to already show the correct total price to the guest during payment. The event should always be send before articleWeighed and already include the price of the weighed article.

      object

      Examples

    • #2guestAuthenticated

      Report that a guest has been authenticated.

      Inform the scanner that payment flows that require upfront authentication can proceed.

      object

      Examples

    • #3guestRemoved

      Report a previously authenticated guest has been removed again.

      Inform the scanner that payment flows that require upfront authentication can no longer proceed.

      object

      Examples

    • #4articleWeighed

      Report the result of a weighing operation.

      object

      Examples

    • #5weighingFailed

      Report an error during a weighing operation.

      object

      Examples

    • #6paymentSuccess

      Report the success of a payment.

      object

      Examples

    • #7paymentFailure

      Report the failure of a payment.

      object

      Examples

    • #8showDialog

      Show a dialog that requires user interaction.

      The dialog will be rendered based on the data, including all buttons. It will report back the button that was pressed with the action that is attached to the button. The dialog will be closed automatically after a button was pressed. In case a new dialog should be opened, a new message has to be sent. The dialog can only be shown during checkout and not during scanning.

      object

      Examples

    • #9closeDialog

      Close any currently open dialog.

      object

      Examples

    • #10apiError

      Report an error.

      Report an error that occurred either in response to a received event or due to some external factor.

      object

      Examples

    • #11apiWarning

      Report a warning.

      Report a warning that occurred either in response to a received event or due to some external factor.

      object

      Examples

  • SUB /visiolab-cash-register

    Messages the sever can send.

    Operation IDprocessMessage

    Accepts one of the following messages:

    • #0setBasket

      Set the current basket.

      The contents of the basket are completely replaced by the new contents.

      object

      Examples

    • #1addArticles

      Add articles to the current basket.

      Previous contents of the basket are kept. If no previous basket was open on the cash register side, it should be opened by the message.

      object

      Examples

    • #2weighArticle

      Initiate a weighing operation for an article.

      This event should activate the scale and either way the article if it is already placed on the scale or placed afterwards.

      object

      Examples

    • #3startPayment

      Initiate the payment for the current basket.

      object

      Examples

    • #4printReceipt

      Print a physical receipt for a checkout.

      Prompts the register to print a receipt for the given checkout. If receiptId is not provided, the register should print the last receipt.

      object

      Examples

    • #5userInput

      Report the user's response to a dialog.

      Reports the action of the button that was pressed in a dialog. The actions corresponds to what was set in the showDialog message.

      object

      Examples

    • #6reset

      Reset the cash register.

      Cancel all ongoing transactions and delete all articles from the current basket.

      object

      Examples

    • #7apiError

      Report an error.

      Report an error that occurred either in response to a received event or due to some external factor.

      object

      Examples

    • #8apiWarning

      Report a warning.

      Report a warning that occurred either in response to a received event or due to some external factor.

      object

      Examples

Messages

  • #1syncArticles

    Synchronize available articles in the cash register.

    The synchronized articles are currently used to updated the prices of articles already available in the Blink app, based on matching PLUs.

    object
  • #2updateBasket

    Report a change in article prices in the current basket after guest identification.

    The updated prices are used to already show the correct total price to the guest during payment. The event should always be send before articleWeighed and already include the price of the weighed article.

    object
  • #3setBasket

    Set the current basket.

    The contents of the basket are completely replaced by the new contents.

    object
  • #4addArticles

    Add articles to the current basket.

    Previous contents of the basket are kept. If no previous basket was open on the cash register side, it should be opened by the message.

    object
  • #5weighArticle

    Initiate a weighing operation for an article.

    This event should activate the scale and either way the article if it is already placed on the scale or placed afterwards.

    object
  • #6startPayment

    Initiate the payment for the current basket.

    object
  • #7printReceipt

    Print a physical receipt for a checkout.

    Prompts the register to print a receipt for the given checkout. If receiptId is not provided, the register should print the last receipt.

    object
  • #8apiError

    Report an error.

    Report an error that occurred either in response to a received event or due to some external factor.

    object
  • #9apiWarning

    Report a warning.

    Report a warning that occurred either in response to a received event or due to some external factor.

    object
  • #10articleWeighed

    Report the result of a weighing operation.

    object
  • #11weighingFailed

    Report an error during a weighing operation.

    object
  • #12guestAuthenticated

    Report that a guest has been authenticated.

    Inform the scanner that payment flows that require upfront authentication can proceed.

    object
  • #13guestRemoved

    Report a previously authenticated guest has been removed again.

    Inform the scanner that payment flows that require upfront authentication can no longer proceed.

    object
  • #14paymentSuccess

    Report the success of a payment.

    object
  • #15paymentFailure

    Report the failure of a payment.

    object
  • #16reset

    Reset the cash register.

    Cancel all ongoing transactions and delete all articles from the current basket.

    object
  • #17showDialog

    Show a dialog that requires user interaction.

    The dialog will be rendered based on the data, including all buttons. It will report back the button that was pressed with the action that is attached to the button. The dialog will be closed automatically after a button was pressed. In case a new dialog should be opened, a new message has to be sent. The dialog can only be shown during checkout and not during scanning.

    object
  • #18closeDialog

    Close any currently open dialog.

    object
  • #19userInput

    Report the user's response to a dialog.

    Reports the action of the button that was pressed in a dialog. The actions corresponds to what was set in the showDialog message.

    object

Schemas

  • object
    uid: SyncedArticle
  • array<object>
    uid: SyncedArticles
  • object
    uid: ScanArticle
  • array<object>
    uid: ScanArticles
  • object
    uid: BasketArticle
  • array<object>
    uid: BasketArticles
  • object
    uid: SuccessfulPayment
  • object
    uid: FailedPayment
  • object
    uid: I18ned
  • object
    uid: ApiError
  • object
    uid: ApiWarning
  • object
    uid: Dialog