INP File Interface
The INP file interface provides a file-based integration method for fiscal operations. The driver monitors a dedicated directory for each INP-enabled fiscal device; when a command file is placed in that directory, the driver processes it and generates the corresponding result files.
Setup and Configuration
To enable INP file processing for a fiscal device:
- In the FisCool UI, open the fiscal device configuration
- Enable the "INP Compatibility" option
- Set an "INP Directory" (e.g.
C:\FisCool\INP) - The driver begins monitoring that folder for new files
The driver automatically creates the result subdirectories BonOK, BonERR and BonANSWER inside the INP directory.
File Detection and Processing
- Files with the extensions
.inp,.txtor.bonare always processed as INP commands. - Files with other extensions are processed only if their content is recognisable as INP commands; otherwise they are ignored.
- Files larger than 1 MB are ignored.
- Encoding: UTF-8 is recommended. Files that are not valid UTF-8 are decoded as Windows-1252 (legacy compatibility). Non-breaking spaces are normalised to regular spaces.
- Empty lines and comment lines starting with
#or//are ignored.
Processing Lifecycle
1. Detection
- The directory is watched by the filesystem (immediate detection).
- A ~100 ms delay is applied so the writing application can finish the file.
2. Claiming
- The file is renamed to
<name>.processing- this prevents double processing. - If the rename fails, the file is skipped (already claimed or locked).
3. Parsing & Validation
- The content is parsed line by line and validated.
- A parse error immediately produces a
BonERRfile with the error details appended.
4. Execution
- The parsed operation is executed on the fiscal device. The device must be in the
Connectedstate, otherwise an execution error is produced. - An execution error (device error, validation error) also produces a
BonERRfile.
5. Success
- The input file is moved intact to
BonOK/<name>(audit trail). - An answer file with the same name is created in
BonANSWER/, containing the operation results.
6. Error
- The original content plus the error details is written to
BonERR/<name>. - The
.processingfile is removed. No answer file is created for failed operations.
Output Directory Structure
<INP Directory>\BonOK\- successfully processed input files (moved intact)<INP Directory>\BonERR\- input files that failed (with error details appended)<INP Directory>\BonANSWER\- answer files (same name as the input file) with the operation results
Input File Format
INP files are plain text files with one command per line. Two command syntaxes are supported:
| Syntax | Field separator | General form | Numeric values |
|---|---|---|---|
| Legacy / FPrint | ; | Command,1,______,_,__;param1;param2;... | Decimals with dot: 2.50, 1.000 |
| Simple / Modern | ^ | COMMAND^param1^param2^... | Integers with implied decimals: 250 = 2.50, 1000 = 1.000 |
The syntax is detected automatically for every file, based on the commands it contains - do not mix the two syntaxes in the same file. The format of the answer and error files follows the syntax of the input file (see Answer File Format below). Commands are case-insensitive; UPPERCASE is recommended.
Example INP File - Legacy / FPrint
S,1,______,_,__;Coffee;2.50;1.000;1;1;1;0;0;buc
T,1,______,_,__;0;2.50;;;;
Example INP File - Simple / Modern
S^Coffee^250^1000^buc^1^1
P^1^250
Legacy / FPrint Format - Command Reference
Each command starts with a command letter followed by the standard header ,1,______,_,__; the parameters after the first ; vary by command type.
S Sell Item
Adds a product line to the fiscal receipt.
S,1,______,_,__;description;price;quantity;department;_;vat_code;_;_;unit
| Position | Parameter | Type | Required | Description |
|---|---|---|---|---|
| 1 | description | String | Yes | Product name (semicolon not allowed - it is the field separator) |
| 2 | price | Number | Yes | Unit price in currency units, dot as decimal separator, max 2 decimals (e.g. 2.50). Negative values are accepted for corrections. |
| 3 | quantity | Number | Yes | Quantity, max 3 decimals (e.g. 1.000) |
| 4 | department | Number | Yes | Department code 0–99; 0 = no department (the driver chooses based on the VAT group - recommended) |
| 5 | - | - | No | Ignored (may be empty) |
| 6 | vat_code | Number/String | Yes | VAT group: 1=A, 2=B, 3=C, 4=D, 5=E; or a percentage such as 9%/19% (mapped to the device group with that rate); or the words scutit (0%, prefers group E) / neimpozabil (0%, prefers a non-E group) |
| 7 | - | - | No | Ignored (may be empty) |
| 8 | - | - | No | Ignored (may be empty) |
| 9 | unit | String | No | Unit of measure (defaults to buc) |
S,1,______,_,__;Coffee Espresso;2.50;1.000;1;1;1;0;0;buc
S,1,______,_,__;Bread 500g;1.20;1.000;1;1;2;0;0;buc
S,1,______,_,__;Fuel Premium;1.45;25.500;3;1;1;0;0;l
Notes:
- Price and quantity use dot (
.) as decimal separator. - Items with price
0are printed as free-text notes (fiscal devices reject zero-value sale lines). - Diacritics are removed automatically before printing.
- The percentage/letter VAT value must correspond to a VAT group active on the device, otherwise the receipt is rejected.
T Payment
Adds a payment to the receipt. Special case: type 4 with an empty amount acts as a subtotal command.
T,1,______,_,__;payment_type;amount;;;;
| Parameter | Type | Required | Description |
|---|---|---|---|
| payment_type | Number | No | 0=Cash (default when empty), 1=Card, 2=Credit, 3=Meal vouchers, 4=Value vouchers, 5=Voucher, 6=Modern payment, 7=Cashback (card + cash advance), 8=Other methods |
| amount | Number | No | Payment amount in currency units. May be empty - see the auto-completion rules below. |
T,1,______,_,__;0;20.00;;;; <!-- 20.00 cash -->
T,1,______,_,__;1;15.50;;;; <!-- 15.50 card -->
T,1,______,_,__;4;;;;; <!-- type 4 with EMPTY amount = subtotal -->
Payment rules (applied automatically):
- If the file contains no
Tcommand, the receipt is closed with the full total as cash. - If there is exactly one
Tcommand with amount0/empty, its amount is set to the receipt total. - If the payments cover less than the total, the difference is added automatically as cash.
- If the payments exceed the total and the surplus is covered by cash lines, the cash amounts are reduced automatically so the payments match the total exactly.
- A surplus that cannot be absorbed from cash is only valid together with payment type 7 (cashback) - the difference is handed to the customer as cash. Otherwise the receipt is rejected because the payments don't match the total.
- Multiple
Tcommands are allowed for mixed payments.
C Discount/Surcharge
Applies a discount or surcharge. Placed after an S (item) or subtotal line, it applies to that line; placed after the payment (T) lines, it applies to the whole receipt.
C,1,______,_,__;discount_type;value;;;;
| Parameter | Type | Required | Description |
|---|---|---|---|
| discount_type | Number | Yes | 0=Surcharge %, 1=Discount %, 2=Surcharge value, 3=Discount value |
| value | Number | Yes | Percentage (0.00–100.00) for types 0/1, amount in currency units for types 2/3 |
C,1,______,_,__;1;5.00;;;; <!-- 5% discount on the previous line -->
C,1,______,_,__;3;2.50;;;; <!-- 2.50 value discount -->
C,1,______,_,__;0;10.00;;;; <!-- 10% surcharge -->
Notes:
- Only one receipt-level discount is allowed per receipt.
- A
Ccommand that does not follow an item or subtotal line (and appears before any payment) is rejected.
P Free Text
Prints free-text lines on the receipt. Each semicolon-separated value becomes one printed line; empty values are skipped. Text longer than the device's print width is truncated by the device.
P,1,______,_,__;line1;line2;line3;;;
P,1,______,_,__;Thank you;for your visit;Welcome back;;;
Non-fiscal receipts: a file containing only P commands (no S lines, no reports or cash operations; T/L lines are allowed but ignored) is printed as a non-fiscal receipt. This is the file-based way to print order slips or proforma documents.
K Customer Fiscal Code (CUI)
Opens the fiscal receipt with the customer's fiscal code. Must appear before the first sale command (free-text lines may precede it). The receipt is automatically marked as an invoice-type receipt.
K,1,______,_,__;cui_number;
K,1,______,_,__;RO22352741;
I Cash In/Out
Performs a cash deposit or withdrawal. Must be the only command in the file.
I,1,______,_,__;operation_type;amount;;;;
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation_type | Number | Yes | 0=Deposit, 1=Withdraw |
| amount | Number | Yes | Amount in currency units (must be > 0) |
I,1,______,_,__;0;100.00;;;; <!-- deposit 100.00 -->
I,1,______,_,__;1;50.00;;;; <!-- withdraw 50.00 -->
Z / A Fiscal Reports
Prints the X report, the Z report or the departments report. Must be the only command in the file.
Z,1,______,_,__;report_type;A form (compatibility):
A,1,______,_,__;;;report_type;;;
| Parameter | Type | Required | Description |
|---|---|---|---|
| report_type | Number/String | Yes | Z form: 0 or X = X report, 1 or Z = Z report, 3 or D = departments report.A form: X = X report, Z = Z report, D = departments report. No other values are accepted. |
Z,1,______,_,__;0; <!-- X report -->
Z,1,______,_,__;1; <!-- Z report -->
Z,1,______,_,__;3; <!-- departments report -->
A,1,______,_,__;;;X;;; <!-- X report (A form) -->
Note: the header variant Z,1,______,_,__; (report type as the 2nd comma-separated header field, empty payload) is also accepted: Z,0,...; = X report, Z,1,...; = Z report, Z,3,...; = departments report.
Note: the departments report (type 3) prints the daily sales grouped by department, without closing the fiscal day. Devices whose protocol has no such report fail the file with a BonERR (error 1015, operation not supported).
L Subtotal
Inserts a subtotal line (equivalent to T with type 4 and an empty amount).
L,1,______,_,__;;;;;
DS Open Drawer
Opens the cash drawer. Must be the only command in the file. Note: unlike the other commands, DS uses the bare form without the standard header.
DS;pulse_duration_ms or just DS;
| Parameter | Type | Required | Description |
|---|---|---|---|
| pulse_duration_ms | Number | No | Pulse duration in milliseconds. When omitted, the driver default applies (Datecs: 200 ms; Daisy: the device's last configured value). Ignored by Tremol devices. |
DS; <!-- open with the driver/device default pulse -->
DS;200 <!-- open with a 200 ms pulse -->
54 Formatted Text
Prints a text line with formatting options. Note: unlike the other commands, 54 uses a comma after the command code and ^ as the field separator, without the standard header. It is accepted with this exact form in both syntaxes (legacy/FPrint and simple/modern files).
54,text^bold^italic^double_height^underline^alignment^
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | String | Yes | The text to print. Must not contain ^. |
| bold | Flag | No | 1 = enabled; 0 or empty = disabled. |
| italic | Flag | No | 1 = enabled; 0 or empty = disabled. |
| double_height | Flag | No | 1 = enabled; 0 or empty = disabled. |
| underline | Flag | No | 1 = enabled; 0 or empty = disabled. |
| alignment | Number | No | 0 or empty = left, 1 = center, 2 = right. |
54,Plain text^^^^^^
54,Bold text^1^^^^^
54,Bold, double height, centered^1^^1^^1^
Inside a fiscal receipt (file with S/T commands), the text is printed as a plain free-text line - the formatting flags are accepted but not applied.
In a text-only file (only 54 and/or P lines), a non-fiscal slip is printed and the formatting is honoured on devices that support it (e.g. Datecs); other devices print plain text.
Accepted-and-ignored commands: lines starting with 8 (barcode/QR commands from other driver dialects) are accepted inside receipt files but ignored.
Simple / Modern Format - Command Reference
The simple/modern syntax uses ^ as the field separator, without the FPrint header. All monetary values are transmitted in bani (integer, 2 implied decimals: 250 = 2.50 lei), quantities with 3 implied decimals (1000 = 1.000) and percentages with 2 implied decimals (500 = 5%). The ^ character must not appear inside values.
S Sell Item
Adds a product line to the fiscal receipt.
S^description^price^quantity^unit^vat_group^department
| Position | Parameter | Type | Required | Description |
|---|---|---|---|---|
| 1 | description | String | Yes | Product name (^ not allowed - it is the field separator) |
| 2 | price | Number | Yes | Unit price in bani: 350 = 3.50 lei. Only positive values - use VS for corrections. |
| 3 | quantity | Number | Yes | Quantity with 3 implied decimals: 1000 = 1.000; 120 = 0.120 (e.g. 120 g at a per-kg price) |
| 4 | unit | String | No | Unit of measure (defaults to buc) |
| 5 | vat_group | Number | Yes | VAT group index: 1=A, 2=B, 3=C, 4=D, 5=E. Unlike the legacy syntax, percentages and the words scutit/neimpozabil are not accepted here. |
| 6 | department | Number | No | Department code; 0 or 1 = no department (the driver chooses based on the VAT group - recommended: 1) |
S^Coffee Espresso^250^1000^buc^1^1
S^Bread 500g^120^1000^buc^2^1
S^Apples Golden^850^120^kg^1^1 <!-- 0.120 kg at 8.50 lei/kg -->
Notes: items with price 0 are printed as free-text notes (fiscal devices reject zero-value sale lines); diacritics are removed automatically before printing.
VS Void Item (correction)
Adds a negative product line (correction/storno of an item on the same receipt). Same parameters as S; the price is applied with a negative sign. Support depends on the device model; devices whose protocol cannot represent a correction line reject the receipt with error 1015.
VS^description^price^quantity^unit^vat_group^department
S^Coffee Espresso^250^1000^buc^1^1
VS^Coffee Espresso^250^1000^buc^1^1 <!-- cancels the line above -->
S^Cappuccino^400^1000^buc^1^1
P^1^400
P Payment
Adds a payment to the receipt. Careful: in the simple/modern syntax P is the payment command (free text is TL), and the payment codes are one higher than in the legacy/FPrint T command.
P^payment_type^amount
| Parameter | Type | Required | Description |
|---|---|---|---|
| payment_type | Number | No | 1=Cash (default when empty), 2=Card, 3=Credit, 4=Meal vouchers, 5=Value vouchers, 6=Voucher, 7=Modern payment, 8=Cashback (card + cash advance), 9=Other methods |
| amount | Number | No | Amount in bani: 1950 = 19.50 lei. May be empty - see the auto-completion rules of the legacy T command, which apply identically. |
P^1^2000 <!-- 20.00 cash -->
P^2^1550 <!-- 15.50 card -->
P^1^1000
P^2^1300 <!-- mixed payment: 10.00 cash + 13.00 card -->
DP / DV / MP / MV Discount / Surcharge
Applies a discount (D) or surcharge (M), as a percentage (P) or value (V). Placed after an S (item) or ST (subtotal) line, it applies to that line; DP/DV placed after the payment lines applies to the whole receipt (max. one per receipt).
DP^value | DV^value | MP^value | MV^value
| Command | Meaning | Value |
|---|---|---|
DP | Percentage discount | Percent with 2 implied decimals: 500 = 5%, 1250 = 12.5% |
DV | Value discount | Amount in bani: 250 = 2.50 lei |
MP | Percentage surcharge | Percent with 2 implied decimals |
MV | Value surcharge | Amount in bani |
S^Coffee^1000^1000^buc^1^1
DP^1000 <!-- 10% discount on the coffee -->
P^1^900
ST Subtotal
Inserts a subtotal line (equivalent to the legacy T with type 4 and an empty amount, or L). A discount/surcharge command placed immediately after it applies to the subtotal.
ST^
TL Free Text
Prints one free-text line on the receipt. One TL command per line of text.
TL^text
TL^Thank you
TL^for your visit
Non-fiscal receipts: a file containing only TL (and/or 54) lines is printed as a non-fiscal receipt, exactly like a P-only file in the legacy syntax.
CF Customer Fiscal Code (CUI)
Opens the fiscal receipt with the customer's fiscal code. Must appear before the first sale command (free-text lines may precede it). The receipt is automatically marked as an invoice-type receipt.
CF^cui_number
CF^RO22352741
S^Coffee^250^1000^buc^1^1
P^1^250
I / O Cash In / Cash Out
Performs a cash deposit (I) or withdrawal (O). Must be the only command in the file.
I^amount | O^amount
I^10000 <!-- deposit 100.00 -->
O^5000 <!-- withdraw 50.00 -->
X / Z / D Fiscal Reports
Prints the X report (X^), the Z report (Z^) or the departments report (D^). Must be the only command in the file.
X^ | Z^ | D^
Note: unlike the legacy Z command, Z^ carries no type code - legacy-style payloads such as Z^0/Z^3 are rejected. Devices whose protocol has no departments report fail D^ with a BonERR (error 1015).
VB Void Receipt
Marks the whole receipt as voided: the document is opened, printed and then cancelled instead of being closed fiscally. It can be combined with sale and text lines - for example the test slips some POS applications print at configuration time. No payments are registered on a voided receipt.
VB^
TL^-------------------------
TL^POS TEST SLIP
TL^-------------------------
VB^
Note: VB cannot be combined with report or cash-operation commands.
DS Open Drawer
Opens the cash drawer. Must be the only command in the file. Same behaviour as the legacy DS command.
DS^pulse_duration_ms or just DS^
Accepted-and-ignored commands: MD^line1^line2 (customer display) is accepted but ignored, as are 8x barcode lines. The formatted-text command 54 (documented in the legacy section) works in simple/modern files too, with its comma form unchanged.
Complete INP File Examples
Simple Cash Sale
S,1,______,_,__;Coffee;2.50;1.000;1;1;1;0;0;buc
S,1,______,_,__;Croissant;1.80;1.000;1;1;2;0;0;buc
T,1,______,_,__;0;4.30;;;;
Sale with Discount and Card Payment
S,1,______,_,__;Laptop Computer;899.99;1.000;2;1;1;0;0;buc
S,1,______,_,__;Mouse Wireless;25.50;1.000;2;1;1;0;0;buc
C,1,______,_,__;1;5.00;;;;
T,1,______,_,__;1;924.21;;;;
The 5% discount applies to the line right before it (the mouse: 25.50 − 1.28 = 24.22), so the receipt total is 899.99 + 24.22 = 924.21. If the payment were short, the difference would be added automatically as cash.
Mixed Payments
S,1,______,_,__;Fuel Premium;1.45;40.000;3;1;1;0;0;l
T,1,______,_,__;0;50.00;;;;
T,1,______,_,__;1;8.00;;;;
Receipt with Customer Fiscal Code
K,1,______,_,__;RO22352741;
S,1,______,_,__;Professional Service;150.00;1.000;1;1;1;0;0;buc
T,1,______,_,__;1;150.00;;;;
Receipt with Free Text
S,1,______,_,__;Product A;10.00;1.000;1;1;1;0;0;buc
P,1,______,_,__;Thank you for;your purchase;Welcome back;;;
T,1,______,_,__;0;10.00;;;;
Non-Fiscal Receipt (text only)
P,1,______,_,__;--- ORDER #42 ---;;;
P,1,______,_,__;2x Coffee;1x Croissant;;
P,1,______,_,__;--- END ---;;;
Cash Deposit
I,1,______,_,__;0;100.00;;;;
X Report / Z Report / Departments Report
Z,1,______,_,__;0;
Z,1,______,_,__;1;
Z,1,______,_,__;3;
The same operations in the simple/modern syntax (one operation per file):
Cash Sale (simple/modern)
S^Coffee^250^1000^buc^1^1
S^Croissant^180^1000^buc^2^1
P^1^430
Sale with CUI, Discount, Text and Mixed Payment (simple/modern)
CF^RO22352741
S^Notebook A4^380^5000^buc^1^1
DP^500
TL^Eco tax included in price
P^1^1000
P^2^805
Cash Deposit / Withdrawal (simple/modern)
I^10000 <!-- deposit 100.00 (own file) -->
O^5000 <!-- withdraw 50.00 (own file) -->
X Report / Z Report / Departments Report (simple/modern)
X^
Z^
D^
Answer File Format (BonANSWER)
Answer files are created in BonANSWER/ with the same name as the input file. The answer format follows the syntax of the input file.
Legacy / FPrint Answers (INI format)
Receipt Response
[Answer]
SlipNumber=123
nZrep=45
nFNum=1050
| Field | Description |
|---|---|
SlipNumber | Fiscal receipt number |
nZrep | Number of the Z report the receipt belongs to |
nFNum | Device fiscal receipt counter |
Daisy devices only: for compatibility with POS software configured for legacy Daisy drivers, the following extra fields are appended:
CommandName=close_fiscal_receipt
Allreceipt=000123 ; all receipts (fiscal + non-fiscal) since the last Z, zero-padded to 6 digits
FiscReceipt=000098 ; fiscal receipts since the last Z, zero-padded to 6 digits
DeviceSerial=8000596182
Report Response (X/Z)
[Answer]
nRep=42
TaxA=125.50
TaxB=67.80
TaxC=0.00
TaxD=0.00
TaxE=0.00
TaxA–TaxE are the daily sale totals per VAT group, in currency units with 2 decimals.
The departments report (type 3) prints only on paper and returns no totals - its answer file uses the generic Status=0 shape below.
Cash Operation Response
[Answer]
TotalCash=1250.75
TotalCash is the drawer total after the operation, in currency units.
Other Operations (e.g. open drawer)
[Answer]
Status=0
Simple / Modern Answers
Files written in the simple/modern syntax receive a compact key=value answer instead:
Receipt Response
BONOK=1
NRBON=123
NRBON is the fiscal receipt number.
Other Operations
| Operation | Answer |
|---|---|
| X / Z report | BONOK=1NRBON=RAPORT |
| Cash in / cash out | BONOK=1NRBON=CASH |
| Anything else (e.g. departments report, open drawer) | BONOK=1NRBON=OK |
Error File Format (BonERR)
The error format also follows the syntax of the input file.
Legacy / FPrint Errors
Error files contain the original INP content followed by the error details as comment lines:
S,1,______,_,__;Produs Test;10.50;1.500;120;1;1;0;0;kg
#Linia 1 | S,1,______,_,__;Produs Test;10.50;1.500;120;1;1;0;0;kg
#ErrorCode (-112207) : Valoare incorecta a parametrului departament.
- Parse errors use negative codes in the
-112200…-112231range and reference the offending line. - Execution errors (device/communication errors after successful parsing) use
Linia 0 | Execution Errorand carry the driver's standard error codes (see Error Codes - e.g.500no paper,1004device not connected):
S,1,______,_,__;Produs Test;10.50;1.500;1;1;1;0;0;buc
#Linia 0 | Execution Error
#ErrorCode (1004) : Problemă la conexiune: Dispozitivul refuză conexiunea
Simple / Modern Errors
For files in the simple/modern syntax, the BonERR file contains a compact key=value error instead:
BONOK=0
ERRCODE=-112203
ERRINFO=Preț invalid.
ERRCODE uses the same codes as the legacy format: negative codes for parse errors, the driver's standard positive codes for execution errors.
Best Practices
- File naming: use unique, sequential file names to avoid conflicts.
- Result monitoring: watch
BonANSWERandBonERRfor the outcome of each file; the outcome file always has the same name as the input file. - Encoding: prefer UTF-8; Windows-1252 is accepted for legacy compatibility.
- Separator: never use the field separator inside values -
;in legacy/FPrint files,^in simple/modern files. - Single writer per file: write the file completely (or write to a temporary name and rename) before the driver picks it up.
- One monitor per folder: only FisCool should process the INP directory to prevent race conditions.
- Disk space:
BonOKandBonANSWERaccumulate over time - archive or clean them periodically.
Integration Notes
The INP file interface is ideal for:
- Legacy system integration: systems that cannot use the HTTP/WebSocket APIs
- Batch processing: queued receipt printing
- Reliability: file-based operations provide natural persistence and a built-in audit trail
- Debugging: input, answer and error files fully document every transaction
Important: only the commands documented above are part of the supported INP interface, in either of the two documented syntaxes - legacy/FPrint (semicolon-separated, standard header ,1,______,_,__;) or simple/modern (caret-separated).