JSON SPC en Revc
JSON SPC en Revc
JSON Specification
M00124202
Rev.C
Precautions
• Unauthorized duplication, copying, reproduction, or modification of any part or all of this document is strictly
prohibited.
• Contents of this manual are subject to change without prior notice. Contact us directly for the most recent
information.
• Every effort is made to ensure that the contents of this manual are without error. Please contact us if any errors
or other issues are found.
• The previous statement notwithstanding, we will not be liable for any negative impact as a result of use.
• Epson shall not be liable for any damages caused as a result of using this product incorrectly, failing to comply
with the content of this document, or having repair or modifications performed by third parties other than
Epson or those specified by Epson.
• Epson shall not be liable for any issues as a result of installing optional parts or consumables that are not gen-
uine Epson parts or parts certified by Epson.
Trademarks
EPSON, EXCEED YOUR VISION, and ESC/POS are registered trademarks of Seiko Epson Corporation.
Meaning of Symbols
The following symbols are used in this manual. Make sure to understand the meaning of these symbols before
using the product.
Describes usage precautions that must be observed. Incorrect handling due to the disregard of this informa-
tion may result in product failure or incorrect operation.
Usage Limitations
Please use our products in environments and systems designed with consideration to safety and disaster
recovery such as fail-safe configurations and redundant designs, for example, if this product is used in
applications in which a high level of reliability and safety in functionality and precision is required such as in
aircraft, trains, ships, automobiles and other transportation-related applications or in crime prevention
equipment and safety equipment.
This product is not intended for use in applications that require extremely high levels of reliability and safety
such as in aerospace equipment, trunk-line communications equipment, nuclear power control equipment, and
medical equipment. Consider your usage environment and requirements carefully before using this product in
such applications.
3
Contents
■ Safety Precautions ............................................................................................................... 3
Meaning of Symbols.................................................................................................................................................................................3
■ Usage Limitations ................................................................................................................ 3
■ About this Manual................................................................................................................ 3
Purpose of this Manual............................................................................................................................................................................3
Organization of this Manual ..................................................................................................................................................................3
■ Contents ............................................................................................................................... 4
Functional specifications..............................................................10
■ Configuration..................................................................................................................... 10
SetUp .......................................................................................................................................................................................................... 10
SetUpForPrinter....................................................................................................................................................................................... 11
RunTSESelfTest......................................................................................................................................................................................... 12
RegisterSecretKey................................................................................................................................................................................... 13
UpdateTime .............................................................................................................................................................................................. 14
UpdateTimeForFirst ............................................................................................................................................................................... 15
RegisterClient........................................................................................................................................................................................... 16
DeregisterClient ...................................................................................................................................................................................... 17
GetRegisteredClientList........................................................................................................................................................................ 18
UnlockTSE.................................................................................................................................................................................................. 19
LockTSE ...................................................................................................................................................................................................... 20
SetTimeOutInterval................................................................................................................................................................................ 21
GetTimeOutInterval............................................................................................................................................................................... 22
EnableExportIfCspTestFails ................................................................................................................................................................. 23
DisableExportIfCspTestFails ................................................................................................................................................................ 24
DisableSecureElement.......................................................................................................................................................................... 25
■ User Authentication ........................................................................................................... 26
AuthenticateUserForAdmin................................................................................................................................................................ 26
AuthenticateUserForTimeAdmin...................................................................................................................................................... 27
LogOutForAdmin.................................................................................................................................................................................... 28
LogOutForTimeAdmin.......................................................................................................................................................................... 29
UnblockUserForAdmin ......................................................................................................................................................................... 30
UnblockUserForTimeAdmin ............................................................................................................................................................... 31
GetChallenge ........................................................................................................................................................................................... 32
AuthenticateHost ................................................................................................................................................................................... 33
DeauthenticateHost .............................................................................................................................................................................. 34
4
GetAuthenticatedUserList................................................................................................................................................................... 35
ChangePuk................................................................................................................................................................................................ 36
ChangePinForAdmin............................................................................................................................................................................. 37
ChangePinForTimeAdmin ................................................................................................................................................................... 38
■ Transaction ........................................................................................................................ 39
StartTransaction...................................................................................................................................................................................... 39
UpdateTransaction................................................................................................................................................................................. 41
FinishTransaction.................................................................................................................................................................................... 42
GetStartedTransactionList................................................................................................................................................................... 43
GetLastTransactionResponse............................................................................................................................................................. 44
■ Export ................................................................................................................................ 45
ArchiveExport .......................................................................................................................................................................................... 45
ExportFilteredByTransactionNumber.............................................................................................................................................. 46
ExportFilteredByTransactionNumberInterval .............................................................................................................................. 47
ExportFilteredByPeriodOfTime.......................................................................................................................................................... 49
GetExportData......................................................................................................................................................................................... 51
FinalizeExport .......................................................................................................................................................................................... 52
CancelExport ............................................................................................................................................................................................ 53
GetLogMessageCertificate.................................................................................................................................................................. 54
■ Information ........................................................................................................................ 55
GetStorageInfo ........................................................................................................................................................................................ 55
5
Chapter 1 Common Specifications - Data type definition
Common Specifications
❏ Character encoding: UTF-8
❏ Line feed code: LF
❏ Escape character: "”" "\" "/" "b" "f" "n" "r" "t" "uXXXX" => Escape with "/ (backslash)"
DateTime • UTC
• Format: YYYY-MM-DDThh:mm:ssZ(ISO8601)
6
Chapter 1 Common Specifications - JSON message template
{
"storage":{
"type" :"[storage type]",
"vendor":"[vendor name]"
}
"function":"[requested function]",
"input":{
"Item1":"[input parameter1]",
"Item2":"[input parameter2]",
······
},
"compress":{
"required":true/false,
"type":"compression type"
}
}
[Response]
When execution succeeds:
{
"result":"EXECUTION_OK",
"function":"[requested function]",
"output":{
"Item1":"[output parameter1]",
"Item2":"[output parameter2]"
}
}
{
"result":"ERROR_EEEEE",
"function":"[requested function]",
"output":{
"Item1":"[output parameter1]",
},
"error":{
"fact":"[fact of error]"
"errorinfo":"[error info]",
}
}
7
Chapter 1 Common Specifications - JSON message common part type definition
Request
8
Chapter 1 Common Specifications - JSON message common part type definition
9
Chapter 2 Functional specifications - Configuration
Functional specifications
Configuration
SetUp
Sets up German fiscal element (TSE)
❏ Sets PUK, AdminPIN, and TimeAdminPIN in German fiscal element (TSE)
❏ Internally executes German fiscal element (TSE) unlock (see UnlockTSE), enables export after a CSP test failure
in German fiscal element (TSE) (see EnableExportIfCspTestFails), and runs German fiscal element (TSE) self-
test.
❏ Initializes German fiscal element (TSE) and makes it ready to use
❏ As this procedure may require a maximum of 60 seconds for processing, set the timeout periods shown below
to 120 seconds.
• Timeout period for operate API of Epson ePOS SDK
• Timeout period for <type>operate</type> in StorageMessage of ePOS-Device XML
Role
-
Parameters
Input
10
Chapter 2 Functional specifications - Configuration
SetUpForPrinter
Start-up after replacing printer
❏ Must be executed whenever the combination of German fiscal element (TSE) and printer is changed
❏ Internally registers the printer serial number as a client ID in German fiscal element (TSE).
❏ Internally runs German fiscal element (TSE) self-test.
[Cautions for SetUp/SetUpForPrinter/RunTSESelfTest]
❏ As this procedure may require a maximum of 60 seconds for processing, set the timeout periods shown below
to 120 seconds.
• Timeout period for operate API of Epson ePOS SDK
• Timeout period for <type>operate</type> in StorageMessage of ePOS-Device XML
Role
Admin
11
Chapter 2 Functional specifications - Configuration
RunTSESelfTest
Runs a self-test of the German fiscal element (TSE).
❏ After each power-on, the self-test of German fiscal element (TSE) is necessary before running the other control
command for the German fiscal element (TSE).
The self-test checks to see if the internal module of the German fiscal element (TSE) works properly.
❏ The printer automatically runs the self-test of German fiscal element (TSE) after each power-on, so basically,
the user does not need to run the self-test manually.
However, if the printer is used for 25 hours or longer without being turned off, the user needs to run the self-
test using this function before the time for continuous run of the printer reaches 25 hours.
❏ To acquire the remaining time before the self-test is required, use "timeUntilNextSelfTest" of GetStorageInfo.
[Cautions for SetUp/SetUpForPrinter/RunTSESelfTest]
❏ As this procedure may require a maximum of 60 seconds for processing, set the timeout periods shown below
to 120 seconds.
• Timeout period for operate API of Epson ePOS SDK
• Timeout period for <type>operate</type> in StorageMessage of ePOS-Device XML
Role
-
12
Chapter 2 Functional specifications - Configuration
RegisterSecretKey
Registers the secret key
❏ Registers the key used to calculate the hash value required for user/host authentication when logging in.
❏ This setting is persisted across power cycles.
Role
Admin
Parameters
Input
13
Chapter 2 Functional specifications - Configuration
UpdateTime
Updates the German fiscal element (TSE) time
❏ Updates the German fiscal element (TSE) time using the UTC time specified from POS
❏ This function (or UpdateTimeForFirst) must be executed before starting to write transactions.
Role
Admin/TimeAdmin
Parameters
Input
14
Chapter 2 Functional specifications - Configuration
UpdateTimeForFirst
Updates the German fiscal element (TSE) time
❏ Updates the German fiscal element (TSE) time using the UTC time specified from POS
- Actually update the German fiscal element (TSE) time only when called the first time
- Skip updating the German fiscal element (TSE) time when called the second and subsequent times per
power-cycle
❏ This function (or UpdateTime) must be executed before starting to write transactions.
Role
Admin/TimeAdmin
Parameters
Input
15
Chapter 2 Functional specifications - Configuration
RegisterClient
Registers client IDs to be used in German fiscal element (TSE)
❏ 100 client IDs can be registered in German fiscal element (TSE).
However, as one ID is used internally by the printer, 99 client IDs can be registered by the user.
❏ Only client IDs registered in German fiscal element (TSE) can be used for transactions.
Role
Admin
Parameters
Input
16
Chapter 2 Functional specifications - Configuration
DeregisterClient
Deregisters client IDs registered in German fiscal element (TSE)
Role
Admin
Parameters
Input
17
Chapter 2 Functional specifications - Configuration
GetRegisteredClientList
Acquires a list of client IDs registered in German fiscal element (TSE)
❏ Although the client ID "EPSONXXXXXXXX" is included, the XXXXXXXX part used inside the printer is the printer
serial number.
Role
Admin
Parameters
Output
18
Chapter 2 Functional specifications - Configuration
UnlockTSE
Unlocks German fiscal element (TSE)
❏ Transactions and export functions are not available when German fiscal element (TSE) is locked.
In fact, only functions belonging to User Authentication can be used.
❏ This setting is persisted across power cycles.
Role
Admin
19
Chapter 2 Functional specifications - Configuration
LockTSE
Locks German fiscal element (TSE)
❏ Transactions and export functions are not available when German fiscal element (TSE) is locked.
In fact, only functions belonging to User Authentication can be used.
❏ This setting is persisted across power cycles.
Role
Admin
20
Chapter 2 Functional specifications - Configuration
SetTimeOutInterval
Sets the timeout period.
❏ This setting is persisted across power cycles.
Role
Admin
Parameters
Input
21
Chapter 2 Functional specifications - Configuration
GetTimeOutInterval
Acquires the timeout period.
❏ This setting is persisted across power cycles.
Role
Admin
Parameters
Output
22
Chapter 2 Functional specifications - Configuration
EnableExportIfCspTestFails
Enables log data in German fiscal element (TSE) to be exported even if the CSP (Crypto Service Provider) test fails.
* The CSP test is executed in German fiscal element (TSE) self-test.
❏ If the CSP test fails due to a security module failure, log data cannot be exported by default.
❏ Only ArchiveExport can be executed with this command. (Filter-related exports cannot be executed.)
❏ This setting will only succeed after a successful German fiscal element (TSE) self-test (which includes the CSP
test). Once the CSP test fails, this value cannot be changed anymore.
❏ This setting is persisted across power cycles.
Role
Admin
23
Chapter 2 Functional specifications - Configuration
DisableExportIfCspTestFails
Disables log data in German fiscal element (TSE) to be exported if the CSP (Crypto Service Provider) test fails.
❏ This setting will only succeed after a successful German fiscal element (TSE) self-test (which includes the CSP
test). Once the CSP test fails, this value cannot be changed anymore.
❏ This setting is persisted across power cycles.
Role
Admin
24
Chapter 2 Functional specifications - Configuration
DisableSecureElement
Disables German fiscal element (TSE) use
❏ New transactions cannot be written after executing this function.
❏ Can be executed only when no incomplete transactions exist.
Role
Admin
25
Chapter 2 Functional specifications - User Authentication
User Authentication
AuthenticateUserForAdmin
Log in to German fiscal element (TSE) with Admin privileges (user authentication)
❏ Enables the use of functions whose "Role" is Admin (Admin privileges).
❏ Automatically log out when left (Admin privilege function not used) for a certain time (default 15 minutes).
This timeout period can be set using SetTimeOutInterval.
Role
-
Parameters
Input
Output
26
Chapter 2 Functional specifications - User Authentication
AuthenticateUserForTimeAdmin
Log in to German fiscal element (TSE) with TimeAdmin privileges (user authentication)
❏ Enables the use of functions whose "Role" is TimeAdmin (TimeAdmin privileges).
❏ Automatically log out when left (TimeAdmin privilege function not used) for a certain time (default 8 hours).
This timeout period can be set using SetTimeOutInterval.
Role
-
Parameters
Input
Output
27
Chapter 2 Functional specifications - User Authentication
LogOutForAdmin
Logs out a user logged in with Admin privileges
Role
Admin
28
Chapter 2 Functional specifications - User Authentication
LogOutForTimeAdmin
Logs out a client logged in with TimeAdmin privileges
Role
TimeAdmin
Parameters
Input
29
Chapter 2 Functional specifications - User Authentication
UnblockUserForAdmin
Unblocks the PIN for Admin privileges
❏ This function is only available for hosts authenticated using AuthenticateHost.
❏ If PUK is blocked, it cannot be recovered. The only way to recover is to replace German fiscal element (TSE).
Role
Host authenticated using AuthenticateHost
Parameters
Input
Output
30
Chapter 2 Functional specifications - User Authentication
UnblockUserForTimeAdmin
Unblocks the PIN for TimeAdmin privileges
❏ This function is only available for hosts authenticated using AuthenticateHost.
❏ If PUK is blocked, it cannot be recovered. The only way to recover is to replace German fiscal element (TSE).
Role
Host authenticated using AuthenticateHost
Parameters
Input
Output
31
Chapter 2 Functional specifications - User Authentication
GetChallenge
Acquires the challenge
❏ Acquires the challenge data used to calculate the hash value required for user/host authentication when log-
ging in.
Role
-
Parameters
Input
Output
32
Chapter 2 Functional specifications - User Authentication
AuthenticateHost
Authenticates the host
❏ This function (host authentication) must be executed before using the following functions.
- ChangePuk
- UnblockUserForAdmin
- UnblockUserForTimeAdmin
Role
-
Parameters
Input
33
Chapter 2 Functional specifications - User Authentication
DeauthenticateHost
Cancels host authentication.
❏ Logs out of a host logged into (authenticated) with AuthenticateHost
Role
Host authenticated using AuthenticateHost
Parameters
Input
34
Chapter 2 Functional specifications - User Authentication
GetAuthenticatedUserList
Acquires a list of logged-in (authenticated) user IDs and client IDs.
Role
Admin
Parameters
Input
Output
35
Chapter 2 Functional specifications - User Authentication
ChangePuk
Changes PUK
❏ This function is only available for hosts authenticated using AuthenticateHost.
❏ If PUK is blocked, it cannot be recovered. The only way to recover is to replace German fiscal element (TSE).
Role
Host authenticated using AuthenticateHost
Parameters
Input
Output
36
Chapter 2 Functional specifications - User Authentication
ChangePinForAdmin
Changes the Admin PIN
Role
Admin
Parameters
Input
Output
37
Chapter 2 Functional specifications - User Authentication
ChangePinForTimeAdmin
Changes the TimeAdmin PIN
Role
TimeAdmin
Parameters
Input
Output
38
Chapter 2 Functional specifications - Transaction
Transaction
StartTransaction
Starts a transaction
Role
TimeAdmin
Parameters
Input
Output
logTime DateTime Date and time that the log was created
• UTC specification
Format is ISO 8601 extended format
- YYYY-MM-DDThh:mm:ssZ
39
Chapter 2 Functional specifications - Transaction
40
Chapter 2 Functional specifications - Transaction
UpdateTransaction
Updates a transaction
Role
TimeAdmin
Parameters
Input
Output
41
Chapter 2 Functional specifications - Transaction
FinishTransaction
Ends a transaction
Role
TimeAdmin
Parameters
Input
Output
Name Type Description
logTime DateTime Date and time that the log was created
• UTC specification
Format is ISO 8601 extended format
- YYYY-MM-DDThh:mm:ssZ
42
Chapter 2 Functional specifications - Transaction
GetStartedTransactionList
Acquires a list of started (incomplete*) transactions.
* The incomplete status is the status where FinishTransaction has not been executed for a transaction that was
started with StartTransaction.
Role
-
Parameters
Input
Output
43
Chapter 2 Functional specifications - Transaction
GetLastTransactionResponse
Gets the result of the last transaction stored in German fiscal element (TSE) for each client ID
Role
-
Parameters
Input
Output
44
Chapter 2 Functional specifications - Export
Export
ArchiveExport
Starts archive export
❏ Acquires all log data saved in German fiscal element (TSE) in TAR file format
❏ After exporting starts, the printer enters export status and only the following commands can be accepted.
- GetExportData
- FinalizeExport
- CancelExport
❏ Exporting cannot be restarted while in export status.
❏ Before starting exporting, the German fiscal element (TSE) time must be updated by executing UpdateTime or
UpdateTimeForFirst.
❏ In export status, automatically log out when left (GetExportData not used) for a certain time (default 90 min-
utes).
This timeout period can be set using SetTimeOutInterval.
❏ In the case of archive export, all log data can be deleted from German fiscal element (TSE) using FinalizeExport
after confirming that all data has been acquired.
Role
Admin
Parameters
Output
45
Chapter 2 Functional specifications - Export
ExportFilteredByTransactionNumber
Starts exporting the specified transaction number
❏ Acquires the specified target log saved in German fiscal element (TSE) in TAR file format
❏ As data in German fiscal element (TSE) cannot be deleted by this export function, it is not used for archiving
but to acquire a log when an export is requested by an auditor.
❏ After exporting starts, the printer enters export status and only the following commands can be accepted.
- GetExportData
- FinalizeExport
- CancelExport
❏ Exporting cannot be restarted while in export status.
❏ Before starting exporting, the German fiscal element (TSE) time must be updated by executing UpdateTime or
UpdateTimeForFirst.
❏ In export status, automatically log out when left (GetExportData not used) for a certain time (default 90 min-
utes).
This timeout period can be set using SetTimeOutInterval.
Role
Admin
Parameters
Input
46
Chapter 2 Functional specifications - Export
ExportFilteredByTransactionNumberInterval
Starts exporting with the specified transaction number range
❏ Acquires the specified target log saved in German fiscal element (TSE) in TAR file format
❏ As data in German fiscal element (TSE) cannot be deleted by this export function, it is not used for archiving
but to acquire a log when an export is requested by an auditor.
❏ After exporting starts, the printer enters export status and only the following commands can be accepted.
- GetExportData
- FinalizeExport
- CancelExport
❏ Exporting cannot be restarted while in export status.
❏ Before starting exporting, the German fiscal element (TSE) time must be updated by executing UpdateTime or
UpdateTimeForFirst.
❏ In export status, automatically log out when left (GetExportData not used) for a certain time (default 90 min-
utes).
This timeout period can be set using SetTimeOutInterval.
Role
Admin
Parameters
Input
47
Chapter 2 Functional specifications - Export
48
Chapter 2 Functional specifications - Export
ExportFilteredByPeriodOfTime
Starts exporting for a specified date and time range
❏ Acquires the specified target log saved in German fiscal element (TSE) in TAR file format
❏ As data in German fiscal element (TSE) cannot be deleted by this export function, it is not used for archiving
but to acquire a log when an export is requested by an auditor.
❏ After exporting starts, the printer enters export status and only the following commands can be accepted.
- GetExportData
- FinalizeExport
- CancelExport
❏ Exporting cannot be restarted while in export status.
❏ Before starting exporting, the German fiscal element (TSE) time must be updated by executing UpdateTime or
UpdateTimeForFirst.
❏ In export status, automatically log out when left (GetExportData not used) for a certain time (default 90 min-
utes).
This timeout period can be set using SetTimeOutInterval.
Role
Admin
Parameters
Input
49
Chapter 2 Functional specifications - Export
50
Chapter 2 Functional specifications - Export
GetExportData
Acquires exported data
❏ If exportStatus was not "EXPORT_COMPLETE", acquisition of all log data is not complete and GetExportData
must be executed again.
❏ If exportStatus was "EXPORT_COMPLETE", acquisition of all log data is complete and it is not necessary to exe-
cute GetExportData again. Execute FinalizeExport.
❏ Each time data is acquired, it is Base64 decoded into binary data.
All this binary data must be concatenated and saved as a single TAR file.
Role
Admin
Parameters
Output
exportStatus string<100> Whether all the specified log data has been
acquired
"EXPORT_COMPLETE"
: all specified log data has been acquired
"EXPORT_INCOMPLETE"
: all specified log data has not yet been acquired
and the target data is being collected
"EXPORT_INCOMPLETE_SEARCHING"
: all specified log data has not been acquired and
the target data is being searched
51
Chapter 2 Functional specifications - Export
FinalizeExport
Ends exporting
❏ This can be executed only when all export target data has been acquired using GetExportData.
❏ This procedure clears the export status.
❏ If deleteData is set to true, all the log data in German fiscal element (TSE) is deleted.
Role
Admin
Parameters
Input
52
Chapter 2 Functional specifications - Export
CancelExport
Cancels exporting
❏ This procedure clears the export status.
Role
Admin
53
Chapter 2 Functional specifications - Export
GetLogMessageCertificate
Acquires the public key for the signature
Acquires the certificate that can be used to verify the signatures of all Log Messages created by the German fiscal
element (TSE).
❏ The returned data is a single PEM file, which contains multiple certificates, since the TSE's certificate is signed
by other certificates.
❏ To verify the signature, only the leaf certificate (the first one in the PEM file) is required.
❏ To make sure the leaf certificate is genuine, the next certificate in the file can be used to verify the previous
certificate until the last certificate is about to be checked, which will be the root certificate that must be
trusted by the system.
Role
-
Parameters
Output
54
Chapter 2 Functional specifications - Information
Information
GetStorageInfo
Acquires German fiscal element (TSE) information
Role
-
Parameters
Output
tseInformation - Object
55
Chapter 2 Functional specifications - Information
timeUntilNextSelfTest number The timeout in seconds after which the next self
test must be run.
• If this reaches 0, all following commands will
fail until the self test is executed again.
• This time will only change after the first time
update on the German fiscal element (TSE).
• Valid range: range for "unsigned int" type
56
Chapter 2 Functional specifications - Information
serialNumber base64 string Raw SHA-256 hash over the public key that
belongs to the private key generating signatures.
This can be used as German fiscal element (TSE)
unique ID.
57
Chapter 2 Functional specifications - Information
smartInformation - Object
spareBlockStatus - Object
58
Chapter 2 Functional specifications - Information
59
Chapter 2 Functional specifications - Information
60
Chapter 3 Error Code List - From Printer
61
Chapter 3 Error Code List - From Printer
OTHER_ERROR_NO_TIME_SET_BEFORE_EXPORT German fiscal element (TSE) time was not updated before
starting the export
OTHER_ERROR_ALL_DATA_NOT_EXPORTED_YET An export end request was received when all export data had
not been acquired
OTHER_ERROR_TSE_ALREADY_SET_UP Another set-up request was received for a German fiscal ele-
ment (TSE) that is already set-up
62
Chapter 3 Error Code List - From German fiscal element (TSE)
TSE1_ERROR_RESPONSE_MISSING This happens if two commands are sent at the same time or
if a command is not allowed in the current state.
TSE1_ERROR_FROM_TSE_FIRST Lowest error code that might be raised from the German fis-
cal element (TSE).
63
Chapter 3 Error Code List - From German fiscal element (TSE)
64
Chapter 3 Error Code List - From German fiscal element (TSE)
TSE1_ERROR_RAISED_FROM_TSE Errors that raised from the German fiscal element (TSE)
except for the above.
In the current version, it might be raised when the German
fiscal element (TSE) self test fails.
65