FiscalBridge for integrators.
Here you will find everything your program needs to issue receipts through FiscalBridge: file formats, the local HTTP API, error codes and the kit for the technician performing the installation.
Documentation updated on 14 November 2026 (API version 1).
Install on the host platform.
These are the builds for each system. The download catalogue confirms the current artefact and requirements; testing the fiscal device is separate from installing the agent or application.
- Windows
- x86, x64 and ARM64: agent, interface and CLI distributed as an .exe package. Choose the installer for the processor and check the service after startup.
- Linux
- x64, ARM64 and ARM32: agent, interface and CLI in tar.gz. Check the distribution, native libraries and service. Local QuestPDF is unavailable on ARM32.
- Android
- armeabi-v7a, arm64-v8a and x86_64: the associated host application. Installation and updates may require system confirmation; fiscal support is checked on the terminal model. Local PDF is unavailable, but fiscal/text printing remains a separate workflow.
Each model's support level comes from the FiscalBridge device register (the compatibility list in the kit), not from this page.
Three ways to send receipts.
- Files in a folder. Your program writes the receipt to a text file, and FiscalBridge issues it and writes the response next to it.
- Local HTTP API. Your program sends the receipt as JSON to port 5078, by default only from the computer running FiscalBridge.
- Network stations. Other computers on the same network use the same cash register through port 5077, which is off until you enable the shared cash register.
Files.
File formats FiscalBridge accepts in configured folders (the file channel) and through FiscalBridgePrint.exe. Text files with ^, files with responses in BonOK / BonERR / BonANSWER and FPrint files.
Folders
Bonuri: the configured input folder where your program writes filesRaspuns: responses (next to the input folder; for the profile with subfolders: BonOK / BonERR / BonANSWER)Istoric: processed files, by dayC:\ProgramData\FiscalBridge\files\cli\in: FiscalBridgePrint.exe envelopes (not written manually)
Rules
- Each filename is unique: reusing a name within the protection window returns the first file's response, without a second receipt.
- Write the file completely before placing it in the folder (or rename it): FiscalBridge only picks it up after its size stops changing.
- Encoding: UTF-8 (with or without BOM) or Windows-1250; diacritics are preserved.
- Files over 256 KB are refused before reaching the cash register.
- The unit of measure is mandatory for every item (Emergency Ordinance 69/2024); if missing = “item” and a warning.
- Export paths (RF, JE) are accepted only under FiscalBridge's export folder; otherwise EXPORT_PATH_NOT_ALLOWED.
Lines with ^ (text files with ^)
Extensions: .txt · separator ^ · amounts in bani (1000 = 10,00 lei); quantities in thousandths.
| Command | What it does | Fields | Licence | Example |
|---|---|---|---|---|
S |
Sell item | name; price in bani (1000 = 10,00 lei); quantity in thousandths (1000 = 1); unit of measure (mandatory under GEO 69/2024; missing means “buc” plus a warning); VAT group; department | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
VS |
Return item (on the current receipt) | name; price in bani; quantity in thousandths; unit of measure; VAT group; department | new fiscal receipt | S^CAFEA^1000^2000^buc^1^1 |
P |
Payment | payment type (1..9, according to the register table; 1 = cash); amount in bani | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
TL |
Free text on the receipt | text | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
ST |
Subtotal | no fields | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
DP |
Percentage discount: below an item (S), on that item; after ST, on the subtotal | percentage ×100 (1000 = 10%) | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
DV |
Fixed-value discount: below an item (S), on that item; after ST, on the subtotal | value in bani | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
MP |
Percentage surcharge: below an item (S), on that item; after ST, on the subtotal | percentage ×100 | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
MV |
Fixed-value surcharge: below an item (S), on that item; after ST, on the subtotal | value in bani | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
CB |
Barcode on receipt | code; type (1..4) | new fiscal receipt | S^CAFEA^1000^1000^buc^1^1 |
CF |
Buyer's tax code (printed on the receipt) | Tax ID | new fiscal receipt | CF^55376780 |
I |
Cash paid into the register | amount in bani | always available | I^10000 |
O |
Cash withdrawal from the register | amount in bani | always available | O^5000 |
X |
X report | no fields | always available | X^ |
Z |
Z report (day close) | no fields | always available | Z^ |
RF |
Periodic report by date range (no path); with a third value = ANAF export to the export folder | start date (dd/mm/yyyy); end date; export path (optional; only below the FiscalBridge export folder) | always available | RF^01/09/2026^20/09/2026^ |
RFP |
Periodic report by date range | start date; end date; D = detailed (default) / S = summary | always available | RFP^01/09/2026^20/09/2026^S |
RFZ |
Periodic report by Z number range | first Z; last Z; D / S | always available | RFZ^1^20^D |
JE |
Electronic journal reading | first document (optional); last document (optional); export path (optional; only below the export folder) | always available | JE^1^10 |
VB |
Voiding an open receipt | no fields | always available | VB^ |
DS |
Open the cash drawer | no fields | always available | DS^ |
MD |
Message on the customer display | line 1; line 2 (optional) | new fiscal receipt | MD^Bine ati venit! |
COPIEBON |
Request a duplicate of the last receipt using the cash register's duplicate function (marked DUPLICATE, non-fiscal). Duplicates are unavailable in this version: every request returns COPY_NOT_ALLOWED, without sending any command to the register. FiscalBridge does not produce copies. | no fields | always available | COPIEBON^ |
FPrint lines (CMD,NR,______,_,__;field;…)
Extensions: .inp, .bon · separator ; · amounts in lei, with a decimal point (or whole numbers if the folder is configured that way).
| Command | What it does | Fields | Licence | Example |
|---|---|---|---|---|
S |
Sell item | name; price (lei with a decimal point); quantity; department; group; VAT rate/group; discount type (0 = none); discount value; unit of measure | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
T |
Payment (0 = cash; no amount = balance) | payment type; amount (optional) | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
L |
Subtotal | no fields | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
C |
Discount or surcharge: below an item (S), on that item; after L, on the subtotal | type (0 = percentage markup, 1 = percentage discount, 2 = fixed-amount markup, 3 = fixed-amount discount); value | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
P |
Free text on the receipt (up to 3 lines) | line 1; line 2; line 3 | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
K |
Buyer's tax code | Tax ID | new fiscal receipt | K,1,______,_,__;55376780; |
I |
Cash in/out | type (0 = cash in, 1 = cash out); amount | always available | I,1,______,_,__;0;100.00; |
Z |
Z report | options (optional) | always available | Z,1,______,_,__; |
A |
Sales report by item | -; -; X or Z | always available | A,1,______,_,__;;;X; |
X |
X report | no fields | always available | X,1,______,_,__; |
R |
Periodic report | type; detailed; start date (dd-mm-yyyy); end date | always available | R,1,______,_,__;7;1;01-09-2026;20-09-2026; |
V |
Message on the customer display | action (0 = clear, 1 = top line, 2 = bottom line); text | new fiscal receipt | V,1,______,_,__;1;Bine ati venit; |
D |
Request a duplicate of the last receipt using the cash register's duplicate function (marked DUPLICATE, non-fiscal; alone in the file). Duplicates are unavailable in this version: every request returns COPY_NOT_ALLOWED, without sending any command to the register. FiscalBridge does not produce copies. | no fields | always available | D,1,______,_,__; |
H |
Lock the cash register keyboard (accepted, with no effect: response “Ok”) | no fields | new fiscal receipt | H,1,______,_,__; |
F |
Unlock the cash register keyboard (accepted, with no effect) | no fields | new fiscal receipt | H,1,______,_,__; |
Q |
Barcode on receipt | type; code | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
W |
Free text with style (style is ignored) | style; text | new fiscal receipt | S,1,______,_,__;CAFEA;10.00;1.000;1;1;1;0;0;buc; |
Responses
| Profile | Where the response is | Examples |
|---|---|---|
| Files with text commands separated by “^” | Raspuns\<același nume> (folderul „Raspuns” de lângă folderul în care vin bonurile) |
Receipt issued
BONOK=1Error
BONOK=0Licence refusal
BONOK=0Duplicate refused
BONOK=0 |
| Receipt/response files (BonOK, BonERR, BonANSWER) | la succes: BonOK\<bază>.nrb, BonANSWER\<același nume> ([Answer]) și, ultimul, fișierul mutat în BonOK\<același nume>; la eroare: BonERR\<același nume> = fișierul original + liniile # |
Receipt issued
[Answer]Licence refusal
#FiscalBridge nu este activat pe acest calculator. Deschide ecranul "Licenta" si introdu codul de activare din contul poseo.ro sau porneste perioada de proba de 15 zile. Rapoartele X si Z, numerarul si anularea bonului deschis merg si fara licenta. (LICENSE_MISSING) |
| FPrint | Raspuns\<același nume>, câte o linie pe comandă (+ Raspuns\<bază>.nrb la succes); cu FiscalBridgePrint.exe: <bază>.out lângă fișier |
Receipt issued
OkLicence refusal
Er-LICENSE_MISSING |
| Legacy | <bază>.out (+ <bază>.nrb și <bază>.ini) în folderul de răspuns |
Receipt issued
BONOK=1Licence refusal
BONOK=0 |
| CLI | FiscalBridgePrint.exe: codul de ieșire 5, textul pe stderr și fișierul de răspuns; rezultatul complet (JSON cu ok, code, messageRo) în files\cli\out\<id>.result.json |
Licence refusal
{"ok":false,"code":"LICENSE_MISSING","messageRo":"FiscalBridge nu este activat pe acest calculator. Deschide ecranul „Licență” și introdu codul de activare din contul poseo.ro sau pornește perioada de probă de 15 zile. Rapoartele X și Z, numerarul și anularea bonului deschis merg și fără licență."} |
Names of cash registers and other products are trademarks of their owners. POSEO S.R.L. is not affiliated with them; we name them only to show which devices and files FiscalBridge works with.
Local HTTP API.
Every request carries the X-Api-Key header. The api port (5078, this computer only by default): the key from agent.settings.json, section Api:ApiKey (Windows users can read it). The statii port (5077, shared cash register, off by default): the X-Poseo-Fiscal-Key header with the key from Broker:ApiKey and the X-Poseo-Fiscal-Protocol header with protocol version (1).
Example: a receipt through POST /receipt
Issue a fiscal receipt (request fields documented below). Idempotent by id: the same request does not print a second receipt. A free product is sent at its list price with discountAmount = price × quantity (fixed-value line discount); a percentage discount equal to the whole line value (discountPercent) is refused by some registers (Tremol). Register login: operator (code), operatorPassword and till; an empty operator uses the operator from the register configuration, while printed text comes from operatorText. The response carries bonOk/nrBon and the register response in two text forms: caretResponse (KEY=value pairs on separate lines, like the CaretText file profile) and nrbLine (one line, like BonAnswerText); the same two fields appear in the 422 response and GET /receipt/{id}. The pre-1.0.16 field names for these texts are no longer emitted; a program still reading them can reactivate them with Api:LegacyResponseFieldNames=true in agent.settings.json (the same bytes, alongside the new names).
Request
{
"id": "vanzare-1024",
"operator": "1",
"operatorPassword": "0001",
"till": "1",
"lines": [
{
"name": "CAFEA",
"quantity": 1,
"price": 10.0,
"vatGroup": 1,
"unit": "buc",
"department": 1
}
],
"payments": [
{
"type": 1,
"amount": 10.0
}
]
}Response
{
"bonOk": 1,
"nrBon": "779",
"caretResponse": "BONOK=1\r\nNRBON=779\r\nERRINFO=\r\n",
"nrbLine": "OK;Z=|NR=779|BF=779",
"id": "vanzare-1024",
"code": null,
"outcome": "Issued",
"message": null,
"licenseWarning": null,
"warnings": []
}Resending uses the same ID. A stable ID is required, generated and saved by the caller before POST. The same key and request return the stored result without issuing or validating again on the device; different content or another configured binding is a conflict. API and stations retain distinct historical namespaces. A missing response does not authorise a new ID.
An unknown receipt result remains Unknown and is reconciled with the same ID; FiscalBridge does not resend it automatically, and a timeout does not mean refusal.
All routes
| Route | Port | Key | Licence | What it does |
|---|---|---|---|---|
GET /kiosk/text-file-publications/{requestId:guid}/result |
5078 (this computer) | yes | no licence | Result linked exclusively to the original request through the sealed publication/admission/claim/authoritative-journal chain. Schema 1, contract fiscalbridge.text-file-result.v1, Status Final or Unknown and the fiscal axis. Operations separately retain the original protocol and administrative status with native evidence per step; ConfirmedZNumber comes only from the confirmed ReportZ step, never from a later receipt. AcceptedUnverified/Partial/Sending/Unknown are not confirmations. Missing evidence, retention, corruption or another authority remain Unknown; ACK and Completed do not prove a charge, receipt or administrative effect. Does not read the current configuration, import old journals, execute or delete files. |
GET /kiosk/preflight |
5078 (this computer) | yes | no licence | Kiosk snapshot from the same authority/configuration: known signals, native Z history, queue, device capabilities and TextFiles folder identity/revision. No probing or device I/O; null remains unknown. |
POST /kiosk/text-file-admissions |
5078 (this computer) | yes | no licence | Non-financial admission by RequestId, FolderId, ConsumerIdentity, ConsumerRevision, FileName and ContentSha256. Checks the current generation under lease; keeps the exact intent without charging or issuing. The client continues only through server-side publication, not by writing directly to the folder. |
POST /kiosk/text-file-publications |
5078 (this computer) | yes | no licence | Atomically publish the original ContentBase64 bytes for RequestId/FolderId/FileName admission after rechecking the generation. Echo: RequestId, FolderId, FileName, ContentSha256 lowercase. ACK does not prove a charge or receipt. Retry only with the same request; the manifest binds ClaimId, recovers the missing phase and retains the tombstone after completion. One active publication per folder. The fiscal format is unchanged; see section 9 of the file integration guide. |
GET / |
5078 (this computer) | no | no licence | Liveness probe: agent responds, licence status (licensed, license = C3 code) and broker status. No cash register I/O. |
GET /about |
5078 (this computer) | no | no licence | Build name, version, environment (Production/Test), server and licence key, and uptime. |
GET /api/v2 |
5078 (this computer) | yes | no licence | API v2: contract version, authority to read before the first submission (expectedAuthority), configuration revision, event cursor and operation types (available or with their migration). No device I/O. |
GET /api/v2/openapi.json |
5078 (this computer) | yes | no licence | The local API's OpenAPI 3.1 document (the same openapi.json file as in the integration kit, checked by tests against the real routes). |
GET /api/v2/configuration |
5078 (this computer) | yes | no licence | Configuration revision (and ETag) plus the cash register profile, without connection endpoints or secrets. The revision can be required on POST through If-Match / expectedConfigurationRevision. |
POST /api/v2/operations |
5078 (this computer) | yes | no licence | Asynchronous operation (report-x, report-z, cash-in, cash-out, receipt-cancel, receipt-unlock, drawer-open, native-operation: printed native reports, irreversible resets with confirmed=true, PLU programming and native XML export, only on a model/profile that has them in the register: 409 OperationUnavailableOnProfile / 422 InvalidRequest, zero I/O): 202 Accepted + Location to the operation GET; Prefer: wait=N (max 30 s) waits for the result. The same durable services, queue and licence gate as v1, broker and Control: the same ID on v1 and v2 is the same operation. The licence class is the type's class (all current types: free). |
GET /api/v2/operations/{id} |
5078 (this computer) | yes | no licence | Durable operation status (status, phase, outcomes by axis, result, retryAdvice, evidenceNeeded and original revision), read without import, queue or device; ?type= disambiguates. 404 OperationNotFound = no durable intent: retry with the SAME ID. |
GET /api/v2/reports |
5078 (this computer) | yes | no licence | Inventory of native reports and operations for the SAVED profile, without I/O: capability by model/profile (no family inheritance), exact parameter schema, effect (Read/Print/Reset/Configuration), irreversibility, route (Get/Post/SdkOnly), device command, preconditions and evidence (IDs from the provenance register). Native reports (DevicePrint/DeviceExport) remain distinct from the Bridge's local aggregate (BridgeAggregate). No hardware acceptance (hardwareTestLevel=None). |
GET /api/v2/reports/{operationId} |
5078 (this computer) | yes | no licence | Native read without side effects: executes ONLY a native read without side effects (journal.date: Datecs journal by date range, journal.log: Datecs journal LOG files, plu.read: Tremol item, anaf.last-report-info: latest Tremol ANAF report), through the single queue, with query parameters (exact names from GET /api/v2/reports; repeated names are refused). Parameter validation (empty/reversed range, inclusive endpoints, documented limits) and the model gate run before any I/O: 422 InvalidRequest, 409 OperationUnavailableOnProfile/ConfigurationRequired, 404 NativeOperationUnknown, 422 NativeOperationRouteMismatch for an operation with side effects (which uses POST /api/v2/operations). A cash register error returns 502 with the device code; a read can be retried. No durable intent. |
GET /api/v2/events |
5078 (this computer) | yes | no licence | Server-Sent Events with id = cursor {epoch}.{sequence}; reconnecting with Last-Event-ID (or ?cursor=) resumes retained events. After a restart or expired window, you receive event: gap with the action GET /api/v2/operations/{id}. An event does not prove an effect. |
POST /close |
5078 (this computer) | yes | no licence | Stop the agent. Only from this computer. |
POST /cloud/flush |
5078 (this computer) | yes | no licence | Send receipt summaries from the local queue to the cloud now (if the subscription includes cloud). |
GET /cloud/status |
5078 (this computer) | yes | no licence | Status of receipt summary uploads to the cloud (local queue and latest submission). |
GET /config/device |
5078 (this computer) | yes | no licence | Cash register configuration saved on this computer (secrets masked). |
PUT /config/device |
5078 (this computer) | yes | configuration | Save the cash register configuration (through the single queue). |
POST /config/device/detect |
5078 (this computer) | yes | configuration | Automatically detect the cash register on the computer's ports. |
POST /config/device/test |
5078 (this computer) | yes | configuration | Test the connection to the cash register in the supplied configuration without saving it. |
GET /config/devices |
5078 (this computer) | yes | no licence | Catalogue of devices (makes, models and device profiles) that FiscalBridge can configure. |
POST /config/devices |
5078 (this computer) | yes | no licence | Add a device to the configured list. |
GET /config/devices/configured |
5078 (this computer) | yes | no licence | Devices configured on this computer. |
POST /config/devices/licence |
5078 (this computer) | yes | no licence | Withdrawn: loading a licence from a file. Returns 410 with the instruction “POST /license/activate”. |
DELETE /config/devices/{id} |
5078 (this computer) | yes | no licence | Remove a device from the configured list. |
GET /config/devices/{id} |
5078 (this computer) | yes | no licence | A configured device, by identifier. |
PUT /config/devices/{id} |
5078 (this computer) | yes | no licence | Edit a device in the configured list. |
POST /config/devices/{id}/activate |
5078 (this computer) | yes | configuration | Make the listed device the active cash register (saved through the single queue). |
POST /config/reset |
5078 (this computer) | yes | configuration | Delete the cash register configuration (keeps the receipt journal, payments and licence). Only from this computer. |
GET /config/webservice |
5078 (this computer) | yes | no licence | Current local web service settings (listening port and TLS); the key is not displayed. |
POST /config/webservice |
5078 (this computer) | yes | no licence | Removed: returns 410 WEBSERVICE_CONFIG_REMOVED without saving anything. Change the port and network access in the FiscalBridge application, on the “API and network” page. |
GET /events |
5078 (this computer) | yes | no licence | Event stream (Server-Sent Events): cash register and job status. |
GET /files/activity |
5078 (this computer) | yes | no licence | File channel activity (text files with ^, BonOK/BonERR/BonANSWER, FPrint), with personal identification numbers masked. |
GET /files/activity/{jobId:guid} |
5078 (this computer) | yes | no licence | Details of a processed file: what was sent to the cash register and the response written. |
GET /files/attention |
5078 (this computer) | yes | no licence | Files that need a decision (pending or quarantined). |
GET /files/config |
5078 (this computer) | yes | no licence | Configured file folders. |
PUT /files/config |
5078 (this computer) | yes | no licence | Save the file folders. |
POST /files/config/validate |
5078 (this computer) | yes | no licence | Validate a folder configuration without saving it. |
POST /files/dry-run |
5078 (this computer) | yes | no licence | Shows how a file would be interpreted (commands and response), without a cash register or any writes. |
POST /files/pending/{claimId:guid}/recheck |
5078 (this computer) | yes | no licence | Recheck a file with an uncertain result on the cash register. |
POST /files/pending/{claimId:guid}/resolve |
5078 (this computer) | yes | no licence | Manually close a file with an uncertain result (issued / not issued), recording who decided. |
POST /files/quarantine/{id}/discard |
5078 (this computer) | yes | no licence | Move a quarantined file to history without printing it. |
POST /files/quarantine/{id}/release |
5078 (this computer) | yes | no licence | Release a quarantined file (it is processed again). |
GET /files/status |
5078 (this computer) | yes | no licence | Status of each file folder. |
POST /kitchen/print |
5078 (this computer) | yes | no licence | Print a kitchen ticket (non-fiscal printer) through the durable printer queue. Unconfigured printer = 409 PRINTER_NOT_CONFIGURED, without queuing anything; an already known jobId remains a duplicate (200). |
POST /label/print |
5078 (this computer) | yes | no licence | Print a label (non-fiscal ZPL printer). Unconfigured printer = 409 PRINTER_NOT_CONFIGURED, without queuing anything; an already known jobId remains a duplicate (200). |
GET /license |
5078 (this computer) | yes | no licence | FiscalBridge licence status on this computer (C3 code, dates and entitlements). |
POST /license/activate |
5078 (this computer) | yes | no licence | Activate the licence with the activation code from the poseo.ro portal (requires acceptance of the terms). |
POST /license/demo |
5078 (this computer) | yes | no licence | Start the trial (company Tax ID (CUI) + acceptance of the terms). |
POST /license/refresh |
5078 (this computer) | yes | no licence | Renew the licence from the licence server now. |
GET /license/poseo-binding |
5078 (this computer) | yes | no licence | This computer's binding for the FiscalBridge entitlement included in the Poseo subscription (host kind, computer fingerprint and environment); the Poseo application on the same computer reads it. |
PUT /license/poseo-grant |
5078 (this computer) | yes | no licence | Install the FiscalBridge entitlement included in the Poseo subscription (an FBG1 token signed by the Poseo server for this computer); it only covers receipts from Poseo stations. An entitlement older than the installed one receives 409. |
GET /logs |
5078 (this computer) | yes | no licence | The latest 100 lines from the agent log (agent-*.log in the log folder); with ?source=bootstrap, the latest 200 lines from bootstrap-*.log (fatal startup errors). |
GET /logs/access |
5078 (this computer) | yes | no licence | The latest 200 lines from the HTTP access log. |
POST /receipt |
5078 (this computer) | yes | new fiscal receipt | Issue a fiscal receipt (request fields documented below). Idempotent by id: the same request does not print a second receipt. A free product is sent at its list price with discountAmount = price × quantity (fixed-value line discount); a percentage discount equal to the whole line value (discountPercent) is refused by some registers (Tremol). Register login: operator (code), operatorPassword and till; an empty operator uses the operator from the register configuration, while printed text comes from operatorText. The response carries bonOk/nrBon and the register response in two text forms: caretResponse (KEY=value pairs on separate lines, like the CaretText file profile) and nrbLine (one line, like BonAnswerText); the same two fields appear in the 422 response and GET /receipt/{id}. The pre-1.0.16 field names for these texts are no longer emitted; a program still reading them can reactivate them with Api:LegacyResponseFieldNames=true in agent.settings.json (the same bytes, alongside the new names). |
GET /receipt/{id} |
5078 (this computer) | yes | no licence | Stored receipt result by id (from the durable journal). Does not access the cash register. Fields: id, state (completed/uncertain), bonOk, nrBon, errCode, errInfo, code, outcome, message, caretResponse, nrbLine. |
GET /reports/{type} |
5078 (this computer) | yes | no licence | Does not execute any report: x/z refuses with 405 FISCAL_ADMIN_POST_REQUIRED, periodic/anaf/anaf-aggregate refuses with 405 REPORT_POST_REQUIRED, without a queue or device. Use POST /reports/x or /reports/z with an ID and authority, or POST /reports/periodic|anaf|anaf-aggregate respectively. |
POST /reports/{type} |
5078 (this computer) | yes | always available | The periodic report (printed on the register), NATIVE ANAF export (type=anaf: succeeds only with the device's verified manifest for the exact requested range; otherwise 422 EXPORT_NOT_NATIVE / EXPORT_RANGE_MISMATCH / EXPORT_INCOMPLETE, with the artefact retained for verification; models without native export return 501) and, separately, the bridge's local aggregate (type=anaf-aggregate: A4200 metadata without reading sales or printing; it is not a fiscal journal). Export responses include origin (device-export|bridge-aggregate), nativeReport, fiscalCoverage and signatureValidation. Range from&to (yyyy-MM-dd) or fromZ&toZ (≥ 1, end ≥ start), detailed and exportDir in the query or JSON body. |
GET /status |
5078 (this computer) | yes | always available | Cash register status (read through the single queue). |
POST /update/apply-now |
5078 (this computer) | yes | no licence | Install the downloaded version now: 202 accepted, 409 register busy, 404 nothing downloaded. |
POST /update/check |
5078 (this computer) | yes | no licence | Start a check for a new version; immediately returns 202 with the current status. |
GET /update/status |
5078 (this computer) | yes | no licence | Automatic update status (version, window and message in Romanian). |
POST /cash/in |
5077 (stations) | yes | always available | Cash payment in. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
POST /cash/out |
5077 (stations) | yes | always available | Cash withdrawal. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
GET /device/capabilities |
5077 (stations) | yes | no licence | What the cash register supports (native duplicate, programmable rates), from the saved configuration, without I/O. |
POST /device/config |
5077 (stations) | yes | configuration | Save the cash register configuration (from the administration station). |
GET /device/descriptor |
5077 (stations) | yes | always available | Cash register details (make, model and serial number). |
POST /device/import |
5077 (stations) | yes | configuration | Import cash register settings saved in an associated Poseo installation, only on a host without a configured register (an existing configured register is not replaced). |
GET /device/status |
5077 (stations) | yes | always available | Cash register status. |
GET /device/vat |
5077 (stations) | yes | always available | VAT rates programmed in the cash register. |
POST /device/vat |
5077 (stations) | yes | configuration | Programme VAT rates in the cash register. |
GET /device/vat/can-program |
5077 (stations) | yes | no licence | Whether VAT rates can be programmed now (without I/O). |
POST /drawer/open |
5077 (stations) | yes | always available | Open the cash drawer. |
POST /drawer/open/durable |
5077 (stations) | yes | always available | Open the cash drawer as a durable administrative operation (Shared stations): stable ID, confirmed=true and expectedAuthority, without an amount or currency. The same intent as the host's v2 drawer-open type. The register does not report opening, so success remains AcceptedUnverified (422); NotSent (200) only with internal evidence that no byte was sent to the device. The old /drawer/open route is unchanged. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
GET /health |
5077 (stations) | yes | no licence | Broker probe: protocol version and the actual service name. |
GET /operations/{key} |
5077 (stations) | yes | no licence | Status of an idempotent operation (in progress, completed or uncertain). Does not access the cash register. |
POST /receipt |
5077 (stations) | yes | new fiscal receipt | Issue a station's receipt (v1 protocol), idempotent by id. |
POST /receipt/cancel |
5077 (stations) | yes | always available | Void an open receipt. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
GET /receipt/caps |
5077 (stations) | yes | no licence | What this version's receipt builder accepts (without I/O). |
GET /receipt/evidence |
5077 (stations) | yes | always available | Evidence of the last receipt read from the cash register (recovery after an interruption). |
POST /receipt/unlock |
5077 (stations) | yes | always available | Unlock a cash register left with an open receipt. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
POST /receipt/validate |
5077 (stations) | yes | new fiscal receipt | Validate the receipt on the host, without cash register I/O, before the station's sales program takes payment (card payment does not pass through FiscalBridge). |
POST /reports/anaf |
5077 (stations) | yes | always available | NATIVE ANAF export by date range (verified device manifest for the exact requested range); local metadata or a file without provenance is refused (EXPORT_NOT_NATIVE). |
POST /reports/anaf-z |
5077 (stations) | yes | always available | NATIVE ANAF export by Z number range (verified manifest for the exact requested range); local metadata or a file without provenance is refused (EXPORT_NOT_NATIVE). |
POST /reports/journal |
5077 (stations) | yes | always available | Read the electronic journal. |
GET /reports/native |
5077 (stations) | yes | no licence | Catalogue of native cash register reports and operations from the host's SAVED profile, without sending any bytes to the register or using the queue: each operation's availability and blocking reason, parameter schema (type, required, min/max, choices, default), effect (Read/Print/Reset/Configuration), output (DevicePrint/DeviceExport), route (Get/Post/SdkOnly), irreversibility and executable (can be requested through POST /reports/native/run). Unconfigured device = configured=false. Older FiscalBridge host = 404. |
POST /reports/native/run |
5077 (stations) | yes | always available | Execute a native operation from the catalogue (operationId + parameters as invariant text + confirmed) through the host's single queue. Reads (route=Get) need no ID and return the register's text (complete=false = outcome Partial, 422: the text is not the full report). Side effects (route=Post: printed reports, irreversible clears, XML export) require a stable ID and expectedAuthority; printing and clearing require confirmed=true. Exports are written on the host under the export root: the response contains export.directory (real host path), export.files (name, size, SHA-256) and the manifest. Device programming (Configuration effect) is unavailable from stations. Typed result: 200 Completed/AcceptedUnverified; 422 Refused (final register refusal), NotSent, Partial, NoEffect, Unknown (unconfirmed). Refusal before the queue and register returns 400 with its code (NATIVE_OPERATION_UNKNOWN, NATIVE_OPERATION_INVALID, NATIVE_OPERATION_UNAVAILABLE, NOT_CONFIGURED, NATIVE_CONFIRMATION_REQUIRED, NATIVE_OPERATION_ID_REQUIRED, NATIVE_OPERATION_NOT_ON_STATIONS). All are legal reports or exports and work with an expired subscription. |
POST /reports/periodic-date |
5077 (stations) | yes | always available | Periodic report by date range. |
POST /reports/periodic-z |
5077 (stations) | yes | always available | Periodic report by Z number range. |
POST /reports/receipt-copy |
5077 (stations) | yes | always available | Duplicate receipt: duplicate printing is unavailable in this version. The route returns 400 COPY_NOT_ALLOWED without any command being sent to the register; the message states whether the register lacks the duplicate function or the function is disabled in this version. FiscalBridge does not produce copies of fiscal receipts. |
POST /reports/x |
5077 (stations) | yes | always available | X report. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
POST /reports/z |
5077 (stations) | yes | always available | Z report. Requires a stable ID and expectedAuthority; confirmed=true for mutations, plus RON and an exact amount for cash. Typed administrative result 200 final/422 uncertain; replay without a new send. The old body without an ID receives 400. |
POST /reports/x |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /reports/z |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /cash/in |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /cash/out |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /receipt/cancel |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /receipt/unlock |
5078 (this computer) | yes | always available | Durable fiscal administration: caller-provided ID and expectedAuthority required; confirmed=true (canonical X). Cash: explicit RON, 0.01 to 99,999.99 with at most two exact decimal places. The same canonical request in API/Broker/Control; typed result 200 final/422 uncertain; 409 conflict or 503 authority do not prove NotSent. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
POST /drawer/open/durable |
5078 (this computer) | yes | always available | Durable fiscal administration, cash drawer: caller-provided ID, expectedAuthority required, confirmed=true, with no amount or currency. The same canonical request in API/Broker and the same intent as the v2 drawer-open type. The cash register does not report opening: success remains AcceptedUnverified (422); NotSent (200) only with internal evidence that no byte was sent to the device. Replay without a new send/event. See MIGRARE-ADMINISTRATIE-DURABILA.md. |
GET /operations/authority |
5078 (this computer) | yes | no licence | Discover the verified existing authority (installationId and logicalClientId), without a queue, device or provisioning. Authentication precedes the read; a missing, foreign or pending authority returns 503. The client persists the authority before a new intent and does not replace it on retry. |
GET /operations/authority |
5077 (stations) | yes | no licence | Discover the verified existing authority (installationId and logicalClientId), without a queue, device or provisioning. Authentication precedes the read; a missing, foreign or pending authority returns 503. The client persists the authority before a new intent and does not replace it on retry. |
GET /receipt-binding/v1/contract |
5078 (this computer) | yes | no licence | Versioned contract for the existing authority, without provisioning, a queue or a device. |
GET /receipt-binding/v1/operation |
5078 (this computer) | yes | no licence | Exact read by key and the three original headers. NotObserved does not prove non-issue; only correlated final evidence permits recovery. |
GET /receipt-binding/v1/contract |
5077 (stations) | yes | no licence | Versioned contract for the existing authority, without provisioning, a queue or a device. |
GET /receipt-binding/v1/operation |
5077 (stations) | yes | no licence | Exact read by key and the three original headers. NotObserved does not prove non-issue; only correlated final evidence permits recovery. |
Examples: curl, C#, Python, Node.
Replace CHEIA-DIN-agent.settings.json with the key from agent.settings.json (section Api:ApiKey). The complete API manifest is public in JSON format: /fiscalbridge/api.json.
A fiscal receipt: POST /receipt
A new receipt uses the bound-receipt-v1 contract: read the contract and host authority once, save the intent (authority, operation key and receipt fingerprint) BEFORE the first POST, send the receipt with the three headers and, after any response (including timeout), read the evidence with the same headers. On retry, send the SAME intent; a timeout does not mean the receipt was not issued. The C# example is complete and runs automatically against the FiscalBridge API host; curl, Python and Node are fragments: the fingerprint is calculated with the FiscalBridge library, not by hashing the JSON file.
bon.json
{
"id": "vanzare-1024",
"operator": "1",
"operatorPassword": "0001",
"till": "1",
"lines": [
{
"name": "CAFEA",
"quantity": 1,
"price": 10.0,
"vatGroup": 1,
"unit": "buc",
"department": 1
}
],
"payments": [
{
"type": 1,
"amount": 10.0
}
]
}curl (fragment, not a complete program)
# FRAGMENT, not a complete program: shows the headers and order of the bound-receipt-v1 steps.
# X-FiscalBridge-Expected-Fingerprint = SHA-256 (hex, uppercase) of the DEFAULT System.Text.Json serialisation of the type
# ReceiptRequest; the FiscalBridge library calculates it (see the C# example), NOT a hash of the bon.json file.
# intentie.json (base64url authority, operation key and fingerprint) is written to disk BEFORE the first POST.
FB=http://127.0.0.1:5078
# 1) Once, before the receipt: the host contract and authority (save them in intentie.json).
curl -sS -X GET "$FB/receipt-binding/v1/contract" -H "X-Api-Key: CHEIA-DIN-agent.settings.json"
# 2) The receipt, with the saved intent; on every retry: the SAME headers and SAME bon.json.
curl -sS -X POST "$FB/receipt" -H "X-Api-Key: CHEIA-DIN-agent.settings.json" -H "Content-Type: application/json" \
-H "X-FiscalBridge-Receipt-Binding: bound-receipt-v1" \
-H "X-FiscalBridge-Expected-Authority: <autoritatea din intentie.json>" \
-H "X-FiscalBridge-Expected-Fingerprint: <amprenta din intentie.json>" --data @bon.json
# 3) After ANY POST result (and after a timeout): the evidence, with the same headers. Only final evidence closes the receipt.
curl -sS -X GET "$FB/receipt-binding/v1/operation?key=api-receipt%3A<id-ul-din-bon.json>" -H "X-Api-Key: CHEIA-DIN-agent.settings.json" \
-H "X-FiscalBridge-Receipt-Binding: bound-receipt-v1" -H "X-FiscalBridge-Expected-Authority: <autoritatea>" -H "X-FiscalBridge-Expected-Fingerprint: <amprenta>"C#
// Complete C# example: a NEW fiscal receipt using FiscalBridge's bound-receipt-v1 contract (api port).
// References: FiscalBridge libraries Fiscal.Broker.Contracts (headers, fingerprint and evidence) and Fiscal.Integration.Api
// (the ReceiptRequest type, used to calculate the fingerprint). Usage:
// var rezultat = await ExempluBonFiscalBridge.EmiteAsync(ExempluBonFiscalBridge.CreeazaClient(), "bon.json");
// Rule: the intent (host authority + key + fingerprint) is saved to disk BEFORE the first POST; on every retry
// (timeout, lost response, restart), send EXACTLY the same intent. An unknown result is NOT resolved with a new id.
using System.Net;
using System.Net.Http.Json;
using System.Text.Json;
using Fiscal.Broker.Contracts;
using Fiscal.Integration.Api;
namespace ExempluFiscalBridge;
public static class ExempluBonFiscalBridge
{
public const string Adresa = "http://127.0.0.1:5078";
public const string AntetCheie = "X-Api-Key";
public const string Cheie = "CHEIA-DIN-agent.settings.json";
private const string Format = ReceiptBindingProtocol.ApiRequestFormat;
/// <summary>Durable receipt intent: saved before the first POST and reused identically on retry.</summary>
public sealed record IntentieBon(string Gazda, WireOperationAuthority Autoritate, string CheieOperatie, string Amprenta);
/// <summary>Final = the evidence read after POST is final and matches the intent; otherwise the result is UNKNOWN.</summary>
public sealed record RezultatBon(bool Final, bool Emis, string? NumarBon);
/// <summary>Client without automatic redirects (a redirect must not move the intent to another host).</summary>
public static HttpClient CreeazaClient()
=> new(new HttpClientHandler { AllowAutoRedirect = false }) { BaseAddress = new Uri(Adresa) };
public static async Task<RezultatBon> EmiteAsync(HttpClient http, string fisierBon, CancellationToken ct = default)
{
var bon = JsonSerializer.Deserialize<ReceiptRequest>(await File.ReadAllTextAsync(fisierBon, ct), JsonSerializerOptions.Web)
?? throw new InvalidDataException("The receipt file is empty.");
if (string.IsNullOrWhiteSpace(bon.Id))
throw new InvalidDataException("The receipt needs a stable id, created and saved before the first submission.");
// Fingerprint = SHA-256 of the default System.Text.Json serialisation of ReceiptRequest (not a file hash).
var amprenta = ReceiptBindingProtocol.Hash(bon);
var fisierIntentie = fisierBon + ".intentie.json";
var intentie = File.Exists(fisierIntentie)
? JsonSerializer.Deserialize<IntentieBon>(await File.ReadAllTextAsync(fisierIntentie, ct))
?? throw new InvalidDataException("The saved intent is unreadable; check the receipt before sending anything.")
: await PregatesteAsync(http, bon, amprenta, fisierIntentie, ct);
if (intentie.Gazda != http.BaseAddress!.ToString() || intentie.Amprenta != amprenta)
throw new InvalidOperationException(
"The receipt or host differs from the saved intent. Retry the exact initial request; a new receipt needs a new id.");
using (var post = Cerere(HttpMethod.Post, "/receipt", intentie))
{
post.Content = JsonContent.Create(bon);
try
{
using var raspuns = await http.SendAsync(post, ct);
// 400/409 = request not admitted (headers, fingerprint or reused id): correct it, do not retry blindly.
if (raspuns.StatusCode is HttpStatusCode.BadRequest or HttpStatusCode.Conflict)
throw new InvalidOperationException(
$"Bonul nu a fost admis ({(int)raspuns.StatusCode}): {await raspuns.Content.ReadAsStringAsync(ct)}");
}
catch (HttpRequestException) { /* lost response: use the evidence below, NOT a new POST */ }
catch (TaskCanceledException) when (!ct.IsCancellationRequested) { /* timeout: same rule */ }
}
// Read the evidence after ANY POST result, with the same headers.
using var citire = Cerere(HttpMethod.Get,
ReceiptBindingProtocol.OperationPath + "?key=" + Uri.EscapeDataString(intentie.CheieOperatie), intentie);
using var dovada = await http.SendAsync(citire, ct);
var operatie = dovada.IsSuccessStatusCode ? await dovada.Content.ReadFromJsonAsync<WireReceiptBindingOperation>(ct) : null;
if (!ReceiptBindingProofPolicy.IsFinal(operatie, intentie.Autoritate, intentie.CheieOperatie, intentie.Amprenta, Format))
return new(Final: false, Emis: false, NumarBon: null); // UNKNOWN: keep the files and retry later
return new(Final: true, Emis: operatie!.Result!.Success, NumarBon: operatie.Result.ReceiptNumber);
}
private static async Task<IntentieBon> PregatesteAsync(HttpClient http, ReceiptRequest bon, string amprenta,
string fisierIntentie, CancellationToken ct)
{
using var cerere = new HttpRequestMessage(HttpMethod.Get, ReceiptBindingProtocol.ContractPath);
cerere.Headers.Add(AntetCheie, Cheie);
using var raspuns = await http.SendAsync(cerere, ct);
raspuns.EnsureSuccessStatusCode();
var contract = await raspuns.Content.ReadFromJsonAsync<WireReceiptBindingContract>(ct);
if (contract?.Authority is not { } autoritate || !ReceiptBindingProofPolicy.IsContract(contract, autoritate, Format))
throw new InvalidOperationException("The host does not offer the bound-receipt-v1 contract; do not send any receipt.");
var intentie = new IntentieBon(http.BaseAddress!.ToString(), autoritate, ReceiptBindingProtocol.Prefix(Format) + bon.Id, amprenta);
// Durable before the first POST: write a temporary file to disk, then rename it without overwriting.
var temporar = fisierIntentie + ".tmp";
await using (var fisier = new FileStream(temporar, FileMode.Create, FileAccess.Write, FileShare.None, 4096, FileOptions.WriteThrough))
{
await JsonSerializer.SerializeAsync(fisier, intentie, cancellationToken: ct);
fisier.Flush(flushToDisk: true);
}
File.Move(temporar, fisierIntentie, overwrite: false);
return intentie;
}
private static HttpRequestMessage Cerere(HttpMethod metoda, string cale, IntentieBon intentie)
{
var cerere = new HttpRequestMessage(metoda, cale);
cerere.Headers.Add(AntetCheie, Cheie);
cerere.Headers.Add(ReceiptBindingProtocol.MarkerHeader, ReceiptBindingProtocol.ContractId);
cerere.Headers.Add(ReceiptBindingProtocol.AuthorityHeader, ReceiptBindingHeaders.EncodeAuthority(intentie.Autoritate));
cerere.Headers.Add(ReceiptBindingProtocol.FingerprintHeader, intentie.Amprenta);
return cerere;
}
}
Python (fragment, not a complete program)
# FRAGMENT, not a complete program: shows the headers and order of the bound-receipt-v1 steps.
# X-FiscalBridge-Expected-Fingerprint = SHA-256 (hex, uppercase) of the DEFAULT System.Text.Json serialisation of the type
# ReceiptRequest; the FiscalBridge library calculates it (see the C# example), NOT a hash of the bon.json file.
# intentie.json (base64url authority, operation key and fingerprint) is written to disk BEFORE the first POST.
import json, requests
FB = "http://127.0.0.1:5078"
CHEIE = {"X-Api-Key": "CHEIA-DIN-agent.settings.json"}
# 1) Once, before the receipt: the host contract and authority (save them in intentie.json).
contract = requests.request("GET", FB + "/receipt-binding/v1/contract", headers=CHEIE).json()
with open("intentie.json", encoding="utf-8") as f:
intentie = json.load(f)
antete = {**CHEIE, "X-FiscalBridge-Receipt-Binding": "bound-receipt-v1",
"X-FiscalBridge-Expected-Authority": intentie["autoritate"], "X-FiscalBridge-Expected-Fingerprint": intentie["amprenta"]}
# 2) The receipt, with the saved intent; on every retry: the SAME headers and SAME bon.json.
with open("bon.json", "rb") as f:
requests.post(FB + "/receipt", headers={**antete, "Content-Type": "application/json"}, data=f.read())
# 3) After ANY POST result (and after a timeout): the evidence, with the same headers.
dovada = requests.request("GET", FB + "/receipt-binding/v1/operation", headers=antete, params={"key": intentie["cheie"]})
print(dovada.status_code, dovada.json())Node (fragment, not a complete program)
// FRAGMENT, not a complete program: shows the headers and order of the bound-receipt-v1 steps.
// X-FiscalBridge-Expected-Fingerprint = SHA-256 (hex, uppercase) of the DEFAULT System.Text.Json serialisation of the type
// ReceiptRequest; the FiscalBridge library calculates it (see the C# example), NOT a hash of the bon.json file.
// intentie.json (base64url authority, operation key and fingerprint) is written to disk BEFORE the first POST.
import { readFile } from "node:fs/promises";
const FB = "http://127.0.0.1:5078";
const cheie = { "X-Api-Key": "CHEIA-DIN-agent.settings.json" };
// 1) Once, before the receipt: the host contract and authority (save them in intentie.json).
const contract = await (await fetch(FB + "/receipt-binding/v1/contract", { method: "GET", headers: cheie })).json();
const intentie = JSON.parse(await readFile("intentie.json", "utf8"));
const antete = { ...cheie, "X-FiscalBridge-Receipt-Binding": "bound-receipt-v1",
"X-FiscalBridge-Expected-Authority": intentie.autoritate, "X-FiscalBridge-Expected-Fingerprint": intentie.amprenta };
// 2) The receipt, with the saved intent; on every retry: the SAME headers and SAME bon.json.
await fetch(FB + "/receipt", { method: "POST", headers: { ...antete, "Content-Type": "application/json" },
body: await readFile("bon.json", "utf8") }).catch(() => {});
// 3) After ANY POST result (and after a timeout): the evidence, with the same headers.
const dovada = await fetch(FB + "/receipt-binding/v1/operation?key=" + encodeURIComponent(intentie.cheie), { method: "GET", headers: antete });
console.log(dovada.status, await dovada.json());Z report: POST /reports/z
The Z report closes the fiscal day on the cash register and is irreversible. Create and save the ID before the first submission; after a timeout or lost response, retry with the SAME ID. A timeout does not mean the report was not produced, and a new ID means a new Z report. Read the authority (installationId, logicalClientId) with GET /operations/authority and save it with the ID. A 200 response is a final result (read “outcome”); 422 is an uncertain result: keep the ID and reconcile, do not send another one.
raport-z.json
{
"id": "<ID-unic-per-raport>",
"confirmed": true,
"expectedAuthority": {
"installationId": "<installationId din GET /operations/authority>",
"logicalClientId": "<logicalClientId din GET /operations/authority>"
}
}curl
# raport-z.json has the ID saved before the first submission; on retry (timeout, lost response), send the SAME file.
curl -X POST http://127.0.0.1:5078/reports/z -H "X-Api-Key: CHEIA-DIN-agent.settings.json" -H "Content-Type: application/json" --data @raport-z.jsonC#
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "CHEIA-DIN-agent.settings.json");
// raport-z.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
var cerere = File.ReadAllText("raport-z.json");
var raspuns = await http.PostAsync("http://127.0.0.1:5078/reports/z", new StringContent(cerere, System.Text.Encoding.UTF8, "application/json"));
// 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
Console.WriteLine($"{(int)raspuns.StatusCode} {await raspuns.Content.ReadAsStringAsync()}");Python
import json, requests
# raport-z.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
with open("raport-z.json", encoding="utf-8") as f:
cerere = json.load(f)
raspuns = requests.post("http://127.0.0.1:5078/reports/z", headers={"X-Api-Key": "CHEIA-DIN-agent.settings.json"}, json=cerere)
# 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
print(raspuns.status_code, raspuns.json())Node
import { readFile } from "node:fs/promises";
// raport-z.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
const cerere = await readFile("raport-z.json", "utf8");
const raspuns = await fetch("http://127.0.0.1:5078/reports/z", {
method: "POST",
headers: { "X-Api-Key": "CHEIA-DIN-agent.settings.json", "Content-Type": "application/json" },
body: cerere,
});
// 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
console.log(raspuns.status, await raspuns.json());X report: POST /reports/x
The X report does not close the day, but follows the same rule: create and save the ID before the first submission and use the SAME ID for every retry. A timeout does not mean the report was not produced. Read the authority (installationId, logicalClientId) with GET /operations/authority and save it with the ID. A 200 response is a final result (read “outcome”); 422 is an uncertain result: keep the ID and reconcile, do not send another one.
raport-x.json
{
"id": "<ID-unic-per-raport>",
"confirmed": true,
"expectedAuthority": {
"installationId": "<installationId din GET /operations/authority>",
"logicalClientId": "<logicalClientId din GET /operations/authority>"
}
}curl
# raport-x.json has the ID saved before the first submission; on retry (timeout, lost response), send the SAME file.
curl -X POST http://127.0.0.1:5078/reports/x -H "X-Api-Key: CHEIA-DIN-agent.settings.json" -H "Content-Type: application/json" --data @raport-x.jsonC#
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "CHEIA-DIN-agent.settings.json");
// raport-x.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
var cerere = File.ReadAllText("raport-x.json");
var raspuns = await http.PostAsync("http://127.0.0.1:5078/reports/x", new StringContent(cerere, System.Text.Encoding.UTF8, "application/json"));
// 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
Console.WriteLine($"{(int)raspuns.StatusCode} {await raspuns.Content.ReadAsStringAsync()}");Python
import json, requests
# raport-x.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
with open("raport-x.json", encoding="utf-8") as f:
cerere = json.load(f)
raspuns = requests.post("http://127.0.0.1:5078/reports/x", headers={"X-Api-Key": "CHEIA-DIN-agent.settings.json"}, json=cerere)
# 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
print(raspuns.status_code, raspuns.json())Node
import { readFile } from "node:fs/promises";
// raport-x.json has the ID saved before the first submission; on retry, use the SAME ID, not a new one.
const cerere = await readFile("raport-x.json", "utf8");
const raspuns = await fetch("http://127.0.0.1:5078/reports/x", {
method: "POST",
headers: { "X-Api-Key": "CHEIA-DIN-agent.settings.json", "Content-Type": "application/json" },
body: cerere,
});
// 200 = final result (read “outcome”); 422 = uncertain result: keep the ID and reconcile.
console.log(raspuns.status, await raspuns.json());The licence and what is always permitted.
The “Licence” column in the tables shows the right required by each operation:
- always available: Always available, even with an expired or missing licence: Z/X reports, voiding open receipts, cash, journal, ANAF export and status.
- new fiscal receipt: New fiscal receipt: requires a valid licence covering the active cash register.
- configuration: Configuration saving and connection tests: always available.
What a licence refusal looks like.
When the licence does not permit an operation, FiscalBridge sends nothing to the cash register and responds in the format of the channel used for the request.
| Channel | Format | Example |
|---|---|---|
| Local API (port 5078) | HTTP 403, application/problem+json, the X-FiscalBridge-License header and field code = LICENSE_* | {
"type": "https://poseo.ro/fiscalbridge/licenta",
"title": "Licență",
"status": 403,
"detail": "Nu există o licență activă pe acest calculator.",
"code": "LICENSE_MISSING"
} |
| Network stations (port 5077) | HTTP 400 with field code = LICENSE_*Refusing the current HTTP request does not prove the outcome of earlier attempts with the same ID. The SDK keeps Unknown without authoritative evidence linked to the original request; it does not automatically resend the receipt or payment. | {
"code": "LICENSE_MISSING",
"message": "Nu există o licență activă pe acest calculator.",
"kind": "invalid-operation"
} |
| Files, Files with text commands separated by “^” profile | BONOK=0 / ERRCODE=LICENSE_* / ERRINFO=<message> | no example |
| Files, Receipt/response files profile (BonOK, BonERR, BonANSWER) | BonERR with ErrorCode=LICENSE_* | no example |
| Files, FPrint profile | the profile's error format; the code in the activity log | no example |
| Files, CLI profile | {"ok":false,"code":"LICENSE_*","messageRo":"…"} and exit code 5 | no example |
Licence codes
LICENSE_OKLICENSE_WARNING_OFFLINELICENSE_EXPIREDLICENSE_DEMO_EXPIREDLICENSE_WRONG_ENVIRONMENTLICENSE_MISSINGLICENSE_DEVICE_NOT_COVEREDLICENSE_CLOCK_INVALID
What your program must send for a correct receipt.
FiscalBridge issues exactly what it receives. Your program is responsible for the receipt content:
- the unit of measure for each item (for example “item” or “kg”);
- the code of the operator making the sale;
- the buyer's Tax ID (CUI), when requested, through the dedicated field (the
CFcommand or the fiscal field in the API), not as free text; - the correct payment type (cash, card, vouchers and others), according to the cash register table;
- the tip as a separate item named “tip”;
- the SGR deposit on a separate receipt line.
What FiscalBridge does not do.
- Duplicate receipt: Duplicate receipt: duplicate printing is unavailable in this version. Every request receives COPY_NOT_ALLOWED without any command being sent to the register; the message states whether the register lacks the duplicate function or the function is disabled in this version. FiscalBridge does not produce copies of fiscal receipts.
- FiscalBridge cannot correct a receipt after issue. An open receipt can be voided; an issued receipt remains in the fiscal memory as printed.
- It does not register the cash register fiscally or change its header: these remain with the accredited service unit.
The technician's kit.
The archive contains the installation guide, the documentation on this page, sample files, the Test-FiscalBridge.ps1 verification script and the integration verification report. The report is a working document for checking the integration; it does not replace the installation declaration or the authorised distributor's official forms.
Frequently asked questions for integrators.
How do I issue a fiscal receipt from my application?
Send the receipt as JSON to POST http://127.0.0.1:5078/receipt with the key in the X-Api-Key header; FiscalBridge issues it on the cash register and responds with the receipt number. The examples on this page show the request in curl, C#, Python and Node.
What happens if I resend the same request?
A stable ID is required, generated and saved by the caller before POST. The same key and request return the stored result without issuing or validating again on the device; different content or another configured binding is a conflict. API and stations retain distinct historical namespaces. A missing response does not authorise a new ID.
What works without a licence?
Fiscal reports and mandatory operations do not depend on the licence. Always available, even with an expired or missing licence: Z/X reports, voiding open receipts, cash, journal, ANAF export and status.
What happens when the computer has no internet?
With a FiscalBridge licence: up to 14 days without internet, with a warning from day 7. With FiscalBridge included in the Poseo subscription: the Poseo limit of 30 days.
Can FiscalBridge print a copy of a receipt?
Duplicate receipt: duplicate printing is unavailable in this version. Every request receives COPY_NOT_ALLOWED without any command being sent to the register; the message states whether the register lacks the duplicate function or the function is disabled in this version. FiscalBridge does not produce copies of fiscal receipts.
Where can I find the full API description?
The public API manifest in JSON format, with all routes, licence classes and refusal forms, is at /fiscalbridge/api.json.
The technician's kit.
Download the kit or return to the API documentation and integration examples.