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 runs | Address to enter in the ESIR |
|---|---|
| On the same computer as the device | http://127.0.0.1:8010 |
| On another computer on the local network | http://<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.
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:
| Call | Purpose |
|---|---|
GET /api/v3/attention | Checks that the device is reachable. |
GET /api/v3/status | State of the device and the card. |
POST /api/v3/pin | Sends the PIN. |
GET /api/v3/environment-parameters | Data about the Tax Administration environment. |
POST /api/v3/invoices | Signs a receipt. |
GET /api/v3/invoices/{requestId} | Fetches an already signed receipt again by its request number. |
When the ESIR cannot connect
- Check that the device is running: the device window must not read Servis nije dostupan (Service unavailable).
- 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. - 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:
- Checks the structure of the request. An invalid request is refused with a code from the technical guide and written to the error log.
- 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.
- 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.
- 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.
- Receives the receipt signed by the secure element.
- Writes the audit data to its memory.
- Creates the receipt journal and the unique verification URL, from which the ESIR prints the QR code.
- 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.