File a complaint with your own credential
The door for a client that has its own server: your form posts to you, you post here. Preferred over the credential-less public route whenever you can do it, because the tenant then comes from the credential like everything else in this API. It writes through the SAME implementation the public door uses, so the correlativo, the checks and the record are identical and only source differs — PUBLIC there, API here. NO Idempotency-Key, and this is the one route in v2 where a repeat can duplicate. It is accepted deliberately: a duplicate complaint burns no correlativo, reaches no SUNAT and creates no fiscal fact, and the public twin of this act is a browser that has no key to offer — two doors onto one book that de-duplicated differently would be worse than neither doing it. Refuses with 409 if the company has not minted its book yet.
The door for a client that has its own server: your form posts to you, you post here. Preferred over the credential-less public route whenever you can do it, because the tenant then comes from the credential like everything else in this API. It writes through the SAME implementation the public door uses, so the correlativo, the checks and the record are identical and only source differs — PUBLIC there, API here. NO Idempotency-Key, and this is the one route in v2 where a repeat can duplicate. It is accepted deliberately: a duplicate complaint burns no correlativo, reaches no SUNAT and creates no fiscal fact, and the public twin of this act is a browser that has no key to offer — two doors onto one book that de-duplicated differently would be worse than neither doing it. Refuses with 409 if the company has not minted its book yet.
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
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v2/complaints" \ -H "Authorization: Bearer apf_v2_tu_credencial" \ -H "Content-Type: application/json" \ -d '{ "kind": "RECLAMO", "consumer": { "name": "Ana Torres Mendoza", "documentType": "DNI", "documentNumber": "40404040", "email": "ana.torres@example.com", "phone": "+51 987 654 321" }, "item": { "kind": "SERVICIO", "description": "Plan mensual de consultoria contratado el 12 de agosto", "amount": 1180 }, "detail": "Contrate el plan mensual y se cobro el importe completo, pero el servicio no se presto en la fecha acordada ni se me comunico ninguna reprogramacion.", "requested": "Que se preste el servicio esta semana o se devuelva el importe cobrado." }'{ "schemaVersion": "2.0", "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6", "trackingCode": "string", "kind": "RECLAMO", "submittedAt": "2019-08-24T14:15:22Z"}Read the complaints filed against this company GET GET
Returns complaints newest first, with the consumer's contact details, which the public receipt deliberately withholds. Requires its own scope: a credential that FILES complaints must not thereby be able to enumerate everybody who ever complained, because these are the personal data of people who are not your users and never chose to be in this system. pendingOnly=true returns only what has not been answered, which is the query that matters — the fifteen working day clock runs on those. respondedAt is null until somebody answers, and there is no stored deadline anywhere: it is derived from submittedAt, so it cannot drift from a calendar or from an answer recorded through another door.
Record this company's answer to a complaint POST POST
The act that discharges the obligation: the provider has fifteen working days to answer, and this is the record that they did. Its own scope, because answering is the provider speaking on the record and not a read with a side effect. ONE answer per complaint: posting again CORRECTS the text and reports corrected: true, and respondedAt still reports the FIRST answer — a correction does not move the date the obligation was discharged on, or a late answer could be made to look punctual. The complaint itself is never editable by anyone, including this company: what a consumer filed is the record, and the answer goes beside it rather than over it.