GuíaEjemplosReferencia API
apisunat.netIngresar

Cuenta

  • GETComprobar la clave
  • GETPlan y consumo del mes

Emisores

  • GETListar RUC
  • POSTRegistrar un RUC
  • GETConsultar un RUC
  • PATCHActivar o desactivar un RUC
  • PUTGuardar credenciales SUNAT
  • POSTValidar el RUC con SUNAT
  • POSTPasar el RUC a producción

Series y establecimientos

  • GETListar series
  • GETListar establecimientos
  • POSTCrear o actualizar un establecimiento

Utilidades

  • POSTCalcular totales e IGV
  • GETListar catálogos SUNAT
  • GETBuscar en el catálogo 25 (productos SUNAT)
  • GETConsultar un catálogo

Documentos

  • GETListar documentos
  • POSTEmitir factura, boleta, nota o retención
  • GETConsultar un documento
  • GETDescargar PDF, XML, ZIP o CDR
  • POSTReenviar a SUNAT
  • POSTConsultar el ticket en SUNAT
  • GETHistorial de correos
  • POSTEnviar por correo
  • POSTReintentar un correo

Anulaciones

  • POSTAnular documentos
  • GETConsultar una anulación

GRE

  • POSTEmitir una guía de remisión (GRE)
  • GETConsultar una guía

Recursos

  • GETEspecificación OpenAPI
  • GETColección Postman
  • GETResumen para asistentes de IA
GET/issuer/documents/{id}/{file}

Descargar PDF, XML, ZIP o CDR

El PDF se devuelve directamente. XML, ZIP y CDR responden 302 hacia una URL firmada de corta duración.

Send request

Use the documented inputs to call this endpoint directly.

API serverbase URL
Bearer tokenBearerAuthoptional
Stored only in this browser for the BearerAuth security scheme and reused on every API page in this group.

Parameters

Values are applied to the request and the example on the right.

idpath · string · uuidrequired
filepath · stringrequired
Valuesenum

"pdf" · "xml" · "zip" · "cdr"

formatquery · stringoptional

Solo PDF: a4 (por defecto), a5, ticket80, ticket58 o ticket50.

Valuesenum

"a4" · "a5" · "ticket80" · "ticket58" · "ticket50"

Responses

200application/pdf

PDF (200) o redirección 302 a la URL firmada de XML, ZIP o CDR.

string
400application/json

VALIDATION_ERROR: El cuerpo, los parámetros o una regla del comprobante no son válidos. fields indica el campo.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
401application/json

UNAUTHENTICATED: Falta la clave API o no es válida.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
402application/json

TRIAL_EXPIRED: La prueba gratuita venció.

TRIAL_EXHAUSTED: La prueba gratuita consumió sus operaciones.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
403application/json

WORKSPACE_SUSPENDED: El workspace está suspendido.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
404application/json

NOT_FOUND: El recurso no existe en el workspace.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
409application/json

FILES_NOT_AVAILABLE: El XML, ZIP o PDF todavía no está disponible.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
429application/json

RATE_LIMITED: Se superó el límite de peticiones. Respeta el header Retry-After.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
500application/json

INTERNAL_ERROR: Error interno. Reintenta y comparte el requestId con soporte.

{
  "error": {
    "code": "string",
    "fields": {},
    "message": "string",
    "requestId": "",
    "retryable": true
  }
}
errorrequired
Consultar un documento< PreviousReenviar a SUNATNext >

Powered by heyo

curl --request GET \
  'https://api.apisunat.net/api/v1/issuer/documents/{id}/pdf?format=a4'
string