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

Emitir factura, boleta, nota o retención

La clave decide el ambiente y el RUC: asu_test_ emite con el RUC de prueba en SUNAT beta (numeración propia, sin consumir el plan; requiere su validación beta); asu_live_ emite con el RUC de producción en SUNAT producción y requiere que esté habilitado (PRODUCTION_NOT_ENABLED si no). Un RUC del otro modo responde ISSUER_FORBIDDEN.

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.

Idempotency-Keyheader · stringrequired

Clave única por operación (máximo 255 caracteres). Repetirla con el mismo cuerpo devuelve el mismo resultado durante 7 días.

Request body

application/jsonrequired
additionalInformationstringoptional
affectedDocumentIdstringoptional
cargoTransportoptional

Servicio de transporte de carga sujeto a detracción (operación 1004).

chargesarray<>optional
currencyenumrequired

Values: "PEN" · "USD"

customerrequired
detractionoptional
discountAmountnumberoptional
discountPercentnumberoptional
documentTypeenumrequired

Values: "01" · "03" · "04" · "07" · "08" · "20" · "40"

dueDatestringoptional
establishmentCodestringoptional
exchangeRatenumberoptional
igvRateenumoptional

Tasa del IGV para las líneas gravadas (10): 18 general o 10.5 para restaurantes y hoteles MYPE.

Values: 18 · 10.5

installmentsarray<>optional
issueDatestringrequired
issueTimestringoptional
itemsarray<>required
legendsarray<>optional
noteReasonstringoptional
noteReasonCodestringoptional
notesstringoptional
numberobjectoptional
operationTypestringoptional
paymentConditionenumoptional

Values: "cash" · "credit"

paymentsarray<>optional
perceptionoptional
prepaymentsarray<>optional
purchaseOrderstringoptional
purchaseSettlementoptional

Liquidación de compra (04): domicilio del vendedor y lugar de la operación.

relatedDocumentsarray<>optional
retentionoptional
rucstringoptional
seriesobjectoptional
vehiclePlatestringoptional

Responses

202application/json

Aceptado; SUNAT puede seguir procesando.

{
  "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.

IDEMPOTENCY_REQUIRED: Falta el header Idempotency-Key.

{
  "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.

PLAN_REQUIRED: El workspace no tiene una suscripción activa.

PLAN_LIMIT_REACHED: Se consumieron las operaciones del plan en el mes.

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

WORKSPACE_SUSPENDED: El workspace está suspendido.

ISSUER_FORBIDDEN: El RUC no pertenece al workspace de la clave.

PRODUCTION_NOT_ENABLED: Una clave asu_live_ emite siempre en SUNAT producción y el RUC todavía no está habilitado. Usa una clave asu_test_ para probar en beta o completa la validación de producción.

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

ISSUER_NOT_CONFIGURED: El RUC no tiene credenciales SUNAT listas: guarda el certificado y completa la validación beta (clave asu_test_) o la de producción (clave asu_live_).

SERIES_BUSY: La serie está reservada por otra emisión; reintenta.

DOCUMENT_NUMBER_CONFLICT: La serie y número ya fueron emitidos.

IDEMPOTENCY_CONFLICT: La Idempotency-Key ya se usó con otro cuerpo.

REQUEST_IN_PROGRESS: Otra petición con la misma Idempotency-Key sigue en proceso.

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

CUSTOMER_NOT_FOUND: No se encontraron datos para el RUC o DNI del cliente; envía customer.name.

EXPORT_DATA_INCOMPLETE: Faltan datos obligatorios de exportación (operación 0200).

NOTE_ISSUER_MISMATCH: La nota y el documento afectado son de RUC distintos.

INVALID_SERIES: La serie no existe o no corresponde al tipo de documento.

SERIES_INACTIVE: La serie está inactiva.

NUMBER_REQUIRED: La serie es manual y requiere number.

{
  "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
Listar documentos< PreviousConsultar un documentoNext >

Powered by heyo

curl --request POST \
  'https://api.apisunat.net/api/v1/issuer/documents' \
  --header 'Idempotency-Key: string' \
  --header 'Content-Type: application/json' \
  --data '{
  "ruc": "20123456789",
  "documentType": "01",
  "series": "F001",
  "currency": "PEN",
  "issueDate": "2026-10-27",
  "customer": {
    "documentType": "6",
    "documentNumber": "20100066603",
    "name": "Cliente S.A.C.",
    "email": "[email protected]"
  },
  "items": [
    {
      "code": "SERV-01",
      "description": "Servicio de consultoría",
      "quantity": 1,
      "unitPrice": 118,
      "includesTax": true,
      "taxCode": "10",
      "unitCode": "ZZ"
    }
  ],
  "paymentCondition": "cash"
}'
{
  "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"
}