tefacturo

Issue electronic invoice

Service to issue SUNAT-valid electronic invoices. Invoices are used for B2B transactions.

Important usage rules

  • tipoIntegracion: OFFLINE → your own ERP handles the correlative (series/number). ERP → tefacturo handles the correlative.
  • numero (in datosDocumento): it cannot be duplicated. If the number was already used, map/track the correlative so it is not resent.
  • fechaEmision: an electronic document (CPE) can be declared with at most 3 days of backdating.
  • Replace the fixed example RUC with the issuer RUC used in the URL and token; all three must match.
  • Response 200 values such as series, number, hash, signature, and identifier are illustrative; the API generates their actual values for each request.
PUThttps://jarvis.tefacturo.pe/factura-api/invoice2u/integracion/factura/{ruc}

Service to issue electronic invoices. Replace {ruc} with the issuer RUC. The document will be digitally signed and automatically submitted to SUNAT.

Headers

HeaderValueDescription
AuthorizationBearer {token}Authentication token obtained from the login endpoint.
Content-Typeapplication/jsonContent type for the request body.

Request Body

Send the full document payload. The right panel uses the same invoice cases shown on the JSON examples page: taxed invoice, credit invoice, exempt sale, and free transfer.

The complete examples are in the right panel for quick copy.

Successful Response (200)

When the invoice is issued successfully, the API returns the generated document metadata: signature, hash, identifier, series, number, total, observation, and document type. This confirms the invoice was digitally signed, sent to SUNAT, and accepted.

Check the right panel to view and copy the sample response.

Price Record Type

The field tipoRegistro inside the close2u object defines how prices sent in the document detail are interpreted:

ValueDescription
PRECIOS_SIN_IGVPrices sent in valorVentaUnitarioItem DO NOT include IGV. The system calculates IGV (18%) automatically over the sent value.
PRECIOS_CON_IGVPrices sent already include IGV. The system splits the price to obtain taxable base and corresponding tax.

IGV Calculation Note

Use the unit field according to the item's IGV affectation and close2u.tipoRegistro. The system completes the complementary sale value or sale price when it can be derived from the IGV rule.

CaseField to sendSystem interpretation
Gravado + PRECIOS_SIN_IGVvalorVentaUnitarioItemValor de venta sin IGV. El sistema calcula el IGV y obtiene el precio de venta.
Gravado + PRECIOS_CON_IGVprecioVentaUnitarioItemPrecio de venta con IGV. El sistema lo descompone para reemplazar/obtener el valor de venta y el impuesto.
Exonerado o inafectovalorVentaUnitarioItemNo hay IGV por calcular. En ausencia de IGV, el sistema asume el valor enviado como base y lo usa como precio de venta.

Field Reference

Complete table of request body fields:

Objeto close2u3 campos
CampoTipoRequeridoDescription
tipoIntegracionstringTipo de integración. Usar "OFFLINE"
tipoPlantillastringPlantilla del PDF. "01" es la plantilla estándar
tipoRegistrostringPRECIOS_CON_IGV o PRECIOS_SIN_IGV
Objeto datosDocumentocampos principales
CampoTipoRequeridoDescription
seriestringSerie del comprobante (ej: FFA6). Debe iniciar con "F" para facturas
numeronumberDocument correlative number
monedastringCódigo de moneda ISO 4217. PEN (soles), USD (dólares)
fechaEmisionstringFecha de emisión en formato YYYY-MM-DD
horaEmisionstring | nullNoHora de emisión en formato HH:mm:ss. Si es null, se usa la hora actual
formaPagostringCONTADO o CREDITO
medioPagostringNoMedio de pago: DEPOSITO_CUENTA, TRANSFERENCIA, EFECTIVO, etc.
condicionPagostringNoCondicion de pago: CONTADO, CREDITO_30, CREDITO_60, etc.
ordencomprastring | nullNoNúmero de orden de compra asociada
glosastringNoObservaciones o notas adicionales del comprobante
Objeto detalleDocumentoarray (items)
CampoTipoRequeridoDescription
codigoProductostringCódigo interno del producto o servicio
descripcionstringDescripción detallada del producto o servicio
tipoAfectacionstringTipo de afectación IGV: GRAVADO_OPERACION_ONEROSA, EXONERADO_OPERACION_ONEROSA, INAFECTO_OPERACION_ONEROSA
unidadMedidastringUnidad de medida: UNIDAD_BIENES, KILOGRAMO, SERVICIO, etc.
cantidadstringCantidad de unidades del producto
valorVentaUnitarioItemnumberPrecio unitario. Depende del tipoRegistro (con o sin IGV)
Objeto emisordatos del emisor
CampoTipoRequeridoDescription
correostringCorreo electrónico del emisor
nombreComercialstringNombre comercial de la empresa emisora
nombreLegalstringRazón social registrada en SUNAT
numeroDocumentoIdentidadstringRUC del emisor (11 dígitos)
tipoDocumentoIdentidadstringTipo de documento: RUC
Objeto receptorcliente
CampoTipoRequeridoDescription
correostringCorreo electrónico del cliente
correoCopiastringNoCorreo adicional para copia del comprobante
domicilioFiscal.direccionstringNoDirección fiscal del cliente
domicilioFiscal.ubigeostringNoCódigo de ubigeo INEI (6 dígitos)
nombreComercialstringNombre comercial del cliente
nombreLegalstringRazón social del cliente
numeroDocumentoIdentidadstringRUC o DNI del cliente
tipoDocumentoIdentidadstringRUC, DNI, CE (carnet de extranjería), PASAPORTE
Objeto informacionAdicionalopcional
CampoTipoRequeridoDescription
tipoOperacionstringTipo de operación SUNAT: VENTA_INTERNA, EXPORTACION, etc.
coVendedorstringNoCódigo del vendedor asignado al comprobante

Error Handling

CodeStatusDescription
400Bad RequestRequest body has validation errors. Check required fields and formats.
401UnauthorizedAuthentication token invalid, expired, or not provided.
403ForbiddenYou do not have permissions to issue documents for the provided RUC.
404Not FoundThe provided RUC is not registered in the system.
500Internal Server ErrorInternal server error. Try again or contact support.

Related Endpoints