Validate and durably create a comprobante de percepción (CPE, 40)
A comprobante de percepción declares the documents an agente de percepción is collecting, the collection made against each one, the amount charged on top and the total collected. It is the mirror of the retention and the only arithmetic difference is the sign. Creation is capability-gated per tenant (perception_issuance_enabled, off by default) and does not contact SUNAT.
A comprobante de percepción declares the documents an agente de percepción is collecting, the collection made against each one, the amount charged on top and the total collected. It is the mirror of the retention and the only arithmetic difference is the sign. Creation is capability-gated per tenant (perception_issuance_enabled, off by default) and does not contact SUNAT.
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
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
curl -X POST "https://example.com/api/v2/perceptions" \ -H "Idempotency-Key: b6a2f0e4-1c3d-4a5b-8e7f-9d0c1b2a3e4f" \ -H "Authorization: Bearer apf_v2_tu_credencial" \ -H "Content-Type: application/json" \ -d '{ "schemaVersion": "1.0", "documentType": "40", "series": "P001", "number": "31", "issueDate": "2026-08-12", "currency": "PEN", "regimeCode": "01", "regimePercent": "2", "note": "Percepcion por venta interna aplicada al cobro de la factura", "agent": { "documentType": "6", "documentNumber": "20601030405", "legalName": "MI EMPRESA EMISORA S.A.C.", "address": "AV. JAVIER PRADO ESTE 1234", "ubigeo": "150131", "district": "SAN ISIDRO", "province": "LIMA", "department": "LIMA" }, "receiver": { "documentType": "6", "documentNumber": "20512345678", "legalName": "COMERCIAL LOS ANDES S.A.C.", "address": "AV. AREQUIPA 4321", "ubigeo": "150122", "district": "MIRAFLORES", "province": "LIMA", "department": "LIMA" }, "documents": [ { "documentType": "01", "series": "F001", "number": "1024", "issueDate": "2026-08-12", "totalAmount": "1180.00", "currency": "PEN", "payment": { "id": "1", "amount": "1180.00", "date": "2026-08-12" }, "regimeDate": "2026-08-12" } ] }'{ "schemaVersion": "2.0", "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6", "operationId": "3051932a-fdd2-48fa-b330-7e7d41535969", "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6", "documentType": "20", "documentName": "string", "state": "VALIDATED", "replay": true}Durably request comprobante de retención (CRE, 20) dispatch POST POST
Durably requests dispatch through SUNAT's 'otros CPE' service, which is a different deployment from the one that carries facturas and boletas. Answers 202 with the operation id allocated at creation. Dispatch is gated by submission_publication_enabled AND retention_issuance_enabled, both re-read under a row lock immediately before the outbound call. Exactly one envelope can ever leave for a given document: the attempt is fenced in the database before the call, and a run that finds a fenced attempt with no CDR settles AMBIGUOUS for reconciliation rather than resending.
Get a tenant-owned comprobante de percepción (CPE, 40) and its references GET GET
Returns the stored header and every reference in the order the signed XML declares them, with the PEN base, the amount perceived and the total for each. netAmount = baseAmount + regimeAmount.