Skip to content

Reference / SUNAT

Invoice validation

Checks against SUNAT whether an invoice exists and what state it is in.

POST /api/sunat/consulta-cpe

What it's for: Validate a supplier's invoice before booking it as tax credit.

Authentication

X-API-Key string header required
X-API-Key: tu_token
Authorization string header
Authorization: Bearer tu_token

Either one works. The token is generated from the client dashboard. Go to the dashboard →

Body parameters

ruc-consultante string required
Credential of your own application registered with SUNAT, you provide it. Example: 20123456789
client-id string required
Credential of your own application registered with SUNAT, you provide it. Example: a1b2c3d4-…
client-secret string required
Credential of your own application registered with SUNAT, you provide it. Example: ••••••••
ruc-emisor string required
Tax ID of the invoice issuer. Example: 20987654321
cod-comprobante string required
Document type: 01 invoice, 03 receipt. Example: 01
serie string required
Invoice series. Example: F001
numero string required
Sequential number. Example: 184
fecha-emision string required
Issue date, dd/mm/yyyy. Example: 15/03/2026
monto number required
Total amount. Invoices and receipts only. Example: 1416.00

Response

Main fields this lookup returns:

  • success
  • data.estadoCp
  • data.estadoRuc
  • data.condDomiRuc
  • data.*Descripcion

Status codes

200 OK
Lookup resolved. Counts one request against the plan.
401 Invalid or expired token
The authentication header is missing or the token isn't valid.
403 No access
The plan doesn't cover this service, or the subscription isn't active.
404 Not found
The lookup ran but returned nothing. It still counts.
429 Limit reached
The period's lookups have run out.
500 Service error
The official source failed to answer. Nothing is cached.