See what closing held invoices and voids as failed would do, after asking their provider (staff only)
The way out for a held document whose provider never again answers something the service understands. Irreversible, so it starts here. Send { "signature": "…" } or { "invoice_ids": […], "void_ids": […] }, as for a release. Each document (at most 20 per call; more: true says there are more) is FIRST asked about at its provider, because an answer nobody understands may hide a success: an invoice by a lookup of its number, a void by a query of its status. What the provider holds as ours (or, for a void, a verdict of SUNAT) is ADOPTED right here, exactly as the read-only recheck adopts it, and is never closed (check: adopted). What the provider does not hold can be closed (not_found). What it did not answer, or answered without settling anything (unanswered, unrecognized), can be closed only with accept_risk: true: closing it may mark here as failed a document SUNAT accepted, and its sale may be invoiced twice. Nothing is sent to the provider and nothing is closed by this call. The answer lists each document with what the provider answered, a warning to show the person who decides, and a preview_token valid for 10 minutes, bound to this person and to exactly the closable documents and their holds. Reserved to the staff of the service; anyone else gets staff_required, and a service-account key gets person_credential_required.
https://api.invox.page/v1/staff/held/close/previewAuthorization
Request body JSON required
Returns
200
Each document with what its provider answered, the warning and the token of the close.