Durably request an immutable ticket representation
Safe asynchronous compatibility route. Requires documents:pdf; unsupported legacy fields are rejected.
Deprecated
Safe asynchronous compatibility route. Requires documents:pdf; unsupported legacy fields are rejected.
Authorization
bearerAuth Tenant-bound, scoped and expiring Apifact credential. Migrated legacy credentials are accepted only on deprecated v1 writes and tenant-scoped v2 read, poll and download routes. Each operation names the single scope it requires in x-required-scope; the scope array of the security requirement itself is empty because OpenAPI 3.0 requires it to be for a non-oauth2 scheme.
In: header
Header Parameters
Optional. A deterministic document-identity key is derived when omitted.
^[!-~]+$1 <= length <= 200Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/invoice/ticket" \ -H "Authorization: Bearer apf_v2_tu_credencial" \ -H "Content-Type: application/json" \ -d '{ "comprobante": { "tipoDoc": "01", "serie": "F001", "correlativo": "1030" } }'{ "respuesta": { "success": true, "status": 200, "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6", "operationId": "3051932a-fdd2-48fa-b330-7e7d41535969", "documentId": "4704590c-004e-410d-adf7-acb7ca0a7052", "state": "RECEIVED", "operationStatus": "PENDING", "replay": true, "representations": [ { "representationId": "a9b73a9c-9bfc-4552-8caa-c8f5de61ac57", "kind": "pdf-a4", "version": 1, "status": "PENDING", "templateVersion": "invoice-a4-v2", "rendererVersion": "browser-run-a4-v1", "mediaType": "application/pdf", "byteSize": 0, "sha256": "string", "readyAt": "2019-08-24T14:15:22Z", "downloadPath": "string" } ], "mensaje": "string" }}Durably request an immutable A4 representation POST POST
Safe asynchronous compatibility route. Requires documents:pdf; unsupported legacy fields are rejected.
Validate and durably create a canonical invoice, receipt or fiscal note POST POST
Rehearse a body against POST /api/v2/documents/validations first: it runs every check this route runs, answers 200 with the verdict and the computed totals, creates nothing and costs nothing. NEW: 422 DOCUMENT_ARITHMETIC_INVALID refuses the four arithmetic conditions no schema can express, because each needs the document totals — a line whose allowances exceed its own value, a global allowance exceeding the document total, an adjustment over a zero base, and a Credito schedule whose instalments do not settle what is pending (payableAmount, or the detraction's netPayableAmount under the SPOT). Those four were previously accepted here with 201 and failed for the first time during submission, on a comprobante that could no longer be withdrawn. Credit/debit note creation is capability-gated per tenant. Submission uses separate default-off capabilities and, once accepted or observed, produces the QR and the A4/ticket representations for every supported document type. On-demand versioned generation through POST /api/v2/documents/{id}/pdfs is still limited to 01 and 03. The series F000 and B000 are reserved for the platform and are refused with 422 INVALID_DOCUMENT on every document type, notes included: F000 is what the certificate activation probe issues on, and although that probe is not a document of this tenant's, SUNAT records it under this tenant's RUC — so a tenant-issued F000 would collide with a number SUNAT already holds. B000 is reserved beside it although nothing issues on it, because reserving the factura series and leaving its boleta twin free invites the next caller to reach for B000 as the obviously unused one.