See what would be issued, without issuing it
Runs the same validation and calculation as issuing. Takes no number and stores nothing.
POST
https://api.invox.page/v1/invoices/previewAuthorization
Header parameters
Request body JSON required
- template_idoptional
The template its PDF prints with: one of yours or a shared one (
system:thermal-80). Default: the issuer'sdefault_template, elsesystem:a4. On the live face your template prints its promoted version; on the test face its latest published one. The invoice keeps the version it printed with. - issue_dateoptionalstring
The fiscal issue date as a Lima wall clock, with no zone. Default: now in Lima. Never in the future, and at most 3 days in the past for a factura and 7 for a boleta (the legal window to send it to SUNAT). An older one is refused with
issue_date_too_oldbefore any number is taken.pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$
Returns
200
The calculated invoice and the number it would take.
400
organization_required: This credential needs to say which organization it acts on · validation_failed: The request is not valid · malformed_request: The request body is not valid JSON · 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 · series_not_found: The series does not exist or is not active for this document type · establishment_not_found: The establishment does not exist for this issuer · template_not_found: The template does not exist in this organization
JSON
409
issuer_not_configured: The organization has no issuer yet · invoice_type_not_allowed_for_regime: An issuer under the Nuevo RUS does not issue facturas · provider_not_connected: The issuer has no provider connection · template_archived: The template is archived · template_not_published: The template has no published version yet · template_version_not_promoted: The template has no version promoted to production
JSON
422
establishment_required: The issuer has more than one establishment: say which one · establishment_series_mismatch: The series belongs to another establishment · establishment_inactive: The establishment is inactive · template_document_type_not_accepted: The template does not accept this type of document
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