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 warning event.

Servers

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

Operations

  • RECEIVE /visiolab-cash-register

    Messages the client can send.

    Operation IDreceiveFromClient

    Available only on servers:

    Accepts one of the following messages:

    • #0Sync Articles

      Synchronize available articles in the cash register.

      Message IDsyncArticles

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

      object

      Examples

    • #1Update Basket

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

      Message IDupdateBasket

      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

    • #2Guest Authenticated

      Report that a guest has been authenticated.

      Message IDguestAuthenticated

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

      object

      Examples

    • #3Guest Removed

      Report a previously authenticated guest has been removed again.

      Message IDguestRemoved

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

      object

      Examples

    • #4Article Weighed

      Report the result of a weighing operation.

      Message IDarticleWeighed
      object

      Examples

    • #5Weighing Failed

      Report an error during a weighing operation.

      Message IDweighingFailed
      object

      Examples

    • #6Payment Success

      Report the success of a payment.

      Message IDpaymentSuccess
      object

      Examples

    • #7Payment Failure

      Report the failure of a payment.

      Message IDpaymentFailure
      object

      Examples

    • #8Show Dialog

      Show a dialog that requires user interaction.

      Message IDshowDialog

      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

    • #9Close Dialog

      Close any currently open dialog.

      Message IDcloseDialog
      object

      Examples

    • #10API Error

      Report an error.

      Message IDapiError

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

      object

      Examples

    • #11API Warning

      Report a warning.

      Message IDapiWarning

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

      object

      Examples

  • SEND /visiolab-cash-register

    Messages the server can send.

    Operation IDsendToClient

    Available only on servers:

    Accepts one of the following messages:

    • #0Set Basket

      Set the current basket.

      Message IDsetBasket

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

      object

      Examples

    • #1Add Articles

      Add articles to the current basket.

      Message IDaddArticles

      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

    • #2Weigh Article

      Initiate a weighing operation for an article.

      Message IDweighArticle

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

      object

      Examples

    • #3Start Payment

      Initiate the payment for the current basket.

      Message IDstartPayment
      object

      Examples

    • #4Print Receipt

      Print a physical receipt for a checkout.

      Message IDprintReceipt

      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

    • #5User Input

      Report the user's response to a dialog.

      Message IDuserInput

      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.

      Message IDreset

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

      object

      Examples

    • #7API Error

      Report an error.

      Message IDapiError

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

      object

      Examples

    • #8API Warning

      Report a warning.

      Message IDapiWarning

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

      object

      Examples

Messages

  • #1Sync Articles

    Synchronize available articles in the cash register.

    Message IDsyncArticles

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

    object
  • #2Update Basket

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

    Message IDupdateBasket

    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
  • #3Set Basket

    Set the current basket.

    Message IDsetBasket

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

    object
  • #4Add Articles

    Add articles to the current basket.

    Message IDaddArticles

    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
  • #5Weigh Article

    Initiate a weighing operation for an article.

    Message IDweighArticle

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

    object
  • #6Start Payment

    Initiate the payment for the current basket.

    Message IDstartPayment
    object
  • #7Print Receipt

    Print a physical receipt for a checkout.

    Message IDprintReceipt

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

    object
  • #8API Error

    Report an error.

    Message IDapiError

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

    object
  • #9API Warning

    Report a warning.

    Message IDapiWarning

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

    object
  • #10Article Weighed

    Report the result of a weighing operation.

    Message IDarticleWeighed
    object
  • #11Weighing Failed

    Report an error during a weighing operation.

    Message IDweighingFailed
    object
  • #12Guest Authenticated

    Report that a guest has been authenticated.

    Message IDguestAuthenticated

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

    object
  • #13Guest Removed

    Report a previously authenticated guest has been removed again.

    Message IDguestRemoved

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

    object
  • #14Payment Success

    Report the success of a payment.

    Message IDpaymentSuccess
    object
  • #15Payment Failure

    Report the failure of a payment.

    Message IDpaymentFailure
    object
  • #16Reset

    Reset the cash register.

    Message IDreset

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

    object
  • #17Show Dialog

    Show a dialog that requires user interaction.

    Message IDshowDialog

    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
  • #18Close Dialog

    Close any currently open dialog.

    Message IDcloseDialog
    object
  • #19User Input

    Report the user's response to a dialog.

    Message IDuserInput

    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
  • array<object>
  • object
  • array<object>
  • object
  • array<object>
  • object
  • object
  • object
  • object
  • object
  • object