### Install Mono Service Utility Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/general/components/components-install-config Command to install the required mono-service utility on Ubuntu systems. ```bash sudo apt update && sudo apt install mono-4.0-service ``` -------------------------------- ### Echo API Example Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/migration-guide-v0-v2 Example request and response for the /v2/echo endpoint. ```http POST /v2/echo { "message": "test" } ``` ```json { "message": "test" } ``` -------------------------------- ### Configure Proxy Connection Strings Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/network-requirements Examples of semicolon-separated connection strings used with the -proxy parameter. ```text address=192.168.0.1 address=192.168.0.1;username=proxyuser;password=proxypw address=proxy.example.com;username=proxyuser address=192.168.0.1;bypass=192\.168\.10\.1 address=192.168.0.1;bypass=192\.168\.10\.1;bypass=scu\d+\.example\.com ``` -------------------------------- ### Sending Requests via Command Line Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/rollout-automation/api-templating Examples for executing the configuration request using curl and PowerShell. ```bash curl.exe -X POST -H "Content-Type: application/json" -H "accountid: ACCOUNT_ID" -H "accesstoken: ACCOUNT_ACCESS_TOKEN" -d 'ESCAPED_TEMPLATE' https://helipad.fiskaltrust.cloud/api/configuration ``` ```powershell $headers = @{ accountid = "ACCOUNT_ID"; accesstoken = "ACCOUNT_ACCESS_TOKEN" } Invoke-WebRequest -Uri https://helipad.fiskaltrust.cloud/api/configuration -Method Post -Headers $headers -Body "ESCAPED_TEMPLATE" -ContentType "application/json" ``` -------------------------------- ### Retrieve Version Information Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/general/reference-tables/reference-tables-v1 Example output showing the assembly and version details returned when requesting version information. ```json { "Assembly": "fiskaltrust.Middleware.Queue, Version=1.3.24.0, Culture=neutral, PublicKeyToken=null", "Version": { "Major": 1, "Minor": 3, "Build": 24, "Revision": 0, "MajorRevision": 0, "MinorRevision": 0 } } ``` -------------------------------- ### Verify Middleware Installation via Intent Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/android-intent Checks if the fiskaltrust middleware is installed on the device by resolving the specific intent action. ```kotlin fun isMiddlewareInstalled(context: Context): Boolean { val intent = Intent("eu.fiskaltrust.androidlauncher.POSSYSTEMAPI") intent.addCategory(Intent.CATEGORY_DEFAULT) val resolveInfo = context.packageManager.resolveActivity( intent, PackageManager.MATCH_DEFAULT_ONLY ) return resolveInfo != null } ``` -------------------------------- ### SubItems Field Mapping Examples Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/dsfinv-k Examples of how to map specific fields into the SubItems array within the JSON payload. ```json "SubItems":"[{ "ProductNumber":"10292", ... }, ... ]" ``` ```json "SubItems":"[{ "ProductNumber":"10292", "GTIN":"4231234266622", ... }, ... ]" ``` ```json "SubItems":"[{ "ProductNumber":"10292", "Description":"4231234266622", ... }, ... ]" ``` ```json "SubItems":"[{ ..., "ProductGroup":"{ \"ProductGroupId\":\"981981AA\", \"ProductGroupName\":\"Fleischwaren\" }", ... }, ... ]" ``` ```json "SubItems":"[{..., "Quantity":2.543, ... }, ... ]" ``` ```json "SubItems":"[{ ..., "UnitQuantity":1.0, ... }, ... ]" ``` ```json "SubItems":"[{ ..., "Unit":"kg", ... }, ... ]" ``` ```json "SubItems":"[{..., "ftSubChargeItemCase":"4919338167972134929", ... }, ... ]" ``` ```json "SubItems":"[{..., "Amount":22.50, ... }, ... ]" ``` -------------------------------- ### Create Order Receipt Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/single-receipt-creation Example request and response for creating an order receipt transaction. ```APIDOC ## POST /receipts ### Description Creates a new order receipt transaction in the fiscal queue. ### Request Body - **ftCashBoxID** (string) - Required - **ftQueueID** (string) - Required - **ftPosSystemId** (string) - Required - **cbTerminalID** (string) - Required - **cbReceiptReference** (string) - Required - **cbReceiptMoment** (string) - Required - **cbChargeItems** (array) - Required - **ftReceiptCase** (number) - Required - **cbArea** (string) - Optional ### Request Example { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftPosSystemId": "d4a62055-ca6c-4372-ae4d-f835a88e4a5d", "cbTerminalID": "T1", "cbReceiptReference": "LLA_1", "cbReceiptMoment": "2020-05-27T12:47:40.960Z", "cbChargeItems": [ { "Quantity": 1.0, "Description": "Kaffe Hag", "Amount": 4.00, "VATRate": 19.0000, "ftChargeItemCase": 4919338167972134913, "Moment": "2020-05-27T12:11:22.233Z" } ], "cbPayItems": [], "ftReceiptCase": 4919338172267102224, "cbArea": "Zimmer 12" } ``` -------------------------------- ### Example Middleware Log Output Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/logging A sample log file excerpt showing startup information and a file system permission error. ```text 1970-01-01 00:00:00 [INF] fiskaltrust.Launcher-X.X.X 1970-01-01 00:00:00 [INF] CashBoxId set to "00000000-0000-0000-0000-000000000000" 1970-01-01 00:00:00 [INF] AccessToken set 1970-01-01 00:00:00 [INF] Sandbox set to "True" 1970-01-01 00:00:00 [ERR] Cannot set ACL to ServiceFolder System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl) at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext) at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext) at System.Security.AccessControl.FileSystemSecurity.Persist(String fullPath) at fiskaltrust.service.launcher.Configuration.get_ServiceFolder() 1970-01-01 00:00:02 [INF] Starting Middleware with configuration timestamp: 0 (SHA256: 0000000000000000000000000000000000000000000000000000000000000000) 1970-01-01 00:00:02 [INF] Save configuration to C:\ProgramData\fiskaltrust\service\Configuration-00000000-0000-0000-0000-000000000000.json 1970-01-01 00:00:02 [INF] Starting ft.Middleware at C:\ProgramData\fiskaltrust\service\00000000-0000-0000-0000-000000000000 1970-01-01 00:00:02 [INF] fiskaltrust.Middleware started. Press a button to stop... ``` -------------------------------- ### Create POS Payment Receipt Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/single-receipt-creation Example request for creating a final POS payment receipt. ```APIDOC ## POST /receipts ### Description Creates a final POS payment receipt including charge and payment items. ### Request Body - **ftCashBoxID** (string) - Required - **ftQueueID** (string) - Required - **ftPosSystemId** (string) - Required - **cbTerminalID** (string) - Required - **cbReceiptReference** (string) - Required - **cbReceiptMoment** (string) - Required - **cbChargeItems** (array) - Required - **cbPayItems** (array) - Required - **ftReceiptCase** (number) - Required - **cbArea** (string) - Optional ### Request Example { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftPosSystemId": "d4a62055-ca6c-4372-ae4d-f835a88e4a5d", "cbTerminalID": "T1", "cbReceiptReference": "LLA_1", "cbReceiptMoment": "2020-05-28T14:11:22.233Z", "cbChargeItems": [ { "Quantity": 1.0, "Description": "0,5 Soda Zitrone", "Amount": 3.50, "VATRate": 19.0000, "ftChargeItemCase": 4919338167972134913, "Moment": "2020-05-26T10:31:34.960Z" }, { "Quantity": 1.0, "Description": "Kaffe Hag", "Amount": 4.00, "VATRate": 19.0000, "ftChargeItemCase": 4919338167972134913, "Moment": "2020-05-27T12:11:22.233Z" } ], "cbPayItems": [ { "Quantity": 1.0, "Description": "Cash", "Amount": 7.50, "ftPayItemCase": 4919338167972134913, "Moment": "2020-05-28T14:11:22.233Z" } ], "ftReceiptCase": 4919338172267102209, "cbArea": "Zimmer 12" } ``` -------------------------------- ### ChargeItemCaseData JSON Example Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/france/data-structures Example of the required JSON structure for the ftChargeItemCaseData field, specifically including the mandatory NetAmount for French law compliance. ```json "ftChargeItemCaseData": "{\"NetAmount\": 54.93}" ... ``` -------------------------------- ### Complete Intent Call Example in Java Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/android-intent Demonstrates how to encode request data, trigger the PosSystemAPI via Intent, and handle the asynchronous response in onActivityResult. ```java import android.content.Intent; import android.util.Base64; import org.json.JSONObject; public void callPosSystemAPI(String method, String path, JSONObject headers, String body) { try { // Base64URL encode headers String headersJson = headers.toString(); byte[] headerBytes = headersJson.getBytes("UTF-8"); String headerB64 = Base64.encodeToString(headerBytes, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP); // Base64URL encode body String bodyB64 = null; if (body != null) { byte[] bodyBytes = body.getBytes("UTF-8"); bodyB64 = Base64.encodeToString(bodyBytes, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP); } // Create intent Intent intent = new Intent(); intent.setClassName("eu.fiskaltrust.androidlauncher", "eu.fiskaltrust.androidlauncher.PosSystemAPI"); intent.putExtra("Method", method); intent.putExtra("Path", path); intent.putExtra("HeaderJsonObjectBase64Url", headerB64); if (bodyB64 != null) { intent.putExtra("BodyBase64Url", bodyB64); } startActivityForResult(intent, REQUEST_CODE); } catch (Exception e) { Log.e("PosSystemAPI", "Error creating intent", e); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE && data != null) { String statusCode = data.getStringExtra("StatusCode"); String contentB64 = data.getStringExtra("ContentBase64Url"); String contentTypeB64 = data.getStringExtra("ContentTypeBase64Url"); try { // Decode Base64URL byte[] contentBytes = Base64.decode(contentB64, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP); String content = new String(contentBytes, "UTF-8"); byte[] typeBytes = Base64.decode(contentTypeB64, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP); String contentType = new String(typeBytes, "UTF-8"); Log.i("PosSystemAPI", "Status: " + statusCode + ", Type: " + contentType); Log.i("PosSystemAPI", "Response: " + content); } catch (Exception e) { Log.e("PosSystemAPI", "Error decoding response", e); } } } ``` -------------------------------- ### Execute Firewall Script Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/troubleshooting/network-troubleshooting Example command to run the firewall script with a configuration CSV file and the resulting output format. ```powershell PS C:\fw-script>.\CheckFirewall.ps1 FirewallTests-ft.csv CheckFirewall 2.0 Machine name: COMPUTER-NAME OS version: 10.0.19044 Windows name: Windows 10 Enterprise Overall connectivity: True Active Middleware instances: 0 Name Version Release ---- ------- ------- v2.0.50727 2.0.50727.4927 v3.0 3.0.30729.4926 Windows Communication Foundation 3.0.4506.4926 Windows Presentation Foundation 3.0.6920.4902 v3.5 3.5.30729.4926 Client 4.8.04084 528372 Full 4.8.04084 528372 Client 4.0.0.0 We're all good! Status: (SUCCESS) -- Purpose: ft cashbox download & upload receipt data Status: (SUCCESS) -- Purpose: ft download packages Status: (SUCCESS) -- Purpose: ft error reporting Full Results below: Url Purpose Notes From --- ------- ----- ---- https://helipad.fiskaltrust.cloud/version ft cashbox download & upload receipt data okay COMPUTER-NAME https://packages.fiskaltrust.cloud/version ft download packages okay COMPUTER-NAME https://dc.services.visualstudio.com/ ft error reporting okay COMPUTER-NAME ``` -------------------------------- ### First Order Request and Response Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/single-receipt-creation Example of an initial info-order request and the corresponding response for a long-lasting business action. ```json { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftPosSystemId": "d4a62055-ca6c-4372-ae4d-f835a88e4a5d", "cbTerminalID": "T1", "cbReceiptReference":"LLA_1", "cbReceiptMoment":"2020-05-26T10:47:40.960Z", "cbChargeItems":[ { "Quantity":1.0, "Description":"0,5 Soda Zitrone", "Amount":3.50, "VATRate":19.0000, "ftChargeItemCase":4919338167972134913, "Moment":"2020-05-26T10:31:34.960Z" } ], "cbPayItems":[], // 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) "ftReceiptCase":4919338172267102224, "cbArea":"Zimmer 12" } ``` ```json { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftQueueItemID": "14d06319-52d7-4fa6-841b-c296f81b716e", "ftQueueRow": 68, "cbTerminalID": "T1", "cbReceiptReference": "LLA_1", "ftCashBoxIdentification": "220130d5-9060-4e26-b75c-35968f49aae3", "ftReceiptIdentification": "ft3D#IT92", "ftReceiptMoment": "2020-05-29T13:54:53.9023323Z", "ftSignatures": [ { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134928, "Caption": "start-transaction-result", "Data": "luQPVPNDHv+V3aQ14exAT8uO8oXWCxfBWQM+UlcBnDK1bPgFnhurbTPoX7a2PdEtlr76qDFlW78dOX13S/Cm/w==" }, { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134929, "Caption": "finish-transaction-payload", "Data": "MTsiMCw1IFNvZGEgWml0cm9uZSI7My41MAo=" }, { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134930, "Caption": "finish-transaction-result", "Data": "IKLNsqh0CvUIIqpVdh1pAEc6qOwWM3LKnlPLBWPO05JoDsuSyqbKqXR5D6j7prgxY5JysmqF49h0zSk12N/3gA==" }, { "ftSignatureFormat": 1, "ftSignatureType": 4919338167972134933, "Caption": "", "Data": "Bestellung-V1" } ], "ftState": 4919338167972134912 } ``` -------------------------------- ### Complete PosSystemAPI Intent Implementation Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/android-intent A full implementation example including Base64URL encoding of headers and body, intent execution, and response handling via onActivityResult. ```kotlin import android.content.Intent import android.util.Base64 import org.json.JSONObject fun callPosSystemAPI(method: String, path: String, headers: Map, body: String?) { // Create headers JSON val headersJson = JSONObject(headers).toString() // Base64URL encode (no padding, replace + with -, / with _) val headerB64 = headersJson.toByteArray(Charsets.UTF_8) .let { Base64.encodeToString(it, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) } val bodyB64 = body?.toByteArray(Charsets.UTF_8) ?.let { Base64.encodeToString(it, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) } // Create intent val intent = Intent() intent.setClassName("eu.fiskaltrust.androidlauncher", "eu.fiskaltrust.androidlauncher.PosSystemAPI") intent.putExtra("Method", method) intent.putExtra("Path", path) intent.putExtra("HeaderJsonObjectBase64Url", headerB64) if (bodyB64 != null) { intent.putExtra("BodyBase64Url", bodyB64) } startActivityForResult(intent, REQUEST_CODE) } // Example: Echo call fun echoExample() { val headers = mapOf( "Accept" to "application/json", "x-cashbox-id" to "de12c75f-5587-48b8-8ac5-64b7c81a05ec", "x-cashbox-accesstoken" to "your-access-token", "x-operation-id" to java.util.UUID.randomUUID().toString(), ) val body = """{"Message": "Hello, World!"}""" callPosSystemAPI("POST", "/echo", headers, body) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == REQUEST_CODE && data != null) { val statusCode = data.getStringExtra("StatusCode") ?: "500" val contentB64 = data.getStringExtra("ContentBase64Url") ?: "" val contentTypeB64 = data.getStringExtra("ContentTypeBase64Url") ?: "" // Decode Base64URL val content = Base64.decode(contentB64, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) .toString(Charsets.UTF_8) val contentType = Base64.decode(contentTypeB64, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) .toString(Charsets.UTF_8) Log.i("PosSystemAPI", "Status: $statusCode, Type: $contentType") Log.i("PosSystemAPI", "Response: $content") } } ``` -------------------------------- ### Day 3 - Payment POS Receipt Request Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/single-receipt-creation Example of a payment request for a POS receipt. ```json { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftPosSystemId": "d4a62055-ca6c-4372-ae4d-f835a88e4a5d", "cbTerminalID": "T1", "cbReceiptReference":"LLA_1", "cbReceiptMoment":"2020-05-28T14:11:22.233Z", "cbChargeItems":[ { "Quantity":1.0, "Description":"0,5 Soda Zitrone", "Amount":3.50, "VATRate":19.0000, "ftChargeItemCase":4919338167972134913, "Moment":"2020-05-26T10:31:34.960Z" }, { "Quantity":1.0, "Description":"Kaffe Hag", "Amount":4.00, "VATRate":19.0000, "ftChargeItemCase":4919338167972134913, "Moment":"2020-05-27T12:11:22.233Z" } ], "cbPayItems":[ { "Quantity":1.0, "Description":"Cash", "Amount":7.50, "ftPayItemCase":4919338167972134913, "Moment":"2020-05-28T14:11:22.233Z" } ], // 0x4445 0000 0000 0001 (pos-receipt) + 0000 0001 0000 0000 (implicit flow) "ftReceiptCase":4919338172267102209, "cbArea":"Zimmer 12" } ``` -------------------------------- ### Sign Endpoint Response Sample Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/instore-app/introduction Example JSON response returned by the /sign endpoint upon a successful request. ```json { "type": "sign", "identifier": "fdf2a983-0c30-4d40-bda3-e4e339551e5e" } ``` -------------------------------- ### Configure Middleware Production Mode Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/configuration Example of setting the sandbox parameter to false within the appSettings section of the configuration file. ```xml ``` -------------------------------- ### Day 2 - Second Order Request and Response Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/germany/single-receipt-creation Example of a second order request and its corresponding fiscal response. ```json { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftPosSystemId": "d4a62055-ca6c-4372-ae4d-f835a88e4a5d", "cbTerminalID": "T1", "cbReceiptReference":"LLA_1", "cbReceiptMoment":"2020-05-27T12:47:40.960Z", "cbChargeItems":[ { "Quantity":1.0, "Description":"Kaffe Hag", "Amount":4.00, "VATRate":19.0000, "ftChargeItemCase":4919338167972134913, "Moment":"2020-05-27T12:11:22.233Z" } ], "cbPayItems":[], // 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) "ftReceiptCase":4919338172267102224, "cbArea":"Zimmer 12" } ``` ```json { "ftCashBoxID": "cashboxid-guid", "ftQueueID": "b6c9f13b-b987-43cd-ab08-3f5cb2a850d6", "ftQueueItemID": "2005ad2d-a00b-4b44-9871-5806f036a220", "ftQueueRow": 69, "cbTerminalID": "T1", "cbReceiptReference": "LLA_1", "ftCashBoxIdentification": "220130d5-9060-4e26-b75c-35968f49aae3", "ftReceiptIdentification": "ft3E#IT93", "ftReceiptMoment": "2020-05-29T13:59:33.1843023Z", "ftSignatures": [ { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134928, "Caption": "start-transaction-result", "Data": "ThADGCPpoSsOx/BN6bNlA1t2JQCd+SFWpJjGpalaDfMhlTMLx30yjCGtFZHyq8ZzXJIyOQ18BxWJ8SM/233U6Q==" }, { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134929, "Caption": "finish-transaction-payload", "Data": "MTsiS2FmZmUgSGFnIjs0LjAwCg==" }, { "ftSignatureFormat": 13, "ftSignatureType": 4919338167972134930, "Caption": "finish-transaction-result", "Data": "CFm7yisXpQ/ncBolxwSSJ4au4ibGNoK1wKqp/HI7VTPdo8GyaJ0keVgtcCQGAIIeZZv//mvLG9u0ROH83nFdXw==" }, { "ftSignatureFormat": 1, "ftSignatureType": 4919338167972134933, "Caption": "", "Data": "Bestellung-V1" } ], "ftState": 4919338167972134912 } ``` -------------------------------- ### Execute Payment Request Source: https://docs.fiskaltrust.eu/apis/pos-system-api Example payload for initiating a payment transaction with a specified amount and terminal ID. ```json { "Action": "payment", "Protocol": "use_auto", "cbPayItem": { "Description": "Card", "Amount": 1.5 }, "cbTerminalId": 1 } ``` -------------------------------- ### Example of OCR output in Base64 Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/austria/reference-tables Displays the signature value in its original Base64 format. ```text _R1-AT0_DEMO-CASH-BOX426_776730_2015-10-14T18:20:23_0,00_0,00_0,00_0,00_0,00_0gJTFI8/zqc=_968935007593160625_fP7/PMP-SnQ0=_Xh5wNe0akaTOVvMgLVrCcRh2xmIyP91ogbxc5xv4Rrw64lpQsqLm+1GZxuCz4D1sZl9WCv3wMMoE0p+gyLaufg== ``` -------------------------------- ### GET / Source: https://docs.fiskaltrust.eu/apis/receipt-api Visualize a digital receipt for a Give Away. This endpoint returns the visualization for a receipt linked to a Give Away. ```APIDOC ## GET / ### Description Returns the visualization for a receipt that has been linked to the Give Away. Calling this endpoint marks the receipt as accepted/viewed. ### Method GET ### Endpoint / ### Parameters #### Query Parameters - **c** (string) - Required - Base64Url identifier - **s1** (string) - Required - signature with key number 1 - **s2** (string) - Required - signature with key number 2 - **f** (string) - Required - featureset - **mcc** (string) - Optional - marketing campaign code. Influence visualization of empty / non assigned codes - **AppId** (string) - Optional - When an AppId is provided then the 3rd party app redirect is disabled. Using the AppId parameter will also not mark the receipt as accepted/viewed. ### Responses #### Success Response (200) - Success #### Redirect Response (301) - Redirect to digital receipt information, if receipt is not found Redirect to 3rd party application #### Error Response (500) - Internal error ``` -------------------------------- ### Referencing SCU URL by Custom Field Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/rollout-automation/templates Example of referencing an SCU URL based on a custom key-value pair. ```text |[reference_scu_onlinescu_masterPOS_true_url]| ``` -------------------------------- ### HTTP POST echo request for CloudCashbox Source: https://docs.fiskaltrust.eu/docs/posdealers/getting-started/my-first-cashbox An HTTP request example including required headers for CloudCashbox authentication. ```http POST https://cloudcashbox-sandbox.fiskaltrust.de/v1/Echo HTTP/1.1 Host: localhost Content-Length: 46 Content-Type: application/json cashboxid: XXXX accesstoken: XXXX { "Message": "Hello fiskaltrust.Middleware!" } ``` -------------------------------- ### JSON Response Sample Source: https://docs.fiskaltrust.eu/apis/pos-system-api Example of a successful JSON response containing receipt identifiers and document metadata. ```json { "ftQueueID": "99869afd-f29a-4048-925a-faca4d8b997a", "ftQueueItemID": "893673be-ddd8-4653-93ba-7c32f9aefc71", "DocumentURL": "https://receipts-sandbox.fiskaltrust.eu/99869afd-f29a-4048-925a-faca4d8b997a/893673be-ddd8-4653-93ba-7c32f9aefc71", "DocumentContentType": "text/vnd.esc-pos;charset=utf-8;width=80mm" } ``` -------------------------------- ### Example of OCR output in Base32 Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/austria/reference-tables Displays the signature value converted to Base32 format for OCR printing. ```text _R1-AT0_DEMO-CASH-BOX426_776730_2015-10-14T18:20:23_0,00_0,00_0,00_0,00_0,00_2IBFGFEPH7HKO===_968935007593160625_PT7P6PGD2KOQ2===_LYPHANPNDKI2JTSW6MQC2WWCOEMHNRTCGI7522EBXROOOG7YI26DVYS2KCZKFZX3KGM4NYFT4A6WYZS7KYFP34BQZICNFH5AZC3K47Q= ``` -------------------------------- ### HTTP POST echo request for local REST Source: https://docs.fiskaltrust.eu/docs/posdealers/getting-started/my-first-cashbox A full HTTP request example for testing the local Middleware echo endpoint. ```http POST /json/Echo HTTP/1.1 Host: localhost Content-Length: 31 Content-Type: application/json "Hello fiskaltrust.Middleware!" ``` -------------------------------- ### CashBox JSON Configuration Structure Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/cashbox A skeleton example of the JSON structure used by the Middleware to define its components and configuration settings. ```json { "ftCashBoxId": "00000000-0000-0000-0000-000000000000", "ftSignaturCreationDevices": [{ "Id": "00000000-0000-0000-0000-000000000000", "Package": "fiskaltrust.package", "Version": "1.0", "Configuration": {}, "Url": ["grpc://localhost:1201"] }], "ftQueues": [{ "Id": "00000000-0000-0000-0000-000000000000", "Package": "fiskaltrust.package", "Version": "1.0", "Configuration": { "init_ftQueue": [{ "ftQueueId": "00000000-0000-0000-0000-000000000000", "ftCashBoxId": "00000000-0000-0000-0000-000000000000", "ftCurrentRow": 0, "ftQueuedRow": 0 }], "init_ftCashBox": { "ftCashBoxId": "00000000-0000-0000-0000-000000000000", "TimeStamp": 0 }, "init_ftSignaturCreationUnitAT": [], "init_ftSignaturCreationUnitFR": [], "init_ftSignaturCreationUnitDE": [] }, "Url": ["rest://localhost:1200/fiskaltrust"] }], "helpers": [{ "Id": "00000000-0000-0000-0000-000000000000", "Package": "fiskaltrust.package", "Version": "1.0", "Configuration": {}, "Url": [] }], "TimeStamp": 0 } ``` -------------------------------- ### Payment Response JSON Sample Source: https://docs.fiskaltrust.eu/apis/pos-system-api Example JSON response structure for a payment request using the use_auto protocol. ```json { * "Protocol": "use_auto", * "ftQueueId": "00000000-0000-0000-0000-xxxxxxxxxxxx", * "ftPayItems": [ * { * "ftPayItemId": "00000000-0000-0000-0000-xxxxxxxxxxxx", * "Description": "Card", * "Amount": 1.5, * "ftPayItemCase": 14757170079003050000, * "ftPayItemCaseData": { * "Provider": { * "Protocol": "test", * "Action": "payment", * "ProtocolRequest": "dummy provider request", * "ProtocolResponse": { * "OperationID": "00000000-0000-0000-0000-xxxxxxxxxxxx", * "Amount": 1.5 } }, * "Receipt": [ * "PAYMENT", * "", * "Amount 1.50", * "Total Amount 1.50" ] }, * "Moment": "2020-06-29T17:45:40.505Z" } ] } ``` -------------------------------- ### Copy receipt fields Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/france/data-structures Example of providing the copy reason and previous receipt reference for a duplicate receipt. ```json "ftReceiptCaseData" : "{\"CopyReason\" : \"Ticket réimprimé à la demande du client\"}", "cbPreviousReceiptReference" : "HP202112-001" ... ``` -------------------------------- ### Journal Export Response Sample Source: https://docs.fiskaltrust.eu/apis/middleware-api-v1 Example of a successful 200 OK response body for the journal export endpoint. ```json "string" ``` -------------------------------- ### Reference SCU URL by Custom Field Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/rollout-automation/templates Example of referencing an SCU URL using a custom masterPOS field. ```text |[reference_scu_fiskalycertified_masterPOS_true_url]| ``` -------------------------------- ### Referencing SCU IDs by Counter Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/rollout-automation/templates Examples of referencing specific SCU IDs based on a counter field value. ```text |[reference_scu_onlinescu_counter_1_id]| |[reference_scu_onlinescu_counter_2_id]| ``` -------------------------------- ### isMiddlewareInstalled Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/android-intent A Kotlin function to verify if the fiskaltrust middleware is installed on the Android device by checking for the existence of the POSSYSTEMAPI intent. ```APIDOC ## Method: isMiddlewareInstalled(context: Context) ### Description Verifies if the fiskaltrust middleware is installed on the device by resolving the 'eu.fiskaltrust.androidlauncher.POSSYSTEMAPI' intent. ### Parameters - **context** (Context) - Required - The Android application context used to access the PackageManager. ### Returns - **Boolean** - Returns true if the middleware is installed, false otherwise. ``` -------------------------------- ### Configure Directories and Permissions Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/general/components/components-install-config Commands to create the configuration directory and set necessary file execution permissions. ```bash sudo mkdir /etc/fiskaltrust sudo chmod 777 /etc/fiskaltrust sudo chmod +x /etc/init.d/fiskaltrust sudo chmod +x /etc/fiskaltrust/fiskaltrust.exe ``` -------------------------------- ### Saving a room number Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/france/data-structures Example of serializing a room number into the cbArea field. ```json "cbArea": "{\"room\" : \"W1101\"}" ... ``` -------------------------------- ### Saving a table number Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/france/data-structures Example of serializing a table number into the cbArea field. ```json "cbArea": "{\"table\" : \"101\"}" ... ``` -------------------------------- ### Configure logging via command line Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/logging Override configuration settings by passing parameters directly to the Launcher executable. ```bash C:\>fiskaltrust.exe -verbosity=debug -logfile="C:\log\fiskaltrust\middleware.log" ``` -------------------------------- ### Response Payload for /echo Source: https://docs.fiskaltrust.eu/apis/pos-system-api Example JSON response structure for the /echo endpoint. ```json { "Message": "string" } ``` -------------------------------- ### GET /v0/print/{ftQueueID}/{ftQueueItemID} Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/digital-receipt/implementation/digital-receipt-implementation Obtain the current status of a digital receipt. ```APIDOC ## GET /v0/print/{ftQueueID}/{ftQueueItemID} ### Description This method is used to obtain the result of the current digital receipt status. ### Method GET ### Endpoint https://receipts.fiskaltrust.cloud/v0/print/{ftQueueID}/{ftQueueItemID} (Production) https://receipts-sandbox.fiskaltrust.cloud/v0/print/{ftQueueID}/{ftQueueItemID} (Sandbox) ### Parameters #### Path Parameters - **ftQueueID** (string) - Required - **ftQueueItemID** (string) - Required #### Header Parameters - **cashboxid** (string) - Required - **accesstoken** (string) - Required ### Response #### Success Response (200) - **state** (string) - The current state of the receipt (e.g., "Printed", "Submitted") - **message** (string) - Status message #### Response Example { "state": "Printed", "message": "Receipt was delivered to ... at 10/24/2023 09:58:21" } #### Other Responses - 400 - Bad request - 401 - Unauthorized ``` -------------------------------- ### GET /api/v0/iatsscd/certificate Source: https://docs.fiskaltrust.eu/docs/poscreators/signing/austria/api The certificate method is used to obtain the certificate of the RKSV.Sign service. ```APIDOC ## GET /api/v0/iatsscd/certificate ### Description The certificate method is used to obtain the certificate of the RKSV.Sign service. The certificate is returned as a Base64-encoded JSON object in the response body. ### Method GET ### Endpoint /api/v0/iatsscd/certificate ### Response #### Success Response (200) - **certificateBase64** (string) - The service certificate as a Base64-encoded string. #### Response Example { "certificateBase64": "string" } ``` -------------------------------- ### Create Init Script for fiskaltrust Source: https://docs.fiskaltrust.eu/docs/poscreators/middleware-doc/general/components/components-install-config The content of the /etc/init.d/fiskaltrust script used to manage the service lifecycle. ```bash #! /bin/sh ### BEGIN INIT INFO # Provides: fiskaltrust # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: fiskaltrust.Sicherheitseinrichtung ### END INIT INFO # /etc/init.d/fiskaltrust # # #rechte: sudo chmod +x /etc/init.d/fiskaltrust #rechte: sudo chmod +x /etc/fiskaltrust/fiskaltrust.exe #installieren: sudo update-rc.d fiskaltrust defaults #deinstalllieren: sudo update-rc.d -f dispenser1 remove # # # # # Some things that run always # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present # and status_of_proc is working. . /lib/lsb/init-functions # Carry out specific functions when asked to by the system case "$1" in start) log_daemon_msg "Starting fiskaltrust.Sicherheitseinrichtung " "fiskaltrust" mono-service -l:/tmp/fiskaltrust.Sicherheitseinrichtung .lock -d:/etc/fiskaltrust/ /etc/fiskaltrust/fiskaltrust.exe log_end_msg $? ;; stop) log_daemon_msg "Stopping fiskaltrust.Sicherheitseinrichtung " "fiskaltrust" kill `cat /tmp/fiskaltrust.Sicherheitseinrichtung .lock` log_end_msg $? ;; *) echo "Usage: /etc/init.d/fiskaltrust {start|stop}" exit 1 ;; esac exit 0 ``` -------------------------------- ### Error Response Example Source: https://docs.fiskaltrust.eu/apis/pos-system-api Standard JSON structure for error responses returned by the API. ```json { "type": "http://example.com", "status": "(see status code)", "title": "string", "detail": "string", "instance": "string", "code": "string" } ``` -------------------------------- ### Invoke Launcher with Proxy Parameter Source: https://docs.fiskaltrust.eu/docs/posdealers/technical-operations/middleware/network-requirements Command line execution to set the proxy configuration for the Launcher. ```bash C:\>fiskaltrust.exe -proxy="address=192.168.0.1;username=proxyuser;password=proxypw" ``` -------------------------------- ### GET /cart/{JourneyId} Source: https://docs.fiskaltrust.eu/apis/pos-system-api-v21 Retrieves the content of a journey without updating the submitted state. ```APIDOC ## GET /cart/{JourneyId} ### Description Retrieves the content of a journey without updating the submitted state. ### Method GET ### Endpoint /cart/{JourneyId} ### Parameters #### Path Parameters - **JourneyId** (string ) - Required - The unique identifier of the journey. ### Response #### Success Response (200) - **(OK)** - Successful retrieval. #### Success Response (204) - **(No Content)** - Successful retrieval. #### Error Responses - **400** - The request was malformed or could not be processed. - **401** - Access token is not set or invalid. - **500** - The server encountered an unexpected error. ``` -------------------------------- ### Mock Middleware Client Source: https://docs.fiskaltrust.eu/docs/poscreators/possystem-api/android-intent Implement a mock client to simulate receipt signing responses during unit testing. ```kotlin class MockMiddlewareClient { fun signReceipt(request: ReceiptRequest): ReceiptResponse { return ReceiptResponse( ftCashBoxID = request.ftCashBoxID, ftQueueID = UUID.randomUUID(), ftQueueItemID = UUID.randomUUID(), // ... mock response fields ) } } ``` -------------------------------- ### GET /issue/{QueueId}/{QueueItemId}/delivered Source: https://docs.fiskaltrust.eu/apis/pos-system-api Checks if the issued receipt has been delivered to the customer. ```APIDOC ## GET /issue/{QueueId}/{QueueItemId}/delivered ### Description Check if the issued receipt was delivered to the customer at least once (e.g., printed or sent via email/SMS). ### Method GET ### Endpoint /issue/{QueueId}/{QueueItemId}/delivered ### Parameters #### Path Parameters - **QueueId** (string ) - Required - The unique identifier of the queue. - **QueueItemId** (string ) - Required - The unique identifier of the queue item. ### Response #### Success Response (200) - **state** (string) - The delivery state (e.g., Printed). - **message** (string) - Details regarding the delivery method and timestamp. ```