Print error recovery flow (code = 15)
code = 15 means print stage failed (printError may contain printer-specific reason), but business operation can already be committed.
This applies to /sale, /refund, /close_shift, /deposit, /withdraw. For /x_report, /dates_report and /check_copy, the same
print failure currently surfaces with a different code (-1 or absent) — see §8.1 — so trigger this same recovery flow whenever
printError is non-null, not only when code = 15.
Recommended flow:
- Receive error response with
code = 15. - Save
documentExtIDand full response payload to incident log. - Call
/check_statusfor the same document. - If
docStatus = 1, treat payment/fiscal operation as completed and recover only printing:- call
/check_copy(requiresdocumentID) after printer issue is resolved.
- call
- If
docStatus = 0, continue polling/check_status. - If document is still not found in an unknown-delivery scenario, resend same operation with same
documentExtID.