Overview
If OpenFiskal is temporarily unreachable, your backend should queue the fiscalization calls it would normally send, then replay them when connectivity returns. Offline handling is a compliance-controlled workflow. You should treat it as an exception path with audit logging, operator guidance, and manual remediation.Legal and operational boundaries
- Only use offline processing where the configured country capability allows it
- Keep a durable audit trail of the local action, operator, and device
- Treat locally rendered receipts as provisional until OpenFiskal confirms completion
- Never rewrite timestamps, totals, or tender composition during replay
What to queue
Queue the exact mutation requests you would have sent online:POST /operationsPOST /operations/{operationId}/completePOST /operations/{operationId}/void
- the original request body
- the original
Idempotency-Key - the last known
If-Matchvalue when the request is a mutation - the business timestamp from your POS domain model, sent as
occurred_at(see below) - the local operator and terminal context
Send the time each step happened
Every request that records a step accepts an optionaloccurred_at (ISO 8601 with an offset): when that step happened on your POS. Without it, OpenFiskal uses the time it receives the request, which after an outage is the replay time.
On German registers,
started_at and completed_at are the receipt’s start and end in the DSFinV-K archive. Without a start, the receipt starts at completed_at.
On /complete, completed_at in the request body is an alias of occurred_at, so existing clients can keep sending it. Sending both with different times returns 422 validation_error.
- Record
occurred_atwhen the cashier acts, and store it with the queued request. - Send the same value on every retry, together with the same
Idempotency-Key. - OpenFiskal numbers and signs receipts in the order it receives the requests, not by
occurred_at. Replay in the order the steps happened. A request replayed out of order is still accepted, but the archive then shows receipt numbers whose times go backwards. - Open the session before the operations it covers, and close it after the last one.
- The TSE signs at replay time.
occurred_atkeeps your books on the POS time; it does not turn a receipt issued while offline into a signed one. - OpenFiskal rejects
occurred_atwith422 validation_errorwhen it is more than 5 minutes ahead of its clock, when a completion is earlier than the start you sent, or when an adjustment, count or close is earlier than its session’s opening. POST /operations/{operationId}/voiddoes not acceptoccurred_atyet.
Replay rules
- Replay queued requests in the original business order.
- Reuse the original idempotency key on retry.
- Do not recalculate payload values during replay.
- Re-read the operation if replay receives
412 precondition_failed. - Stop on the first unresolved network or semantic error and resolve that item before continuing.
When OpenFiskal is up but the underlying signing service is down
A separate failure mode is OpenFiskal being reachable while its upstream signing service (e.g. the TSE of a KassenSichV register) is unavailable. Most fiscal events are signed inline and a signing failure surfaces as422 validation_error on POST /operations/{id}/complete — your normal retry-after-recovery path applies.
The exception is session_cash_count: signing the counted-vs-expected variance is best-effort. If the upstream signing service is unreachable at count time, the API still returns 2xx, the session transitions to counted, and the variance is recomputed locally. The signature is filled in later when the signing service recovers. From the integrator’s point of view this is invisible — the session’s customer-facing Z-Bon flow is unaffected.
Provisional receipts
If you complete checkout in your POS before OpenFiskal is reachable again, treat any locally produced receipt as provisional with a “Signature unavailable” message. After the queued completion succeeds, the authoritative fiscal payload is thefiscal_information block on the completion response.
A dedicated Hosted Receipts API is planned but not yet available; in the current release, integrators render receipts themselves from fiscal_information.
Failure recovery
Escalate to manual remediation when:- the replay queue cannot restore ordering
- a payload now fails regime validation
- the operation was already completed through another channel
- a provisional receipt was issued but no final completion can be obtained inside the required timeline
Implementation checklist
- persist queued mutations durably
- send
occurred_aton every create, completion and session operation - retain idempotency keys across retries
- preserve operation ordering
- preserve the latest operation
ETag - surface replay failures for manual resolution
- fetch the hosted receipt only after the completion call succeeds