Skip to main content

Setup Configuration

Before starting using the TIM API, make sure that onTimApiReady() has been called as described in the Getting Started guide in chapter "Library usage".

Once a Terminal-instance has been created with a TerminalSettings-instance, the settings can not be changed anymore. Changes to the TerminalSettings-instance will be ignored.

The network and guides configuration are explained in the following chapters. For further information refer toTerminalSettings.

Network Configuration​

Depending on the platform used, the TIM API module can communicate with the Terminal over different communication channels.

TIM API JavaScript communicates with the terminals using WebSockets. Unlike in other TIM APIs, there's no broadcast mode, since the WebSocket protocol doesn't support this feature. Default port is 80 (for some terminals, e.g. Verifone, it's 8080).

In order to start a connection to a terminal, it's IP address must be known and configured in the TerminalSettings.

Guides Configuration​

There are various Guides covering different use case scenarios. The guide Retailis the basic guide and is activated as default. With guides the guides can be configured. Important: the configuration needs to include all desired guides (including the retail guide).

Code-example for creating a terminal including settings with activated guides retail and hospitality:

// Create settings with IP-address and port of terminal to connect to
let settings = new timapi.TerminalSettings();
settings.connectionIPString = "192.168.1.10";
settings.connectionIPPort = 80;
// Add wanted guides
settings.guides.add(timapi.constants.Guides.hospitality);
// Create terminal
let terminal = new timapi.Terminal(settings);
//...

// Disconnect from terminal and clean up properly
terminal.dispose();