See what voiding an invoice would do, and get the token that allows it
Voiding is irreversible. This says what would happen: which summary is sent to SUNAT (RA for a factura, RC for a boleta), the last day the invoice can be voided (7 days from its issue date, in Lima) and that the invoice stays accepted until SUNAT confirms. It answers a preview_token valid for 10 minutes, bound to this organization, this invoice and what was shown. Nothing is created and nothing is sent. If the invoice cannot be voided, the error says why. In a test organization the header Test-Scenario is validated here too (GET /v1/test/void_scenarios).
POST
https://api.invox.page/v1/invoices/{id}/void/previewAuthorization
Path parameters
Header parameters
Returns
200
What the void would do, and its preview_token.
400
organization_required: This credential needs to say which organization it acts on · validation_failed: The request is not valid · test_scenario_not_allowed: The Test-Scenario header is only accepted in a test organization served by the simulator · test_scenario_unknown: The Test-Scenario header names a scenario that does not exist
JSON
401
unauthenticated: No credential was sent · invalid_credential: The credential is not valid
JSON
403
missing_scope: The credential lacks the permission this operation requires · organization_mismatch: The X-Organization header names another organization than the key's · organization_archived: The organization is archived
JSON
404
not_found: The resource does not exist in this organization
JSON
409
invoice_not_voidable: Only an invoice accepted by SUNAT can be voided · void_not_available: Voiding is not available for invoices issued through this provider · already_voided: The invoice is already voided · void_in_progress: A void of this invoice is already in progress · invoice_externally_reversed: The invoice was recorded as reversed by hand at the provider · invoice_held: The invoice is held: the provider gave an answer the service cannot interpret · void_window_expired: The window to void this invoice has passed
JSON
429
rate_limited: Too many requests
JSON
500
internal_error: The service failed
JSON
503
service_unavailable: The service cannot answer right now
JSON