GPE Interface Implementation Guide v13.00
GPE Interface Implementation Guide v13.00
INTRODUCTION ................................................................................................................................................ 6
1.1 PAYMENT TRANSACTIONS ................................................................................................................................ 7
1.2 INTEGRATION USE CASES / BEST PRACTICES ......................................................................................................... 8
1.2.1 Attended vs unattended .................................................................................................................. 8
1.2.2 Enhanced matching feature ............................................................................................................ 8
1.2.3 Attended best practices ................................................................................................................... 9
1.2.4 Unattended best practices .............................................................................................................. 9
1.3 INTEGRATION PACKAGE PROVIDED BY GPE........................................................................................................ 10
1.4 BENEFITS FOR ECR AND POST INTEGRATION .................................................................................................... 10
1.5 INTEGRATION RISKS ...................................................................................................................................... 10
1.6 CERTIFICATION PROCESS ................................................................................................................................ 11
2 IMPLEMENTATION OF INTERFACE ......................................................................................................... 12
2.1 BEFORE YOU START – TERMINAL CONFIGURATION .............................................................................................. 12
2.2 AVAILABLE CONNECTION TYPES ....................................................................................................................... 12
2.2.1 RS232............................................................................................................................................. 12
2.2.2 Ethernet (TCP/IP) ........................................................................................................................... 13
2.3 INTERFACE INTERACTION ............................................................................................................................... 14
2.3.1 General rules ................................................................................................................................. 14
2.3.2 Interaction of RCARC type ............................................................................................................. 17
2.3.3 Interaction of RC type with Abort transaction............................................................................... 17
2.3.4 Explanation of terms used in the diagrams ................................................................................... 19
2.4 PROCESSING STATUSES.................................................................................................................................. 20
2.5 SPECIFICATIONS FOR APPLICATION PROTOCOL .................................................................................................... 21
2.5.2 Message header ............................................................................................................................ 22
2.5.3 Message data part ........................................................................................................................ 23
2.5.4 Rules for working with data fields ................................................................................................. 24
2.5.5 Data fields of Payment Services .................................................................................................... 25
2.5.6 Transaction response codes .......................................................................................................... 32
3 VALUE ADDED SERVICES ....................................................................................................................... 33
3.1 EET SERVICE (ONLY FOR CZECH REPUBLIC)........................................................................................................ 33
3.1.1 EET transactions ............................................................................................................................ 33
3.1.2 Extended data fids of EET service .................................................................................................. 34
3.1.3 Fids for other EET transactions ...................................................................................................... 34
3.1.4 Fid definition.................................................................................................................................. 35
3.1.5 EET Check ...................................................................................................................................... 35
3.1.6 EET Synchronization of transactions ............................................................................................. 36
3.1.7 EET Payment and EET Sale ............................................................................................................ 38
3.1.8 EET Cash Refund, EET Refund ........................................................................................................ 38
3.1.9 EET Reversal .................................................................................................................................. 38
3.1.10 Fids structure ............................................................................................................................ 38
3.1.11 The EET sFids of fid e ................................................................................................................ 40
3.1.12 The EET transaction treatment ................................................................................................. 40
3.1.13 Type of registered payment ...................................................................................................... 40
3.1.14 Signature and security codes .................................................................................................... 41
3.1.15 Unique EET Transaction number .............................................................................................. 42
3.1.16 EET Repeat Last Trn. ................................................................................................................. 42
3.1.17 EET advices and recommendations .......................................................................................... 43
3.2 TRANSPORT ADDITIONAL INFORMATION ........................................................................................................... 43
4 APPENDICES .......................................................................................................................................... 44
4.1 ALGORITHM FOR CALCULATING CRC16 IN C LANGUAGE ...................................................................................... 44
4.2 SERIAL CABLE STRUCTURE .............................................................................................................................. 45
4.3 COMMUNICATION TRACE .............................................................................................................................. 46
4.4 FAQ ......................................................................................................................................................... 52
5 REFERENCES .......................................................................................................................................... 53
INTRODUCTION
This document describes the cash register (or any other system like self-service
kiosks, vending machines, etc.) interface to the GPE Newton payment terminal
application and includes information needed for the implementation of this interface
to the cash register (further mentioned as ECR) or any other system.
The cash register interface of the payment terminal is the same for commonly
used GPE terminals (attended and also unattended) but implemented only for terminal
types in which its usage makes sense (for example mobile GPRS terminal does not
have any interface for cash register). We do provide also integration for mobile
platforms like Android or iOS, but this function is not a part of this document. Please
contact GPE for more information.
secure collection of input data, mediating the transaction processing via central GPE
systems and providing trustworthy information (e.g. output) on the results of the
processing.
The operating process of this relation is not usually managed by only the
involved systems, but also influenced by two human factors (the operator and
customer).
IBM
Remote connection
Merchant site
Page 6 of 53
1.1 Payment transactions
payment methods:
Available for
Type Description
AT CAT
to the
Sale
services or cash.
Transfer of an amount from the account of the merchant to the
Refund This transaction is very risky for frauds, so
please handle it carefully.
account for limited time (time range depends on the card issuer).
Preauthorization
Preauthorization completion is necessary to finalize/catch the
transaction amount.
Transaction allowing to increase the amount of original
preauthorization. These transactions can be made as a chain of
Incremental
transaction completed by one preauthorization completion.
preauthorization
Completion is initiated for last successful incremental
preauthorization.
Finalizes the Preauthorization It means, that
Preauthorization
Completion can be done for partial or full amount of
completion
preauthorization. Higher completion amount than preauthorized is
not allowed.
This operation allows to cancel transaction Sale or
Transaction Preauthorization completion transaction (as long as it was
cancellation completed). Regarding to settlement between the vendor and
card holder, it has an inverted character to the Sale operation.
Reversal Cancellation (reversal or VOID) of last transaction successfully
(VOID) done by terminal.
The transaction is used for casinos and gambling room for selling
Quasi Cash
tokens.
Its purpose is to compare the number and sum of amounts of all
transactions made between the payment terminal (or cash
Subtotals
register) and authorization system. It is only used for the
immediate comparison of the accumulated transaction status.
The purpose of this transaction is to conclude the accounting
period (e.g. with a change of operator) and to check the balance
of the transaction state between the payment terminal (or cash
Batch close
register) and authorization system. The result of the operation (in
contrast to the Sub-total transaction) is always the clearing of the
accumulated transaction state of all systems.
This operation is only reads card, from PAN+EXP makes hash,
Token
encrypts by RSA and sends this data to ECR(Kiosk)
This operation reads card, sends offline data to AC, checks Deny
Variable Fare List stored in POS and from PAN+EXP makes hash, encrypts by
RSA and sends this data to ECR(Kiosk)
This operation is for sending additional information from ECR
VF Advice
(Kiosk) to previous Variable Fare transaction.
Offline Transaction used for sending offline transaction locally stored in
upload terminal to authorization host. This is used mainly by unattended
Page 7 of 53
Chapter 0: INTRODUCTION
terminals.
.
Host This administrative transaction is used for testing connection to
Handshake authorization host.
TMS This operation initiated ECR(Kiosk) to force the POS connect to
connect TMS for upload software, OS or parameters.
Last TMS This operation returns the last TMS connection date + time and
connect also the last versions of all POS applications.
POST data The purpose of this operation is to get print data from POS for last
printing transaction or configuration (SW, HW and setting)
The return status and data last transaction was performed. Used
Last TRN only if previous transaction was Sale, Cancellation, Refund,
Repeat Preauthorization, Completion Preauthorization, Token, Variable
Fare, Variable Fare Advice, EET Payment or EET Cash refund.
(EM)
always pair original transactions with the following ones which are changing original
transaction status. From customer perspective,
supported by:
Global Payments Europe
Global Payments Czech Republic
Global Payments Slovakia
Global Payments Romania
Global Payments Europe Hungary
Global Payments Malta
This functionality is not supported by:
KB SmartPay
Page 8 of 53
the transaction codes based on the EM functionality (EM applies only to financial
transactions, others without impact are not listed in table):
Transactions EM not available EM available
Sale 00 00
Preauthorisation 01 01
Incremental preauthorization Not available 07
Preauthorization Completion 02 22
Refund 04 04
QuasiCash 05 05
Reversal 10 10
Transaction cancellation 10* 21
*transaction cancellation without EM functionality is same as reversal last transaction cancellation.
Page 9 of 53
Chapter 0: INTRODUCTION
TMS connect
Sale
Receipt printed by ECR Reversal
Vending machines
Close day initiated from ECR Close day
TMS connect
Sale
Reversal
Close day
Receipt printed by ECR
Transport solution Token
Close day initiated from ECR
TMS connect
Variable Fare
VFadvice
The reason for the creation of the aforementioned states is usually a wrong
implementation of the cas
external influences (e.g. electromagnetic fields, incorrect voltage, mechanical damage
of equipment, etc.) reason, why GPE insists on the integration certification,
where our trained certification specialist will verify your implementation and confirms
the proper system behavior.
Page 10 of 53
1.6 Certification process
Based on your request we will grant you access to all necessary
documentation. With these details you can swiftly start your integration of GPE
interface.
During whole development GPE will provide you technical support. At the end
of integration leaflet, you can find test cases, which must be successfully passed
during our certification event. In the integration sheet, you can also find all mandatory
functions that need to be implemented in your system. Rest of services is optional.
Whether your development is finished, you can arrange certification date with
our certification specialist. Certification is usually placed in our headquarters in GPE
Prague, but if necessary, it can be managed remotely. With our testers you will pass
all mandatory test cases described in this leaflet. After successful certification you will
receive GPE certificate and your company will be listed as a certified partner.
Certification is not limited by country or customer. For more information please
visit [Link] (Czech version, for English version we will launch
[Link] soon.
Page 11 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
2 IMPLEMENTATION OF INTERFACE
The payment terminal and its architecture are classified to the category of
intentionally designed equipment. Its HW and SW does not allow for parallel
processing of multiple tasks. If then the payment terminal processes a task started
through a user interface of the terminal, the processing of another task cannot be
started through the cash register interface of the terminal and vice versa.
This characteristic also applies for the cash register interface itself; the new task (or
transaction) can only be begun in the case that the POST is not yet processing any
other task (i.e. the previous task has already been completed).
If you asked GPE for testing terminal, do not forget to share with us requested terminal
configuration.
2.2.1 RS232
The standard means of connection is done via a cable (for the connection see the
chapter Serial cable connection). The interface configuration used is:
Page 12 of 53
Transfer mode: Serial, asynchronous, full-duplex
Format: 8 data bits, 1 stop bit, no parity;
Speed: 9600 bps
Data flow management: NONE
[Link]
FireWall
Gateway
LAN
Internet
In unattended design, the terminal act as a client and connects to the ECR
(Kiosk), which act as server, and send request.
Communication Settings
Because socket connection is used in TCP/IP, both sides have to be set correctly. On
the image upwards, server and client belong to the same network, but they can be in
different LAN.
Page 13 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
The following run variables are used for all types of interactions:
RETRY_CNT retry counter (decremented)
During each processing of a transaction the ECR must maintain the following values:
identifier of the logical terminal where the transaction was made
Terminal ID
(ECR obtains the value from the first response of the POST)
Transaction date and time of transaction. (for the duration of the transaction
Date & Time this value is constant)
Connection life cycle corresponds to type interactions defined later. Terms Open
Comm. Channel a Close Comm. Channel can be analogically used for TCP/IP
Connection opened / closed.
Page 14 of 53
Active socket connection without data if there is no relevant message received
within 5s, terminal closes connection. ECR should accept disconnection and start new
transaction as a new connection.
Closing of active connection in case the connection is suddenly closed from ECR,
terminal accepts disconnection. If unexpected error appears and the connection is
then closed, it is recommended to wait 1s delay before next connection starts.
Restrictions
Only one request can be managed by server at same time
Only one client can be connected to server
Only first request in queue is managed, others (max 2 requests in queue) are
refused with response message
DHCP is not supported, fix IP addresses must be set
[Link]
Serial communication
There is no verification. It is based on physical connection.
TCP/IP communication
Client uses Server
verifies client IP, compares this IP against trusted IP in its parameters. If IP
verification will fail, connection is not accepted by server.
A failure of low-level functions for receiving and sending data, a deviation from the
declared sequence of processing or content of messages, etc.
Blocking the communication interface means a state, in which the ECR restricts the
initiation of any new transaction for a set time.
The aim of this protective measure is to allow the terminal to cancel the started task
and to return to the basic state.
Page 15 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Before starting new connection, it is recommended to clear In/Out buffers for low-
level functions.
Page 16 of 53
2.3.2 Interaction of RCARC type
Diagram 3
Page 17 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Page 18 of 53
2.3.4 Explanation of terms used in the diagrams
Description of activities
open Software opening of communication channel between ECR and POST
Comm. channel (including its configuration, deletion of entry queues, etc.).
close
Software closing of the communication channel.
Comm. channel
send Sending message requesting creation of transaction by the payment
Transaction Request terminal.
receive
Acceptance of any formally correct message.
Transaction Message
evaluate Evaluation of received message in the sense of message type and logical
Transaction Message check of values.
repeat Evaluation whether it should be repeated.
send
Sending of confirmation message. See chapter Confirmation message
Confirmation Message
send
Sending of Error in Format message. See chapter Error in Format message
FMTERR Message
Page 19 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Status description
Description of Events
Sale, (Cancellation),
Return, Sub-total, Transactions described in the previous chapters.
Close day
Task initiated from User operation, which can be any task initiated by the POST user
POST through a user GUI of the payment terminal.
Turn on/off
Diagram 1
Page 20 of 53
2.5 Specifications for application protocol
This protocol is transparent for supported communications profiles (Serial or Ethernet).
This protocol is designed exclusively for ECR and POST communication.
Communication of both units is carried out in the form of unified messages. The
importance of individual messages is determined by their content. The protocol is
ASCII coded, the numerical values are entered by a big-endian convention and are
entered as a decimal unless otherwise indicated.
Each message begins with the control character <STX>, which is followed by the
message header, optionally the data part, and ended with the character <ETX>.
Length
STX (Start) 1
HEADER 36
DATA variables 0 65535
ETX (End) 1
[STX]B001[SP][SP][SP][SP][SP][SP][SP][SP]0703140914480000000A346F[FS]B1000[FS]T04[ETX]
data field
Example of an actual message without the data part.
<STX>B001S1APDA0514052908093800000000A5A5<ETX>
Page 21 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
<STX>B001S1APDA0514052808312000000000A5A5<ETX>
Example of message signaling the acceptance of a message with a value error of the
CRC:
<STX>B001S1BPOS5907031409142900010000B6B7<FS>R106<ETX>
[Link] HeartBeat
The purpose of this message is to check if permanent connection between TCP/IP
service and POST is still active. The message length is 2 bytes (0xFF 0xFF) and is
periodically repeated every 5 seconds. If POST did not receive it in defined time,
reconnection must be done by the terminal.
1
Device messages doplnit popis, co jsou device message
Page 22 of 53
Protocol
N 2 Default
version
Terminal logical identifier on which the transaction will be made. During
sending the first Transaction Request, the ECR does not know this value.
Terminal ID AN 8 This is a reason why first message fills this field with 8 spaces (character
0x20). In the verification messages it uses the value obtained from the first
message from POST.
Date and Time of transaction. This value is same for all messages of a single
transaction. The value is formatted: YYMMDDHHmmSS,
where:
YY year (last 2 numbers for 2017 only 17 is given) (00 to 99)
Date Time N 12 MM = month (00 to 12)
DD = day (01 to 31)
HH = hour (00 to 23)
mm = minute (00 to 59)
SS = second (00 to 59)
Field with tags of additional parameters. It has the character of a bit map in
which each bit signifies an additional parameter. The entry is hexadecimal.
For messages going from ECR to POST it always has a value of
For B2 protocol
the POST that Device messages (protocol D2) is supported by the ECR.
Tags Otherwise
AN 4
For messages going from POST to ECR:
Bit0: Request for check during a Sales
transaction.
= 0 → Signature not required for just completed transaction
= 1 → Signature required for just completed transaction
Bit 1-15: reserved
Length of message d
Length of
AN 4 without a data part. Entry: Hexadecimal, e.g: "001C" for length of data part
data
28.
Checksum of message data part. If the message does not contain a data
. Entry: Hexadecimal, e.g: "F6C8".
CRC16 AN 4
For a calculation, see chapter 4.1 Algorithm for calculating CRC16 in C
language.
<FS> 1
Field identifier 1
Value Variable length
Page 23 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
<FS>T00<FS>B100
(with two fields: transaction type and amount, with a total data length of 9 characters)
[Link] Order
The data fields can be arbitrarily arranged.
Page 24 of 53
2.5.5 Data fields of Payment Services
An overview of required and optional fields in relation to the messages of individual transactions:
Field
Transaction Msq
A B C D E F H I J K L N P R S T U a b d f i n t q**
Req
Sale Resp
Req
Reversal Resp
Req
Refund Resp
Req
Preauthorization Resp
Incremental Req
preauthorization Resp
Req
Completion Resp
Req
Subtotal Resp
Req
Total Resp
Req
Offline upload Resp
Req
POST data printing Resp
Req
HOST Handshake Resp
Req
TMS connect Resp
Req
Last TMS connect Resp
Req
Last TRN repeat Resp
Req
Token Resp
Req
Variable Fare Resp
Req
VF Advice Resp
Req
Abort transaction Resp
Page 25 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Req
Cancellation Resp
Req
QuasiCash
Resp
Req
Completion New
Resp
Transaction Msq A B C D E F H I J K L N P R S T U a b d f i n t q**
- required field.
- optional fields
Page 26 of 53
Length: fix 3
Example of supported codes: 203 = CZK, 978 = EUR, 840 = USD, 826 = GBP, 643 =
RUB.
Indication of used card scheme product.
J V 2 - 10 Indication of card product
Example: Visa, Mastercard, etc.
Field contains information about terminal data asked to be printed on the ECR printer
Terminal prepares formatted receipt.
ID:
00 application decision what to print (e.g. can be selected from terminal MENU)
K N 2 Id of printed information
01 application parameters (min TID + comm data)
02 Receipt of the last financial transaction (merchant ticket)
03 Receipt of the last financial transaction (customer ticket)
04 EMV data of last transaction
05 - Subtotals
Field is a summary of transactions made sinc It
contains a constant prefix, numbers and sums of credit and debit transactions, as well
as Cashback withdrawals.
Format:
Prefix "001001"
Number of debit transactions 4-digit number
sign (+ / - ) and 18 digit number (last 2
Sum of amounts of debit transactions
digits are decimals)
Number of credit transactions 4-digit number
Sums of financial sign (+ / - ) and 18 digit number (last 2
L V 75 Sum of amounts of credit transactions
transactions digits are decimals)
Number of Cashbacks made 4-digit number
sign (+ / - ) and 18 digit number (last 2
Sum of Cashbacks made
digits are decimals)
Example:
“0010010002+0000000000002000000001+0000000000000100000001+000000000000030000”
Page 27 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Page 28 of 53
Offline Upload 11
Abort transaction 12 Timestamp is the same as current Trn
HOST Handshake 13
TMS connect 14
Token 15
POST data printing 16
Repeat Last Transaction 17 Timestamp is the same as original Trn
Variable Fare 18
VF Advice 19
Last TMS connect 20
Transaction cancellation 21 Enhanced Matching version
Preauthorization Completion 22 Enhanced Matching version
Sub-total 65
Close Totals 60
Code of Region in the Field contains code defining the transport region. This field is used by GPE transport
U AN 4
Czech Republic solution only. Example: region Praha, Kladno etc.
Field contains information of chip application ID with leading information. The value of
a AN 12-24 Application ID (AID) AID is set by card associations.
Examples: "A0000000031010" or "A0000000043060"
Gives the amount, which the customer wishes to withdraw. It is given without decimal
places and without a separator (decimal point).
b N 1 18 Cashback amount
Example: the amount "20000" is given for the amount 200.00 CZK or EUR (exception is
for Hungary, where it means 20000 HUF).
Field contains added data need for transaction cancellation. Format: TID, PAN,
Data for transaction
Sequence Number and date separated by ;
Cancellation,
TID - the terminal ID where the original transaction was created, available on original slip
Preauthorization completion
PAN - last four digits of the originally used PAN, available on original slip.
d AN 15-32 and Incremental
Sequence Number - of the original transaction, available on original slip. Sequence
Preauthorization -
Number is 9 bytes long, in future can be up to 16 bytes.
8];PAN[4];SQN[9-
Date - YYMMDD when the original transaction was initiated. Available on the original
16];DT[6
receipt or from stored data.
This code page is used for receipt printing, data sent in FID_t. Possible values are:
CodePage info for printing
f AN 10 ISO_8859-1
reasons
ISO_8859-2
Page 29 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
Sequence number
i N 9 (Preauthorization + Fix 9 numeric unique identifier used for Preauthorisation and its Completion.
Completion)
Fix 12 numeric unique identifier of the financial transaction. Date and time if the
n N 12 Id of transaction authorization is used in format RRMMDDHHMMSS. ECR uses this ID with unique TID
so the whole unique identification of transaction contains 20 alphanumeric characters.
Field contains additional text with information about response. Format of text:
Text1; # where ID can be response code
Extra Text with add.
q V 1 - 100 Last TMS connect transaction returns extra information about applications, versions
information
(without application ID, just major a minor version) and the last TMS connection date +
time in format RRMMDDHHMMSS. E GPE_PAY:0107;
Client ID (either FID_S or Field allows to add additional information related to transaction, which is then used to
s N 1-10
FID_s) check the transaction via non-cash payment.
Field contains preformatted text for the printing of the transaction receipt by the ECR.
The text is formatted into lines. Each line ends with a separator <LF > = 0x0A. The line
contains formatting characters and/or constant value or directive.
Size of field is variable (max size = 3 KB). In all versions of protocol (B0,B1,B2) fid_t [max
. In new version (B2) of protocol where
Device Messages are defined, fid_t can also be used in Device Messages for printing
on ECR.
Format character:
\c - following value (constant or directive) is centered on the line
\b - following value (constant or directive) is in bold
t AN 1 - 3072 Text for printing of receipt
\s - following value (constant or directive) is printed in narrow (42 chars per line)
Directive #:
#{value} - value is ID of FID used previously in message (FID_P, FID_a, or FID_J).
- value Z means TID[8] from message header
Directive $:
${value} - value is name of printed block. This block is loaded in ECR for all tickets
- value:
PAGE - move paper with ticket (equivalent to \n\n\n\n)
SEPAR - -------------
Page 30 of 53
ADDR - print address of merchant
CABA - print info text for Cash back
INFO - print info special text (not used)
Example1:
Example2:
**** **** **** 1204<LF > Exp Date: 1605<LF > ${SEPAR}<LF > AutorCode: 123456<LF
>
Page 31 of 53
Chapter 2: IMPLEMENTATION OF INTERFACE
If the value of the response code is from 0 to 10 including, then the transaction is
completed and accepted. If the value is different, message is not completed and is
rejected.
Page 32 of 53
3 VALUE ADDED SERVICES
GPE provides value added services to our customers to extend usage of payment
terminals for its business.
This chapter describes the additional information necessary to use EET functionality
of payment terminal. This part of document is designed according to Act
no.112/2016 Coll. [1]
There are several transactions which are extended by EET service and several new
EET transactions focused to cash operations. The EET transaction has to be registered
online only, but if a communication error occurs it can be registered in offline mode in
the terminal. These offline registered transactions must be uploaded to NEST (GPE
Gateway) as soon as possible. To keep the offline log of registered transactions only
in the terminals is highly risky. From that reason it is highly recommended to
implement replication backup also in an ECR. There are several levels of backup
described below (if you can accept appropriate degree of risk). For detailed information
about current implementation of offline level in the terminal please ask GPE.
Page 33 of 53
Chapter 3: VALUE ADDED SERVICES
No backup offline EET trx. in an ECR at all. In the case of terminal corruption all offline
1
transactions can be lost forever.
Offline registered transactions are store also in an ECR. If the terminal is corrupted the
HW can be changed regardless to EET offline transactions. These will be refreshed from
2
ECR backup during synchronize phase. The log will be cleared immediately after
successful close day (means executing close totals transaction).
All offline transactions are also stored in an ECR as the level 2, but the uploading of all
offline transactions are controlled and synchronized with an ECR. Online uploaded EET
3
transactions are returned as a list of EET trx. IDs. Offline records are cleared
consecutively at both devices.
1
This transaction is considered to use also for cashless transactions which are extended by EET service. The fid
n contains original timestamp of requested transaction.
Page 34 of 53
3.1.4 Fid definition
This table contains extended EET fids
Fid
Format Length Description
identifier
Collection of values which are separated to several parts according to EET
e collection Variable
requirements [2]. ([Link].1)
p N 1-4 Count of offline registered transactions (in terminal or in an ECR).
2 Max.
o List
AN (249) ; - ; -329.
j N 2 Original transaction type
2
fid o example: S1AP22350001160723141513;S1AP223500021607231
It is not possible to accept EET transaction due to full of offline EET log (RC =
301)
It is expected clear offline log using standard process which executes upload
offline EET transaction from ECR and terminal to GP-Gateway.
Page 35 of 53
Chapter 3: VALUE ADDED SERVICES
00 10 Accepted no changes
Manually by some key or menu on the ECR since new terminal installation
occurred.
Automatically due to check message response code is 300 (New HW) and the
ECR has stored unregistered offline transaction).
The manual approach is better apparently since no unwanted automatic sync. process
can be started. Using of this transaction has two possibilities according to parameter
transaction treatments in request from fid e. For the current level of imp. on the
terminal site please ask for GPE.
Refreshing transactions from an ECR offline EET log to terminal EET log. See
diagrams 1 and 2 below.
Forwarding transactions from an ECR offline EET log through the terminal to
GP-Gateway. See diagram 3 below.
Page 36 of 53
GP Gateway
ECR Terminal
ECR:Login POST:Closed
RQ:EET Synchronization
T[46], e[{00=2},{01},{02},{03},{04-16},
{17}], j[47], Store the EET
offline record in
Repeat Nx the POST
RS:EET Synchronization
T[46], R[000]
GP Gateway
ECR Terminal
Transaction registered
GP Gateway
ECR Terminal
RQ:EET Synchronization
There are some T[46], e[{00=3},{01},{02},{03},{04-16},
offline records {17}], j[48], Upload offline transaction
Close totals
RS:Close totals
T[60], R[000] Close totals
Page 37 of 53
Chapter 3: VALUE ADDED SERVICES
The sFids are separated by group separator <GS> (0x1D). Some subfids are
conditional relative to another subfid (see the table of sFids e). The structure is
Page 38 of 53
Format of the fid e
Request Response
sFid Description Format
mandatory mandatory
00 The EET transaction treatment (2.8.12) (2.8.11) (2.8.11)
01 A part of unique EET transaction ID AN (9-20) (2.8.11) (2.8.11)
02 Date and time of sales [YYMMDDhhmmss] N 12 (2.8.11) (2.8.11)
03 Total amount of sale N (1-12)
04 Total amount for performance exempted from VAT N (1-12)
05 Total tax base - basic VAT rate N (1-12)
06 Total VAT - basic VAT rate (Conditional to 05) N (1-12)
07 Total tax base - first reduced VAT rate N (1-12)
08 Total VAT - first reduced VAT rate (Conditional to 07) N (1-12)
09 Total tax base - second reduced VAT rate N (1-12)
10 Total VAT - second reduced VAT rate (Conditional to 09) N (1-12)
11 Total amount under the VAT scheme for travel service N (1-12)
Total amount under the VAT scheme for the sale of used
12 N (1-12)
goods - basic VAT rate
Total amount under the VAT scheme for the sale of used
13 N (1-12)
goods - first reduced VAT rate
Total amount under the VAT scheme for the sale of used
14 N (1-12)
goods - second reduced VAT rate
Total amount of payments intended for subsequent
15 N (1-12)
drawing or settlement
Total amount of payments which are payments
16 N (1-12)
subsequently drawn or settled
17 Type of registered payment (2.8.13) (2.8.11) (2.8.11)
18 Taxpayer's Signature Code (PKP) (2.8.14) (2.8.11) (2.8.11)
19 Taxpayer's Security Code (BKP) (2.8.14) (2.8.11) (2.8.11)
20 Fiscal Identification Code (FIK) (2.8.14) (2.8.11) (2.8.11)
Example of request uses EET fid e (amount 500.00 with combined payment method):
<FS>e<GS>0350000<GS>0441320<GS>05<GS>068680<GS>173<FS>
Page 39 of 53
Chapter 3: VALUE ADDED SERVICES
1 sFids are mandatory only if they are not automatically involved in the receipt text.
Id Method Description
Page 40 of 53
2 Bank card It was used bank card
3 Cash It was paid by cash
It was paid by gift card or loyalty
4 Gift card
card
5 meal ticket It was paid by meal tickets
6 Voucher The voucher was used
These sFids can be presented in the response message as sFid value (i.e. it can be a
placed on any location of ECR tickets) or it can be automatically involved in receipt fid
t, it depends on the terminal settings. If the codes are involved in receipt they will not
be placed in sFid e in response. Right place on the ticket can be leaded by directive
corresponding to particular name of code ${FIK}, ${BKP}, ${PKP} or they can be
rendered directly into the text without any leading marks or they can be returned
simply only as a value of sfids (18,19,20). All codes are in printable format.
BASE
FIK 39 Fiscal Identification Code
16
BASE
BKP 44 Taxpayer's Security Code
16
Examples:
FIK:b3a09b52-7c87-4014-a496-4c7a53cf9125-03
BKP:03ec1d0e-6d9f77fb-1d798ccb-f4739666-a4069bc3
BASE
PKP 344 Taxpayer's Signature Code
64
BASE
BKP 44 Taxpayer's Security Code
16
Examples:
BKP:03ec1d0e-6d9f77fb-1d798ccb-f4739666-a4069bc3
PKP: Ca8sTbURReQjjgcy/znXBKjPOnZof3AxWK5WySpyMrUXF0o7cz1BP6adQzktODKh2d8s
oAhn1R/S07lVDTa/6r9xTuI3NBH/+7YfYz/t92eb5Y6aNvLm6tXfOdE3C94EQmT0SEEz
9rInGXXP1whIKYX7K0HgVrxjdxCFkZF8Lt12XbahhAzJ47LcPxuBZZp6U6wJ2sWI5os3
KY9u/ZChzAUaCec7H56QwkMnu3U3Ftwi/YrxSzQZTmPTpFYKXnYanrFaLDJm+1/yg+VQ
ntoByBM+HeDXigBK+SHaxx+Nd0sSmm1Im4v685BRVdUId+4CobcnSQ3CBsjAhqmIrtWT
GQ==
Page 41 of 53
Chapter 3: VALUE ADDED SERVICES
If the EET service is activated on the terminal it will not be possible to use automatic
transaction Reversal since the EET transaction was successfully registered in the SFS.
From that reason the transaction Repeat Last Trn. must be used. If the ECR does not
receive response message in defined timeout ECR should send message Repeat Last
Trn. If there is no response also for Repeat Last Trn. request the transaction has to be
checked in the transaction system of provider payment services. There is not possible
to resolve this transaction automatically. The Repeat Last Trn. can be sent after all
timeouts expire on the terminal (default timeout is 60 [response]+2x15s[confirmation]
= 90s). If the ECR sends the Repeat Last Trn. earlier than the defined timeout limits
the terminal can replay by codes R108 (terminal busy) or it can repeat the original
response again according to current processing phase.
The negative response code informs that the requested transaction was not found in
log or terminal was not able to send Last Transaction Response due to unexpected
reasons. It is critical state since there is no possible to retrieved signature and secure
codes for a payment on a receipt.
Page 42 of 53
GP Gateway
ECR Terminal
Payment
RQ:EET Last repeat response Accepted all
T[17], n[160617….] timeouts
Payment expires
Confirmation
Accepted
RQ:EET Last repeat response T[17]
[R000], j[00], e[{00},..{20}]
Confirmation
Page 43 of 53
Chapter 4: APPENDICES
4 APPENDICES
4.1 Algorithm for calculating CRC16 in C language
The following code uses POST for calculating CRC16. Standard CCITT v.41 prescribes the
polynomial value: x^16 + x^12 + x^5 + 1.
// ====================================================================
// unsigned short calcCRC16(unsigned char *data, unsigned short len)
//
// In: data - pointer to data from which CRC16 is calculated
// len - length of data from which CRC16 is calculated
//
// Out: -
//
// Return: CRC16
Page 44 of 53
//
// Test: calcCRC16((unsigned char*) "123456", 6) => 20E4
// ====================================================================
unsigned short calcCRC16( unsigned char *data, unsigned short
dlen )
{
unsigned short crc16 = 0x0000;
unsigned short len = dlen;
if (!data || !len)
return crc16;
while(len --)
crc16 = (crc16 << 8) ^ ccittTable[(crc16 >> 8) ^ *data ++];
return crc16;
}
Female DB 9 RJ 12 6/6
2 - 2
3 - 3
8 - 4
7 - 5
5 - 6
Female DB 9 RJ 12 6/6
2 - 2
3 - 3
5 - 6
Page 45 of 53
Chapter 4: APPENDICES
Page 46 of 53
POST: Confirmation message(s)
<STX>B001S1APDA0514052613131700000000A5A5<ETX>
REVERSAL
Page 47 of 53
Chapter 4: APPENDICES
<FS>B1000<FS>T04<ETX>
PREAUTHORIZATION
PREAUTHORIZATION COMPLETION
Page 48 of 53
CLOSE TOTALS
Page 49 of 53
Chapter 4: APPENDICES
<STX>B001S1BP725809110618112000000000A5A5<ETX>
Revisions history
applies to:
version date modified description
AT CAT
13.00 01.03.2018 R. Bryx Complete user guide redesign and minor fixes
12.33 14.08.2017 P. Kotal Extended descriptions - -
Added Preauthorization completion transaction
12.32 07.08.2017 P. Kotal
support
Added QuasiCash transaction
12.31 25.07.2017 P. Perman
New response codes and note added
M. Trita Offline upload number of offline transactions to
12.30 06.06.2017 upload
P. Perman Close day new optional field U
12.29 11.05.2017 P. Kotal Add remark and information
Correction of transaction description
P. Kotal
12.28 28.04.2017
P. Perman
EET Revision
12.27 7/11/2016 M. Trita Last TMS connect
VF Advice transaction, U tag changed, response
12.26 30/08/2016 M. Trita
codes for transport transactions added
12.25 13/07/2016 EET specification additional information added
12.24 6/6/2016 M. Trita Transport Data, Variable Fare transaction
FIX - Correct format field A Language code, from N
12.23 26/4/2016 P. Kotal
to A
Corrections unattended
12.23 26/4/2016 P. Kotal
size = 3kB)
12.22 13/1/2016 P. Kotal
New
FID_N: Reference number definition added
12.21 28/04/2015 M. D
description of VAS removed
Changes for Hungary (amounts without decimal
places)
12.20 24/11/2014 M. D FID_B (amount)
FID_L (totals)
FID_b (cashback)
References
- CRC-16 CCITT v.41
- EIA RS-232
- Control characters / ASCII, ANSI X3.4, CCITT Recommendation V.3
Page 50 of 53
This document fully replaces the original protocol documentation for communication with the cash
register (Protocol_B_vX - where X is the version number).
Trace convention
In tracing the invisible signs are replaced by the indication of the sign (according to ASCII) in the square
brackets. Messages exceeding 1 line are divided and continue on the next line only after a tab.
Page 51 of 53
Chapter 4: APPENDICES
4.4 FAQ
Page 52 of 53
5 REFERENCES
1. Act no. 112/2016 Coll., - The exact wording of the law Czech Republic
2. Electronic Registration of Sales - [Link]
specifikace
Page 53 of 53