Skip to content

Reference / SUNAT

Exchange rate

SUNAT's official exchange rate, buy and sell per day. Queried by whole month, not by single date.

POST /api/sunat/tipo-cambio

What it's for: Convert dollar amounts to soles using the official rate for the day of the transaction.

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.

Body parameters

anio string required
Year to query. Example: 2026
mes string required
Month, 1 to 12. Example: 8

Response

Main fields this lookup returns:

  • resultado[].fecha
  • resultado[].compra
  • resultado[].venta

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.