Skip to main content

Connecting the ESIR

The ESIR (the till) sends receipts to the device for signing over the local network, using the protocol of the Tax Administration's technical guide. The device listens on port 8010.

Device address​

Where the ESIR runsAddress to enter in the ESIR
On the same computer as the devicehttp://127.0.0.1:8010
On another computer on the local networkhttp://<IP address of the computer with the device>:8010, for example http://192.168.1.20:8010

The device window shows the computer's IP address in the Uređaj (Device) section, line Adresa u lokalnoj mreži (Address on the local network). If it reads dostupan samo sa ovog računara (reachable only from this computer), other computers cannot connect right now.

Fixed address

If the router hands out addresses automatically, the computer's address can change after a restart and the ESIR no longer finds the device. Give the computer with the device a fixed address in the router.

What the ESIR uses​

The device answers the calls of the technical guide, protocol version 3:

CallPurpose
GET /api/v3/attentionChecks that the device is reachable.
GET /api/v3/statusState of the device and the card.
POST /api/v3/pinSends the PIN.
GET /api/v3/environment-parametersData about the Tax Administration environment.
POST /api/v3/invoicesSigns a receipt.
GET /api/v3/invoices/{requestId}Fetches an already signed receipt again by its request number.

When the ESIR cannot connect​

  1. Check that the device is running: the device window must not read Servis nije dostupan (Service unavailable).
  2. On the computer with the ESIR, open the device address in a browser, for example http://192.168.1.20:8010. If a page with the device state opens, the network is fine and the problem is in the ESIR's settings.
  3. If the page does not open, check that both computers are on the same network and that the firewall lets port 8010 through. On Windows the network must be marked as private.

Receipt processing​

When the ESIR sends a receipt request, the device:

  1. Checks the structure of the request. An invalid request is refused with a code from the technical guide and written to the error log.
  2. Checks the tax labels of the items. A label that does not exist, is not active, or was not active on the date of the referenced document is refused with code 2310.
  3. Calculates the tax for each item, from the amount and the tax label sent by the ESIR, using the tax rates in force. Amounts are rounded to four decimals, half up.
  4. Sends the data to the secure element for signing, with the device's current date and time and the PIN, according to ISO/IEC 7816-4.
  5. Receives the receipt signed by the secure element.
  6. Writes the audit data to its memory.
  7. Creates the receipt journal and the unique verification URL, from which the ESIR prints the QR code.
  8. Only then returns the signed receipt to the ESIR.

All receipt types are processed this way: normal sale, advance, copy, training and proforma. Without a secure element in the reader the device signs no receipt and returns code 1300.

The protocol parameters (call addresses, field names, response format) are fixed by the technical guide and cannot be changed by any setting.