Skip to main content

EFR Rule Set

Important Information to the generic Interface

The API is a generic interface that can be used for all countries. If there are additional country-specific requirements, these are described in the country-specific guides. The generic interface is available from EFR version 2.5.0. The changes to the interface are backwards compatible.



Webservice Reference

EFR operates as local webserver on the cash register or within LAN. Local installation is recommended, otherwise the cash register could not issue fiscal receipts in case of network failure. Port 5618 is used for HTTP communication and UDP messaging (reserved with IANA).

Example URL: http://localhost:5618/register

Query Parameters, Request Body and Headers are specified, if needed. On GET requests commonly the body may be left empty.

By default query parameter names are not case sensitive. Be sure to encode special characters in parameter values (read more on w3schools.com).

Some requests can deliver XML or JSON response content. The format is choosen upon the request body format or is set to XML, if an optional request header accept: xml was set. Default response format is JSON.

Communication Workflow

After finishing processing positions and payment, the cashier application transfers resulting transaction data to the EFR for signing. The generated signature is to be printed on the sales slip.

The success status of the transactions registration with the EFR is returned within tag <Result>. The relevant information is ResultCode RC:

Result Code RCHTTP-StatuscodeReasonAction within frontend application
OK200 OKTransaction processd successfullyPrint receipt
BAD400 Bad RequestInvalid request dataTerminate transaction
Check transaction data
NO406 Not AcceptableCould not process transaction, another try at a later time might be successful thoughRetry Y/N

On "N" terminate transaction

EFR software will always will respond 200 OK when

  • Software installation was successful
  • The request complies with formal parameters (XML structure)
  • Local infrastructure is operational (i.e. hard disk)

Timing Considerations

EFR is designed to respond reliably within 10 seconds, so a request timeout of 10 sec should be set. Typically transaction registration with online fiscal systems will need about 1 sec for completion, local signature about 250 ms.

An exception to this behaviour are installations, where the transaction has to be printed over a Fiscal Printer (e.g. [IT, PL, SK,…] ). In this case, printout completion is awaited before response. Depending on printer speed and number of positions, the printout may require up to 30 sec. A delay also may occur when the paper out (and insertion of a new paper reel) is handled internally by printer firmware.

For fiscal printer installations there are following valid methods of interaction:

Without Timeout

Wait infinitely for /register response. In case of system crash, resend the transaction on restart (preferably with /restart instead of /register, duplicate detection operates more specific this way; see Restart Handling).

With Timeout

Set a timeout of 10000 ms on your request. In case of a timeout, use subsequent GET /last requests in a loop (e.g. once a second). During transaction processing HTTP status "423 Locked" is responded, after completion the usual registration response. If no response is received, the communication to EFR may be broken. After restoration perform Restart Handling (see 4.3 Restart Handling).

Full RFC 2518 Implementation

In this configuration a HTTP status 102 is given as interim response to inform the client, that the server has accepted the request, but not yet completed it. For this, enter the following string in the Profile field Attributes (see 6.1 profile.cfg | Attributes):

HttpServer_respond102=9000

The value represents the interim response interval in ms.

Good to know

At any time GET /last (or GET /last?\_=Tra, GET /state, GET /log) requests may be used, even during transaction processing. These requests are responded from cache and will not affect the system performance.

Restart Handling

It is essential to keep the fiscal system and the cash register database in parallel. A transaction has to be in both systems, or none of them. A classic test case is the start of a transaction and power loss before completion. In this case the EFR expects the repetition of the last transaction immediately after restart. If the transaction had been processed before, the registration result is delivered, else the whole registration is performed.

To initiate this restart behaviour use WebRequest /restart instead of /register.

If the transaction was registered successfully before, the result is returned containing the notification #DUPLICATE:

<TraC SQ="2345">
<Result RC="OK">
<ErrorCode>#DUPLICATE</ErrorCode>
</Result>
<Fis>…
</TraC>

Cfg - Configuration

The configuration must be sent before the first transaction. It is recommended to send the configuration to the EFR service every time the cash register is started in order to keep it up to date. The individual parts of the configuration are described in the following tables.

Cmp - Company

NameDescriptionCountryExample
NamCompany name"My Company"
labelCompany short name for digital receipt"MyComp"
AdrCompany address"Street"
AdrNrStreet number"3"
ZipPostcode"1000"
CityCity"City"
CtryCountry ISO-3166"XY"
TaxIdIntra community VAT identifier. Please configure the tax id in the profile"XY99999999999"
TINTax Identification e.g.: "Steuernummer"DE"123456789"
OrgOrganization number assigned by Swedish tax authority, required for CCU enrollment and usage. Format: NNNNNN-NNNNSE"373737-3737"
VATonPaymentVAT chargeable on receipt of payment (default: on issuance of invoice)FR0
FR_NAFCode NAF/APE / Activity Type Code in FranceFR"47.11D"
FR_SRNSIREN / Business Register IdentifierFR"732 829 32"
FR_RCSLieu d'immatriculation + lettre "A" ou "B" (commerce ou société) / City of Registration + CategoryFR"PARIS A"
FR_TYPELegal FormFR"XXX"
FR_CAPITALSocial CapitalFR"XXX"
FR_METIERTrades Directory Registration NumberFR"XXX"

Loc - Location

NameDescriptionCountryExample
TLTransaction Location code / store number"001"
NamLocation name"My Location"
labelLocation name Location short name for bill.efsta"MyLoc"
AdrStore address"Long Road"
AdrNrStreet number"123"
ZipPostcode"12345"
CityCity"Metropolis"
StateState/Region"XXX"
CtryCountry ISO-3166"XY"
TaxIdIntra community VAT identifier"XY99999999999"
FR_SIRSIRET / Geographic Identification of a French EstablishmentFR"732 829 320 0007"

Trm - Terminal

NameDescriptionCountryExample
TTTransaction Terminal code / number of cash register"1"
SWPOS software name"My POS Software"
SWVersionSoftware VersionDE, FR, SE"3.2.7"
HWHardware brand"POS Brand"
HWModelHardware modelDE, SE"POS Model"
SerialHardware serial number"POS serial number"

Doc - e-Invoicing

NameDescriptionExample
ContactNameContact Name of the Sender"Invoicing Department"
ContactTelephoneContact Phone Number of the sender"123456789"
ContactElectronicMailEMail address of the sender"office@efsta.eu"
PaymentTermsTerms of the payment"30 days net"
PaymentPeriodTerms of the payment in days (payment deadline)30
AccountNameBank account holder"my company"
AccountIBANIBAN of the bank account"AT00000000000000000000"
AccountBICBIC of the bank account"ASPAKAT2LXXX"

Dev - Input Devices

NameDescriptionCountryExample
IdInput Device IdentificationDE"1"
HWInput Device Hardware brandDE"Dev Brand"
HWModelInput Device Hardware modelDE"Dev Model"
SWInput Device Sofware nameDE"My Dev Software"
SWVersionInput Device Software versionDE"1.5.7"
SerialInput Device SerialDE"POS serial number"

DE_Agentur - Agency

NameDescriptionCountryExample
IdAgency IdentificationDE"1"
NamAgency NameDE"Test Company"
AdrAgency AdrDE"177 Long Road"
ZipAgency PostcodeDE"12345"
CityAgency CityDE"Metropolis"
CtryAgency Country ISO-3166DE"XY"
TaxIdAgency Intra community VAT identifierDE"XY99999999999"

ESR – "efsta Simple Receipt" Format

This section describes the standard elements. Beyond these the XML document may contain company specific additional elements and fields. Please note that the list of standardized elements may be extended, in this case only 1 to 4-letter tag names are used. Consequently we advise that for additional tags at least 5-letter denominations or separate XML-namespaces be used.

note

All amounts (Datatype Currency) within the datasets shall be local currency except otherwise noted.

License

The "efsta Simple Receipt" format described in this chapter is intellectual property of efsta and is licensed under the terms of GNU General Public License (GPL).

It may be used freely, provided the following provisions are kept:

  • Denomination of the format remains ESR "efsta Simple Receipt"
  • Extensions as such conform to the formal rules of ESR (attribute names at least 5 letters length)
  • Publicly accessible storage systems (Internet) must provide suitable access control to personal vouchers or receipts

Request Tra (Transaction)

Registration of a sales transaction.

ESR Elements

AttributeNameDescriptionDatatypeMandatory
efsta Simple ReceiptReceipt BodyMANDATORY
DDate TimeDate Time
Seconds have to be specified according to fiscal law
Example: "2016-08-01T13:28:22"
DateTimeMANDATORY

Default:
system time
D0Date Time StartTimestamp of the process start
Example: "2016-08-01T13:28:22"
DateTime[DE]
Flag-Germany
TaxIdVAT NumberImportant for centralized multi company multi client EFR installations with RN__TT=true

Example: "DE123456789"
TextOptional
TLTransaction LocationBusiness Premise / Store ID
Has to be unique within a company. For compatibility, if omitted TL is extracted from TT, e.g.:

TT="44/7" =>
TL="44" TT="7"

Example: "4012"
Text
TTTransaction TerminalCash Register Terminal Number
Has to be unique within TL.
TL+"/"+TT is used as unique terminal identification within a Company

Example: "7"
TextMANDATORY

Default: '1'
TNTransaction NumberSequential receipt number
If only fiscally mandatory transactions are registered, continuous (gapless) sequence of receipt numbers has to be shown by TLOG of the cashier system

Default: TN is incremented automatically starting with "1".

Example: "450023"
TextMANDATORY

Default: autoincrement
TTotalAmount of total sum of collected means of payment

Can be omitted for nonfiscal transactions

Default: for fiscal transactions total of TaxA\[\] or PosA\[\] amounts respectively.

Example: "123.00"
CurrencyRecommended

Default: sum(PosA\[\].Amt)
TaxNNet Tax FlagPositions are Net Tax, tax is added at end of printout
Not supported in all countries!

Example: "1"
Boolean
0/1
OprOperator IDOperator-IDText[DE] [FR]
OprNOperator NameOperator-NameText[DE]
DTDocument TypeIndicates a class of document, controls fiscal treatment of transaction; Viable for Fiscal, NF, NFS; not defined = fiscal

Example: "Fiscal, ticket, invoice"
Text[FR]
DNDocument numberSequential number;
Number range is of a specific document type DT, e.g. invoice number; additional to TN

Example: "A23"
Text
DDDocument DeliverySets the delivery method for this transaction. (see there)

Example: "Email, digital, noprint"
Text
NFNonfiscal Transaction TypeThis attribute denominates nonfiscal transaction (e.g. balance | closure, operator login/logout, payin/payout). These are registered in the receipt journal so the sequence of receipt numbers TN is gapless, but not added to the fiscal Grand Totals.

Example: "PAYIN"
Text[DE]
NFSNonfiscal SignedEqual to NF, but a fiscal signature is applied if required by law

Example: "TRAINING"
TextMANDATORY
(except [CZ] [HR] [SI])
VoidVoid TransactionA transaction registered before is voided; usually amount fields (except Pos.Pri) are negative. Specify ESR.RD, RTL, RTT, RTN

Example: "1"
Boolean
0/1
[AT] [DE]
TestTest / Training TransactionTraining transactions are sent to the fiscal system marked as "test".

The Response <Fis> element then contains a "*** TEST ***" info tag.

Example: "1"
Boolean
0/1
[AT] [FR]
RFNReference Fiscal NumberNeeded in some countries in case of return or void as reference to original saleText [IT] [PT] [SK]
TPTransaction PointPoint of transaction (e.g. table number, department)
Example: "Tisch 5"
Text[DE]
RsnReasonReason text for exceptional transaction, position or modifier, e.g. reason for return of goods, reprint

Example: "Erreur d'imprimante"
Text[FR] [PT]
BE_OperatorIdOperatorSocial Security Number of employee (NISS/INSZ)

Required only if value differs from field Opr

Example: "79100590097"
Number[BE]
CZ_id_provozBusiness premise IDCan also be specified in EFR profileText[CZ]
FR_OperationTypeOperation Type"Vente" or "Remboursement"

Depending on ESR.T signum
Text[FR]
FR_TrainerTrainer / SupervisorFiscal regulations require the ID of the trainer/supervisor to be stored with the training transactionText[FR]
HR_OibOperOperatorTax Number
Default: specify in EFR profile
Text[HR]
HR_SpecNamjAdditional Invoice InformationText[HR]
SI_OperatorTaxNumberOperatorTax NumberText[SI]
SK_ParagonNumberParagon NumberNumber of ParagonText[SK]

Ctm Elements

AttributeNameDescriptionDatatypeMandatory
CustomerCustomer data
If registered for invoice or if required by law
[DE] [FR] [IT] [PL]
NamNameCustomer or Company NameText[DE] [FR]
Nam2Name 2Name ExtensionText[DE]
AdrAddressCustomer or Company Address within CityText[DE]
Adr2Address 2Address ExtensionText[DE]
AdrNrAddress NumberStreet number"Text[DE]
ZipPostal CodeAccording to national rules without country prefixText[DE] [FR]
CityCityCity NameText[DE]
CtryCountryCountry ISO 3166 ALPHA-2Text[DE]
TaxIdVAT NumberCustomer or Company VAT Number including eventual country prefixText[DE] [FR]
CNCustomer NumberNumber of the CustomerText[DE]
CatCategoryCategory of the CustomerText[DE]
FR_SIRSIRETFor B2B invoices
see NF525
Text[FR]
FR_SRNSIRENFor B2B invoices
see NF525
Text[FR]
FR_NAFNAF/APEFor B2B invoices
see NF525
Text[FR]
IT_CodiceLotteriaLottery CodeCustomers lottery codeText[IT]

POS Elements

AttributeNameDescriptionDatatypeMandatory
PositionPosition element
PTYPosition TypeIf not "Pos", e.g. "Mod"
accepted methods to set:

<PosA><Mod …
<PosA><Pos PTY="Mod" …
"PosA":\["\_":"Mod",…
"PosA":\["PTY":"Mod",...

Examples: "Mod", "Dep", "Vou", "Adv", "Tip", "FoC"
Text
PNPosition
Number
Modifier positions PTY="Mod" may refer to multiple positions, e.g. PN="\*"
Examples: PN="1", PN="\*"
TextRecommended
INItem
Number
Public article number
(GTIN, EAN, UPC)
Text[FR]
invoice
(Others: Recommended)
IDItem
Identity
Serial or batch numberText
SKUStock Keeping UnitArticle number
DscDescriptionUsual denomination of goods or servicesTextMANDATORY
TaxGTax GroupTax group
Usually tax groups are identified by letters or numerals. If an article besides VAT tax group is attributed other tax groups, these can be noted as an array (delimiter: space)

Examples: "B", "B N"
Text[]MANDATORY
AmtPosition
Amount
Position amount
(Qty*Pri)
Example: "199.00"
CurrencyMANDATORY
QtyQuantityQuantity
Qty="1" may be omitted if QtyU="pc" or lump sums

default value used: Math.sign(parseFloat(Amt))
DecimalMANDATORY
QtyUQuantity
Unit
Quantity Unit
QtyU="pc" ("piece") may be omitted.
Text
PriUnit PricePrice per Unit
may be omitted if Qty="1" or Qty="-1" and QtyU="pc"
Currency
NotePosition NoteIndividual position text
Replaces deprecated field Pos.Info
Text
VoidPosition VoidVoid of position within same receiptBoolean
0/1
Recommended
RFNReference Fiscal NumberNeeded in some countries in case of return or void as reference to original saleText[IT] [SK]
VouNVoucher NumberUnique number of voucherText
DevDeviceID of the capture deviceText[DE]
InHinhouseInhouse consumption flagBoolean
0/1
[DE]
DE_AGENTUR_IDAgency IDID of the agency
Example: "123"
Integer[DE]
CatCategory IDID of the CategoryText[BE] [DE]
CatNCategory nameName / description of the CategoryText[BE] [DE]
RD*Reference Date TimeReference to the original transaction

If the whole transaction is voided, specify reference fields directly in ESR object.
RTL*Reference Transaction LocationReference to the original transaction

If the whole transaction is voided, specify reference fields directly in ESR object.
RTT*Reference Transaction TerminalReference to the original transaction

If the whole transaction is voided, specify reference fields directly in ESR object.
RTN*Reference Transaction NumberReference to the original transaction

If the whole transaction is voided, specify reference fields directly in ESR object.
RPN*Reference Position NumberReference to the original transaction

If the whole transaction is voided, specify reference fields directly in ESR object.
RsnReasonReturn reason for SAF-T exportText[PT]
PT_TaxExemptionCodeExemption
Code
If not specified in field TaxG, alternatively this field can be used
Example: "M11"
Text

M01-M99
[PT]
PT_TaxExemptionReasonExemption
Reason
For printing and SAF-T override tax table exemption description as in [PT] country guide
Example: "Regime particular do tabaco"
Text[PT]
SK_SellerIdTypeSeller ID TypeType of the Seller ID.

Allowed Values:
NONE
IC_DPH
DIC
Text[SK]
SK_SellerIdSeller IDText[SK]
SK_SpecialRegulationSpecial RegulationA flag that specifies which "reason" tax allocation of 0, if the item is assignedText[SK]
SK_InvoiceNumberInvoice NumberText[SK]

Mod Elements

AttributeNameDescriptionDatatypeMandatory
ModifierDiscount/Uplift on position(s)
PNPosition
Number
Reference to Pos.PN

Default: previous position
(position discount)

"*": all positions
(discount on subtotal/total)

Multiple position numbers may referred as range (from-to) or space delimited array

Examples: "1", "1-3", "", "1 2 7"*
Text
DscDescriptionDescription to be printedText[DE]
PrcPercentRebate percentage for printing
Example: "10", "10%"
Text
CatCategoryDiscount code
To be used in reports
Example: "DISC002"
Text[BE]
AmtModifier
Amount
Amount
Negative: rebate or discount
Positive: markup
Example: "-50.00"
CurrencyMANDATORY

Lin Elements

AttributeNameDescriptionDatatype
Print LinePrint line
PNPosition
Number
The print line may be attributed to a position. Usually the print line is attributed to the last position or payment line.
Example: "1"
Integer
DscDescriptionText in description columnText
LAmtLine AmountText in amount column, can show subtotal amountText

Pay Elements

AttributeNameDescriptionDatatypeMandatory
PaymentPayment line
DscDescriptionDenomination of payment method
Example: "Cash"
Text[DE]
AmtPayment
Amount
Amount paid
Example: "735.00"
CurrencyMANDATORY
UIDUnique
Identifier
Unique payment identifier
Electronic payment or document reference
Text
PayGPayment GroupMethod/category of payment as required in some countries - details see country EFR Guide

For convenience use ESR standard codes (See Payment Groups)
Text[DE] [HR] [PT]
CCForeign Currency CodeForeign currency code ISO 4217 (3 characters)
Example: "CHF"
Text
FAmtForeign AmountAmount of the foreign payment
Example: "100.00"
Currency

Tax Elements

AttributeNameDescriptionDatatypeMandatory
Tax LineTax element
TaxGTax GroupTax group
Example: "A"
TextMANDATORY
PrcTax PercentTax percentage
Examples: "21", "0"
DecimalMANDATORY
NetExcluding TaxNet (excl. Tax)
Example: "165.29"
Currency
TAmtTax AmountTax amount
Example: "34.71"
Currency
AmtIncluding TaxGross amount (incl. Tax)
Example: "200.00"
CurrencyMANDATORY

Other Elements

ElementNameDescriptionDatatypeMandatory
HeadHeaderRunning text head
TxtTextText blockText
PosAPosition
Array
Array of position linesMANDATORY
(except [AT] [CZ] [HR])
PayAPayment ArrayArray payment elementsMANDATORY
(except [AT] [CZ] [FR])
TaxATax ArrayArray tax elements
Auto-generated if ESR.PosA is available
MANDATORY
(except [IT] [PL] [SK])
FootFooterRunning text footer
TxtTextText blockText

*Reference attributes only for void/reversal or return-of-good positions (usually in combination with negative Qty)

info

Country specific fiscal regulations may require addtional fields to be delivered. Refer to country specific documentation for details.

Response TraC (Tra Completion)

Response for a fiscal sale transaction:

ElementNameDescriptionDatatypeCountriesExample
TraC
([DE]: TraSC / TraUC / TraVC)
Transaction CompletionResponse to a Tra-command
SQ (attribute)Sequence NumberSQ is incremented on each successful registrationInteger1
ResultRegistration ResultResult of a registration
RC (attribute)Result CodeCode for program control

OK: registered
NO: not registered (fixable)
BAD: not registered (termination)
OK,
BAD,
NO
"OK"
ErrorCodeError CodeError Code according to list of error constants. In combination with RC="OK" this is to be understood as a warning (e.g. "#DUPLICATE" when restarting a registration)Text"#OFFLINE"
UserMessageUser MessageInformation for the operator
(local language)

Must be displayed by the foreground application if present!
Text"Systémem EET offline"
WarningDebug
Message
Error Debug information (english)Text[]
FisFiscal DataFiscal Signature
DDate TimeDate and time of fiscal deviceDateTime[IT] [PL] [SK]
FNFiscal NumberFiscal number created by fiscal deviceText[IT] [PL] [SK]
DNDocument NumberReceipt number created by fiscal deviceInteger[IT] [SK]
ZIZ-IndexIndex of current Z-report of fiscal deviceInteger[IT] [PL]
IDDevice SerialSerial number of fiscal deviceText[IT] [PL]
OKPVerification CodeText[SK]
TypeTransaction TypeType of the transactionText[DE]
TIDTransaction IDID of a transaction coming from TSEInteger[DE]
CodeQR Code DataData for a possible QR codeText[AT] [DE]
LinkLinkefsta link for printing instead of QR codeText[AT]
PayloadSignature PayloadText[FR]
SignatureSignatureText[FR]
TagFiscal TagFiscal text
To be printed on the sales slip according to fiscal regulation
NameField NameField name for computation in the foreground application (for optional saving by the cashier application)Text"Sign"
ValueField ValueField ValueText"987a6be5-6af5-44f3-b4fc-987654321000-03"
LabelField LabelDenomination of the Field on the print-out
(in local language, may be empty)
Text"FIK"
ZZ DataEnd of day data of fiscal device[IT] [PL]
TZ TotalEnd of day totalCurrency[IT] [PL]
CAmtCredit AmountEnd of day return / void amountCurrency[IT]
LastDDate TimeTime of last Z-reportDateTime[IT]
LastSQLast Sequence NumberSequence number of last Z-reportInteger[IT]
ZTaxZ Tax DataEnd of Day Tax Data of fiscal device[IT] [PL]
TaxGTax GroupTax GroupText[IT] [PL]
TaxITax IndexTax Index of fiscal deviceInteger[IT] [PL]
PrcPercentPercentage of tax group / tax indexDecimal[IT] [PL]
TAmtTax AmountTax AmountCurrency[IT] [PL]
AmtAmountTotal amount of tax group / tax indexCurrency[IT] [PL]
note

Main program flow is controlled by ResultCode RC.

<ErrorCode> may contain additional information

<Warning> elements provide debugging information for interface developers respectively cashier support. These serve for informational purposes only, success of registration of a transaction is expressed within ResultCode RC only.

Payment Groups - Pay.PayG

In many countries the type of payment has to be specified per payment line for the fiscal printer or subsequent export. You may always use the national coding rules as given in the EFR Country Guide documentation, but you can also use the following efsta constants for all countries, which then are translated accordingly:

efsta PayG+\-DescriptionExamples, local naming
cash+Payment in local currency (coins, notes)Bar
change-Change money in case of overpayment, usually negative
e.g. total € 9.00: cash € 10.00, change € -1.00
Rückgeld
refund-Money paid back on return of goods, usually negative
atm+Cash withdrawal
foreign+Foreign currency, Pay.Amt is local currency, also specify
- currency code Pay.CC and

- foreign currency amount Pay.FAmt
CHF
debitcard+Electronic bank card payment, also specify
- unique transfer ID Pay.UID
EFT, EC, Giro, Maestro, ATM card
mobile+Mobile phone app
creditcard+Electronic credit card payment, also specify
- unique transfer ID Pay.UID
Visa, Master, American, Diners, JCB
openOpen item, e.g. commercial invoice/billPos.OpI
creditnoteIssue or redemption of a credit note
voucher+Redemption of a multi purpose vouchergift card or cheque
loyalty+Fidelity pointscoupon
title+Compensation title (digital or paper),

e.g. meal voucher
Sodexo
check+Bank checkcheck
roundingAutomatic rounding applied for cash payment

+ = payment
- = return

Tax Group Assignment - TaxG

Depending on the capabilities of the sender program there are different methods specifying tax groups within the ESR structure.

  1. Set field PosA/Pos/@TaxG according to the tax group definition in the country EFR Guide (e.g. "A" to "E"), omit TaxA array; for each position the predefined tax rate is taken, the TaxA/Tax elements are computed automatically, values TaxA/Tax/@Amt are added to the fiscal turnover.

    ESR Example:

    <PosA>  
    <Pos … TaxG="A"/>
    </PosA>
  2. Load tax rate in PosA/Pos/TaxG, e.g. TaxG="20%", omit TaxA; array TaxA is computed automatically, Tax Group is matched over tax rate percentage. With this method a percentage mismatch may occur in fiscal countries requiring exact tax group reference (e.g. [AT]), because for example PosA/Pos/@TaxG="21%" is not referring to predefined "20%".

    ESR Example:

    <PosA>  
    <Pos … TaxG="20%"/>
    </PosA>
  3. Set position PosA/Pos/@TaxG according to TaxA/Tax/@TaxG, specify tax rate in TaxA/Tax/@Prc; In this case the field value in TaxG serves only as link between both elements, so the naming can be selected freely. In fiscal countries with exact tax group reference (e.g. [AT]) the matching is done upon TaxA/Tax/@Prc. The fiscal turnover is determined by TaxA/Tax/@Amt.

    ESR Example:

    <PosA>  
    <Pos … Amt="123.45" TaxG="XY"/>
    </PosA>
    <TaxA>
    <Tax TaxG="XY" Prc="20" Amt="123.45" …/>
    </TaxA>

Automatic Value Assignment D and TN

If not provided by the cash register application, Date D (system time) and receipt number TN (serial number, on change of year beginning with 1) are generated automatically by the EFR and returned within the response.

Request:

<Tra>
<ESR T="1.49">
<PosA>
<Pos PN="1" IN="4012345678901" Dsc="Hesp.-Essig" TaxG="B" Amt="1.99"/>
<Mod PN="1" Dsc="Aktionsnachlass" Amt="-0.50"/>
</PosA>
<TaxA>
<Tax TaxG="B" Prc="10" Net="1.35" TAmt="0.14" Amt="1.49"/>
</TaxA>
</ESR>
</Tra>

Response

<TraC SQ="1234">
<Result RC="OK"/>
<ESR D="2016-03-01T14:46:43" TN="39"/>
...

ESR Validation Rules

  • Total of position elements PosA/\*/@Amt equals transaction total ESR/@T
  • Total of payment elements PayA/\*/@Amt equals transaction total
  • Total of tax elements TaxA/\*/@Amt (including tax) equals transaction total
  • For each tax element TaxA/Tax: @Net + @TAmt = @Amt
  • Amount in PosA/Lin/@LAmt is used for transaction display only (e.g. subtotal), not regarded in any computation
  • In position elements PosA/\* fields quantity PosA/\*/@Qty and price per piece PosA/\*/@Pri may be skipped in case of PosA/\*/@Qty=1
  • Assign position modifiers PosA/Mod (discount, rebate, addition) to their relevant position(s) PosA/\*/@PN using @PN, internally aliquot modification
  • Position elements PosA/\*/@Amt per tax group PosA/\*/@TaxG modified by PosA/Mod/@Amt assigned equal tax element amount TaxA/Tax/@Amt per tax group TaxA/Tax/@TaxG

Numbering of Documents

Bookkeeping systems always require an ascending number for each document issued (e.g. receipt / ticket / invoice), being unique at least within the year of creation.

Transaction Number TN

Usually, the POS system identifies fiscal and nonfiscal transactions with a Transaction Number TN assigned incrementally (e.g. per year or within a recurring number range of 00001-99999). Assuming that the company is using more than one cash register, transaction numbers are emitted per POS (Transaction Terminal TT), if multiple business premises (stores, locations) are driven also per Transaction Location TL.

The full unique document identifier is then TL/TT/TN, e.g. "001/1/1234".

If TN is omitted in the "Tra" request, EFR automatically assigns a number incrementally.

Fiscal Number FN

Fiscal Number FN is allocated for each fiscal (=sales) transaction according to country specific fiscal rules, the format of the field varies. It has to be printed on the document and stored on POS side with each transaction.

Good to know

In some countries, TL/TT/TN is used as unique transaction identifier, no separate FN exists (e.g. in [AT]).

Reference to a Document

The number assigned to a transaction is relevant on return of goods or void transactions. Here, the original transaction has to be referred to by specifying RTL/RTT/RTN or RFN to avoid double return or void.

Internal SQ

SQ is a SeQuel number used internally by EFR and efsta cloud for synchronization. A strictly ascending number is assigned to each data record in journal files .../\*.jou. One journal file contains 1000 records and is named after the number range it contains (SQ 1000-1999; e.g. "0001.jou"). SQ is independent of TN and FN, and as it is for internal use only, there is no need to print it or store it at POS side.

Directory Structure /EFR

By default EFR data is kept in the following directories:

Windows

C:\\ProgramData\\EFR

Linux

/home/efr

note

A different path can be choosen on EFR program startup:
C:\\ProgramData\\EFR> node app/app –RootPath D:/EFR

Good to know

Directories are created on demand.

DirectoryContent
/appApplication folder
/cerCertificate storage:
Certificates of smart cards, Company public key (for encryption)
/gblGlobal configuration:
profile.cfg, regmain.xml
/logProcess logging
/rnMain directory for clients
/rn/defRegister Number RN def (default)
/rn/def/cfgRN configuration
/rn/def/datRN totals
/rn/def/jouJournal storage
('Transaction Journal', [AT] 'Datenerfassungsprotokoll')
/rn/def/logTransaction logging in case of error
/rn/def/retry[CZ, HR, SI] optional directory for offline transactions waiting for retry
/reqOptional request directory for File Interface - FileWatch (p. )
/resOptional response directory

Storage Management

Actions on Software Installation / Uninstall

On installation the basic directory structure is created on default RootPath, subdirectories are created when required. If EFR is uninstalled the software is removed, but data folders are kept! Legal relevant data may not be discarded automatically, please delete manually after having assured its backup.

Storage Transaction Capacity

By default an EFR is allowed to keep 1000 MB of data on disk, this value can be modified setting parameter DiskQuota in /profile. Space consumption is checked once per hour and in case of overrun old .log files are deleted, transaction journal files .jou are gzipped to .jou.gz, old .jou.gz are deleted. Files modified within the last 3 months are always kept. Therefore the EFR should run online with cloud backup or in offline mode a periodic backup using /backup request or via file system has to be established. The number of transactions which can be kept locally mainly depends on the configuration of the DiskQuota and the average length of one transaction. Here's a short calculation using typical values:

DiskQuota: 1000 MB
Application space: approx. 100 MB
Remainder for transaction data: 900 MB
Mean transaction length: assumed 2 KB
Capacity: 450000 transactions

Good to know

Transaction journal files (.jou) are zipped automatically (to .jou.gz) as soon as the threshold of 80% DiskQuota is reached. Capacity with compressed files: 2000000 transactions

EFR Versioning

EFR is intended to be under permanent development as a result of adapting to national regulations and implementation of new countries and functions. Development is performed in an agile, common multi country environment, resulting in new minor versions per sprint, typically every 1-2 months. In the meantime, "hotfixes" may be released to respond to urgent demands.

Version Numbering Scheme:

EFR v2.3.4.5
Means platform: 2, major: 3, minor: 4, hotfix: 5

Part_e.g.Description
platform2Denotes the nodejs platform version and basic runtime environment, it usually does not affect program functionality.
From REST client perspective v1.13.4.5 == v2.3.4.5.

Following platforms exist:
1 … node v4.4.4, source in minified .js
2 … node v10.15.3, launch with boot.node, source in EFR.zip
3 … node v12.19.0, launch with boot.js, compiled source in EFR.zip
major3A new major version shows a possible change in the program API.
Although most widely compatibility in interfaces is aimed, new functions or legal requirements may cause minor changes.
Refer to changelog for details, and testing on software partner side is strongly recommended!
minor4A new sprint will contain bugfixes and new (country) functionality
No general testing required.
hotfix
(optional)
5Like a minor version a hotfix contains bugfixes and new (country) functionality
It is released on demand for one or more countries
appendix
(optional)
BUsed for beta versions, which always are provided for a specific customer only
info

Release of platform 3 is planned for 2025

Because all country versions of EFR use common base modules, EFR version numbering is performed independently of country modules. Since new versions may not be of interest for all countries, on the download page public.efsta.net the different latest versions are listed for each country individually.

A complete history of relevant changes to the program can be found in file CHANGELOG.md in EFR.zip (or can be downloaded from http://localhost:5618/changelog ).