Errors
An error looks like this. The HTTP status is still 200.
json
{ "id": "1", "success": false, "error": "Нет подключения с аппаратом!" }Common errors
error | What it means | What to do |
|---|---|---|
Нет подключения с аппаратом! | The proxy cannot reach the device | Retry once. If it repeats: check the device is on and its IP is correct. |
Не так быстро, ожидайте окончания предыдущей команды! | Another command is still running | Wait for it to finish, then retry |
Timeout выполнения команды, проверьте сетевые настройки! | The device did not answer in time | Do not retry — see below |
Timeout подключения к аппарату, проверьте сетевые настройки! | Could not connect to the device | Check the device address |
Invalid request ID | A late answer from a previous command | Check with PrintLastReceipt before retrying |
not found | method is not send or ping | Fix your request |
undefined or empty | No connection to the device | Handle it like Нет подключения с аппаратом! |
OtherFmError | A device error, see below |
Everything else comes from the device itself and is passed through as-is.
OtherFmError
A general device error. Check in this order:
- The sums do not match —
amount= sum of lines,totalAmount=amount − discountAmount, payments cover the total. - The shift has been open over 24 hours — send
CloseZReport. - The device has no internet — it cannot reach the tax service.
- The date and time on the device are wrong.
- The device is stuck — turn it off and on.
Not an error envelope
| Symptom | Meaning |
|---|---|
| Connection refused | The proxy is not running |
| TLS / certificate error | The self_rootCA.crt certificate is not installed |
HTTP 500, empty body | Your JSON is broken, or id / method is missing |
HTTP 404 | Wrong address — it must be POST /service |
When you can retry
| Error | Safe to retry |
|---|---|
Нет подключения с аппаратом! | Yes |
Не так быстро… | Yes |
Timeout подключения… | Yes |
| Connection refused, TLS errors | Yes |
OtherFmError and other device errors | Yes, after fixing the cause |
Timeout выполнения команды… | No — check first |
Invalid request ID | No — check first |
After a timeout
A timeout means the proxy stopped waiting. It does not mean the receipt was rejected — it may have been printed.
If you send the sale again, the customer gets two fiscal receipts.
1. Do not resend the Sale.
2. Send PrintLastReceipt.
3. Did your receipt come out?
yes → it was printed, record it as done
no → send the Sale againExample
js
const body = await post({ id: '1', method: 'send', data: { command, payload } })
if (body.success) {
return body.data
}
const error = body.error || 'Unknown error'
// never reached the device — safe to retry
if (/Нет подключения|Не так быстро|Timeout подключения/.test(error)) {
await sleep(3000)
return retry()
}
// the receipt may exist — check before doing anything
if (/Timeout выполнения|Invalid request ID/.test(error)) {
throw new Error('Check the device: ' + error)
}
throw new Error(error)