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
POST/issuer/documents/{id}/query-sunat

Consultar el ticket en SUNAT

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

Responses

200application/json

Correcto.

{
  "createdAt": "string",
  "currency": "string",
  "customer": {
    "documentNumber": "string",
    "documentType": "string",
    "name": "string"
  },
  "environment": "string",
  "fullNumber": "string",
  "id": "",
  "issueDate": "string",
  "issuerRuc": "string",
  "links": {
    "cdr": "string",
    "pdf": "string",
    "self": "string",
    "xml": "string",
    "zip": "string"
  },
  "number": "string",
  "series": "string",
  "status": "string",
  "sunat": {
    "attempts": 1.5,
    "description": "string",
    "errorCode": "string",
    "errorMessage": "string",
    "responseCode": "string",
    "ticket": "string"
  },
  "test": true,
  "total": "string",
  "type": "string",
  "updatedAt": "string"
}
createdAtobjectrequired
currencyobjectrequired
customerobjectrequired
environmentstringrequired
fullNumberobjectrequired

Serie y número, por ejemplo F001-123.

idstringrequired

Identificador del documento en API SUNAT (UUID).

issueDateobjectrequired
issuerRucobjectrequired
linksrequired
numberobjectrequired
seriesstringrequired
statusstringrequired
sunatrequired
testbooleanrequired

true si se emitió con una clave asu_test_ (sandbox en SUNAT beta).

totalobjectrequired
typestringrequired

Tipo SUNAT: 01, 03, 07, 08, 09, 20 o 40.

updatedAtobjectrequired
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.

TEST_KEY_IN_PRODUCTION: La clave no corresponde: un documento emitido con asu_live_ solo se opera con asu_live_ (y uno de prueba con asu_test_).

{
  "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
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
Reenviar a SUNAT< PreviousHistorial de correosNext >

Powered by heyo

curl --request POST \
  'https://api.apisunat.net/api/v1/issuer/documents/{id}/query-sunat'
{
  "createdAt": "string",
  "currency": "string",
  "customer": {
    "documentNumber": "string",
    "documentType": "string",
    "name": "string"
  },
  "environment": "string",
  "fullNumber": "string",
  "id": "",
  "issueDate": "string",
  "issuerRuc": "string",
  "links": {
    "cdr": "string",
    "pdf": "string",
    "self": "string",
    "xml": "string",
    "zip": "string"
  },
  "number": "string",
  "series": "string",
  "status": "string",
  "sunat": {
    "attempts": 1.5,
    "description": "string",
    "errorCode": "string",
    "errorMessage": "string",
    "responseCode": "string",
    "ticket": "string"
  },
  "test": true,
  "total": "string",
  "type": "string",
  "updatedAt": "string"
}