Messages

Make sure you familiarize yourself with the following important concepts of our API:
Prices and Quantities, Products and Articles, Sync Markers
After taking the time to understand these concepts, you will much better understand the basics of our API.

Introduction

With the Mplus API, it is possible to send little notification message to the cash register’s screen, when it is in use. Notifications are real-time, so if the cash register is not running, the message will not be shown.

Sending a notification message

<?php 

require_once('Mplusqapiclient.php');

$mplusqapiclient = new Mplusqapiclient();
// Initialize the client with your details.

// Then we initialize the variables
$branchNumber = 0; // This means: send to all branches
$terminalNumber = 0; // This means: send to all terminals
$message = 'Hello, this is a message from the API.';

// Then we call the sendMessage() function wrapped in a try/catch block to intercept any exceptions.
try {
  if (false !== $mplusqapiclient-&gt;sendMessage($branchNumber, $terminalNumber, $message)) {
    // Success, we show the existing relation's number.
    exit(sprintf('Found existing relation with number %d.', $existing_relation['relationNumber']));
  } else {
    exit('Unable to send message.');
  }
} catch (MplusQAPIException $e) {
  exit($e-&gt;getMessage());
}

In the cash register, the message will be shown in the upper right corner, like this:

message-from-the-api