Skip to main content

EFR API

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.



This collection of EFR API requests are all the API requests needed to send transaction data, add/edit company data, or administer the EFR. REGISTER and CFG are mandatory to use the EFR. In fiscal printer countries, PERI is required to directly print and request printer related data required for these countries. All other API requests can be used as additional functionality for your system. The recommanded workflow can be found at Communication Workflow.

If you have any comments or questions to this document please contact us at: ticket@efsta.eu

Important

If the EFR is used for multiple companies (see EFR Architecture) the ESR.TaxId must be sent in all /register requests.

If the EFR is used for muliple POS systems the query parameter "rn" must be sent for all request (except /register). The rn consists of TaxId$TL_TT
e.g.: GET localhost:5618/cfg?rn=DE123456789$1_1

Register

This route is used to register transactions (e.g. sales, invoices, payment transactions,...) to the EFR journal. The Format for all business cases can be found at Business Cases.

POST /register

Body

Content-Type: text/xml or application/json

note

The strucure of the ESR format can be found at ESR format and the values for the payment group are descript at Payment groups.

First Sample Transaction
<Tra>
<ESR D="2024-06-01T08:30:15" TL="001" TT="1" TN="1" T="8.38">
<PosA>
<Pos PN="1" IN="1001" Dsc="Example Item" TaxG="A" Amt="3.98" />
<Pos PN="2" IN="1020" Dsc="Example Item" TaxG="B" Amt="1.50" />
<Pos PN="3" IN="1030" Dsc="Example Item" TaxG="A" Amt="2.90" />
</PosA>
<PayA>
<Pay Dsc="Example Payment" PayG="cash" Amt="10.00" />
<Pay Dsc="Example Change" PayG="change" Amt="-1.62" />
</PayA>
<TaxA>
<Tax TaxG="A" Prc="19" Net="5.78" TAmt="1.10" Amt="6.88"/>
<Tax TaxG="B" Prc="7" Net="1.40" TAmt="0.10" Amt="1.50"/>
</TaxA>
</ESR>
</Tra>
Response Example

The structure of the EFR response can be found at Response TraC

<TraC SQ="1537030">
<Result RC="OK"/>
<ESR D="2024-08-01T10:50:30" FN="001/1/1"/>
<Fis TID="3">
<Code>V0;001/1;Kassenbeleg-V1;Beleg^6.88_1.50_0.00_0.00_0.00^8.38:Bar;3;7;2024-08-01T08:50:30.000Z;...</Code>
<Tag Label="TrNr:" Value="3" Name="TID"/>
<Tag Label="Beg.:" Value="2024-08-01 10:50:30" Name="StartD"/>
<Tag Label="Ende:" Value="2024-08-01 10:50:30" Name="FinishD"/>
<Tag Label="TSE :" Value="0123456789abcdef0..." Name="Serial"/>
<Tag Label="SigZ:" Value="7" Name="SignCnt"/>
<Tag Label="Sign:" Value="aT775OTya1SXEGceVO2raDlRHv..." Name="Sign"/>
</Fis>
</TraC>
Important

If the EFR return the value of Fis.Code, it must be printed on the receipt as QR-code / barcode. If the EFR return Fis.Tag elements, all elements must be printed on the receipt (Label + Value).


Cfg - Base data/company header data

Before sending the first transaction the company header sales data should be configured. This can be done manually, via request or certralized via efsta portal.

Good to know

For centralized administration configuration data can be set using the efsta portal, data is replicated to the EFR instances. If the central configuration is used, neither manual configuration nor programmatic configuration is necessary.

Manual configuration

Navigate to http://localhost:5618 in your browser and open “Basisdata” (base data). Enter the field values required, data is replicated to EFSTA cloud.

Programmatic configuration

This request should be issued once on startup of the frontend application to update receipt header fields like company name or location address. If values are unchanged, the request is without effect. It is mandatory to set this data before registering the first transaction. The strucure of the ESR format can be found at Cfg - Configuration

Get cfg data:

GET /cfg

Set cfg data:

POST /cfg

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1
Body
{
"Cfg": {
"Cmp": {
"Nam": "My Company",
"label": "MyComp",
"Adr": "Street",
"AdrNr": "3",
"Zip": "1000",
"City": "City",
"Ctry": "XY",
"TaxId": "XY99999999999",
"TIN": "123456789",
"Org": "",
"VATonPayment": 0,
"FR_NAF": "47.11D",
"FR_SRN": "732 829 32",
"FR_RCS": "PARIS A",
"FR_TYPE": "XXX",
"FR_CAPITAL": "XXX",
"FR_METIER": "XXX"
},
"Loc": {
"TL": "001",
"Nam": "My Location",
"label": "MyLoc",
"Adr": "123 Long Road",
"Zip": "12345",
"City": "Metropolis",
"State": "XXX",
"Ctry": "XY",
"TaxId": "XY99999999999",
"FR_SIR": "732 829 320 0007"
},
"Trm": {
"TT": "1",
"SW": "super-POS",
"SWVersion": "3.4.5",
"HW": "POS Brand",
"HWModel": "POS model name",
"Serial": "POS serial number"
},
"Dev": [
{
"Id": "1",
"HW": "Dev Brand",
"HWModel": "Dev Model",
"SW": "My Dev Software",
"SWVersion": "1.5.7",
"Serial": "POS serial number"
},
{
"Id": "2",
"HW": "Dev Brand",
"HWModel": "Dev Model",
"SW": "My Dev Software",
"SWVersion": "1.5.7",
"Serial": "POS serial number 2"
}
],
"DE_Agentur": [
{
"Id": "1",
"Nam": "Test Company",
"Adr": "177 Long Road",
"Zip": "12345",
"City": "Metropolis",
"Ctry": "XY",
"TaxId": "XY99999999999"
},
{
"Id": "2",
"Nam": "Test Company 2",
"Adr": "256 Long Road",
"Zip": "12345",
"City": "Metropolis",
"Ctry": "XY",
"TaxId": "XY99999999998"
}
],
"Doc": {
"ContactName": "John Doe",
"ContactTelephone": "123456789",
"ContactElectronicMail": "j.doe@efsta.eu",
"PaymentTerms": "30 days net",
"PaymentPeriod": 30,
"AccountName": "my company",
"AccountIBAN": "AT00000000000000000000",
"AccountBIC": "ASPAKAT2LXXX"
}
}
}
Good to know

Cfg field values also are used for bill.efsta.net Digital Receipt display, the "label" fields should contain abbreviations (10 char max.) to be used as denomination in lists.


EFR State

Get state information about running EFR installation.

GET /state

Request Header

NameValue
Acceptapplication/json or text/xml
Response
{
"pid": 32756,
"arch": "x64",
"uptime": 12563,
"name": "EFR",
"version": "2.5.0",
"manifest": "...",
"Country": "XY",
"Online": true,
"Recorder": "online",
"RN": "def",
"RecSent": 0,
"RecQueued": 0,
"RetryQueued": 0,
"TimeOffset": 0,
"D": "2024-06-28T09:54:26+02:00",
"DiskUsage": 0.038301,
"DiskQuota": 1000,
"Company": "XY123456789"
}
NameValueExample
pidProcess Id32756

Export

From EFR V2.5
GET /export
Query & Type

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1
typeExport typedsfinvk
fromFrom date YYYY-MM-DD2024-01-15
tillTill date YYYY-MM-DD2024-12-31
targetOptional. Target folder-path to save export file to.C:/exports
openOptional. Include data of the currently not closed day. Only available for type dsfinvkon

Type

TypeDescriptionResponseCountries
jouEFR journal exportFile jou*.zip*
depDatenerfassungsprotokollFile dep-export.zipAT
tseTSE exportFile export.tarDE
gobdGoBD exportFile gobd.zipDE
dsfinvkDSFinV-K exportFile export.zipDE
saftSAF-T exportFile export.zipDK, NO, PT, SE
nf525-exportNF525 export to verify signature chainFile export.xmlFR
nf525-totalNF525 export to verify grand totalsFile total.xmlFR
nf525-jetNF525 Journal des Évènements TechniquesFile audit.csvFR
nf525-jouEFR journal export including proof-scriptFile jou.zipFR

Profile

This request can be used to set the Badge field in the EFR profile to connect the instance to the efsta Cloud. You can get the Badge value of your company by opening the company details in the efsta portal.

Query & Body

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1

Body

{
"Badge": "XXX" ,
"TaxId": "XXX"
}

Tax IDs for testing

In the following table are Tax IDs for testing for each country

FlagCountryTest Tax Id
Flag-AustriaAustriaATU57780814
Flag-BelgiumBelgiumBE123456789
Flag-CzechCzechCZ123456789
Flag-GermanyGermanyDE123456789
Flag-DenmarkDenmarkDK99999993
Flag-SpainSpainES123456789
Flag-FranceFranceFR123456789
Flag-CroatiaCroatiaHR123456789
Flag-HungaryHungaryHU123456789
Flag-ItalyItalyIT123456789
Flag-LithuaniaLithuaniaLT123456789
Flag-NorwayNorwayNO999999999
Flag-PolandPolandPL9999999999
Flag-PortugalPortugalPT999999990
Flag-SwedenSwedenSE123456789
Flag-SloveniaSloveniaSI123456789
Flag-SlovakiaSlovakiaSK123456789

Journal

Find

This request can be used to find and retrieve transaction data of the EFR journal.

GET /find
Query & Request Header

Query Parameter

NameValueExample
rnOptional Register Number, default: def. Alternatively, TaxId (optional), TL and TT can be specified as parameter1_1
fromFrom date (optional)2024-11-06
tillTill date (optional)2024-11-06
limitOptional limitation of volume and runtime in the format XrowsYms with:
X = receipt count
Y = max runtime in ms
default: 1000rows5000ms
10rows10000ms
sortSort order, default: descasc
continuationContinuation string (optional)51856974

Additional query parameters can be added for transaction search criteria.

NameValueExample
fnFiscal number (can be used instead of tl/tt/tn)001/1/10
tnTransaction number5
dDate2024-11-05
sqSequence number10
_Record Type. Tra...Transaction, TraS...Start Transaction, Rep... Reports, Cfg... Configuration, log... Logs, etc.Tra
tTotal8.38
nfsNon fiscal transactions (see Business Cases)Z
Good to know

You can search for all properties that are in the ESR object (see journal files).


Request Header

NameValue
Acceptapplication/json or text/xml

Get Last Transaction

Fetches the last data object registered (POST /register). To be used on system restart or for informational purposes.

GET /last
Query, Request Header & Response

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1
_optional rec type filterTra, TraS, Cfg

Request Header

NameValue
Acceptapplication/json or text/xml

Response

XML or JSON transaction data, utf-8


Render

Use to show last transaction on a (customer) display, or to fetch a formatted PDF file for saving/printing. Formatting in both cases is using fiscal.pug, which can be customized for the intended purpose.

RequestResponse
GET /renderHTML rendering of the receipt
GET /render/pdfPDF rendering of the receipt
GET /render/textPlain text rendering of the receipt
GET /render/escposESC/POS commands line by line for use with a receipt printer
Query
NameValueExample
RNOptional Register Number, default: 'def'1_1
FNOptional fiscal number, default: last receipt4711

Peri

Available when a fiscal printer is connected to the EFR.

Direct Printing

Prints text directly on the connected printer without registering any transaction to the EFR journal.

POST /peri/print
Query & Body

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1

Body

Content-Type: text/plain

sdfjk
dsjfkls
dsjfkl

Printer State

Get information about the printer and/or fiscal module.

GET /peri/print/state
Query, Request Header & Response

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1

Request Header

NameValue
Acceptapplication/json or text/xml

Response

{
"ModuleName": "[printer module name]",
"ID": "[printer serial]",
"ZI": 1,
"SimpleState": {
"DayOpen": true,
"ZRequired": false,
"NextZRequired": "2024-10-05T00:00:00",
"DrawerOpen": false,
"PaperNearEnd": false,
"PaperEnd": false,
"CoverOpen": false,
"MemAlmostFull": false,
"MemFull": false,
"CertExpires": "2028-10-05T00:00:00"
}
}
NameValueExample
ModuleNamePrinter module name"Epson_FP"
IDPrinter serial number"99MEY022311"
ZICurrent Z-Index1
SimpleState.DayOpenNullable boolean, null if printer does not provide it
SimpleState.ZRequiredNullable boolean, null if printer does not provide it
SimpleState.NextZRequiredNullable string, null if printer does not provide it2024-10-05T00:00:00
SimpleState.DrawerOpenNullable boolean, null if printer does not provide it
SimpleState.PaperNearEndNullable boolean, null if printer does not provide it
SimpleState.PaperEndNullable boolean, null if printer does not provide it
SimpleState.CoverOpenNullable boolean, null if printer does not provide it
SimpleState.MemAlmostFullNullable boolean, null if printer does not provide it
SimpleState.MemFullNullable boolean, null if printer does not provide it
SimpleState.CertExpiresNullable string, null if printer does not provide it"2028-10-05T00:00:00"

Line Display

Displays text directly on the connected line display of the printer. During position and payment entry the cash register application should send referring description and price/amount information immediately to the customer display.

POST /peri/display
Query & Body

Query

NameValueExample
RNOptional Register Number, default: 'def'1_1

Body

Content-Type: text/plain

Arrotondato 30,00 €
Totale 30,01 €

Open Drawer

Opens the cash drawer. By default the cash drawer should be managed by the cash register application.

POST /peri/drawer
Query
NameValueExample
RNOptional Register Number, default: 'def'1_1

Open Drawer and Wait

Opens the cash drawer and sends the response when the cash drawer is closed. As the drawer might be left open for a longer time, a HTTP status 102 Processing may be sent after 30 seconds.

POST /peri/drawer/wait
Query
NameValueExample
RNOptional Register Number, default: 'def'1_1