Durably request comprobante de retención (CRE, 20) dispatch
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.
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.
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
Path Parameters
uuidHeader Parameters
1 <= length <= 200Response Body
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/retentions/497f6eca-6276-4993-bfeb-53cbbbba6f08/submissions" \ -H "Idempotency-Key: b6a2f0e4-1c3d-4a5b-8e7f-9d0c1b2a3e4f" \ -H "Authorization: Bearer apf_v2_tu_credencial"{ "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}Get a tenant-owned comprobante de retención (CRE, 20) 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 withheld and the net for each. netAmount = baseAmount - regimeAmount.
Validate and durably create a comprobante de percepción (CPE, 40) POST POST
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.